deno.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. module Docs
  2. class Deno < UrlScraper
  3. self.name = 'Deno'
  4. self.type = 'simple'
  5. self.links = {
  6. home: 'https://deno.com/',
  7. code: 'https://github.com/denoland/deno'
  8. }
  9. # https://github.com/denoland/manual/blob/main/LICENSE
  10. # https://github.com/denoland/deno/blob/main/LICENSE.md
  11. options[:attribution] = <<-HTML
  12. &copy; 2018–2025 the Deno authors<br>
  13. Licensed under the MIT License.
  14. HTML
  15. html_filters.push 'deno/entries', 'deno/clean_html'
  16. version '2' do
  17. self.release = '2.4.4'
  18. self.base_url = 'https://docs.deno.com/'
  19. self.root_path = 'runtime'
  20. options[:only_patterns] = [/\Aruntime/, /\Aapi\/deno\/~/, /\Adeploy/, /\Asubhosting/]
  21. options[:skip_patterns] = [
  22. /\Aruntime\/manual/,
  23. /\Aapi\/deno\/.+\.prototype\z/, # all prototype pages get redirected to the main page
  24. /\Aapi\/deno\/~\/Deno\.jupyter\.MediaBundle.+/, # docs unavailable
  25. /\Aapi\/deno\/~\/Deno\.OpMetrics/, # deprecated in deno 2
  26. ]
  27. options[:trailing_slash] = false
  28. end
  29. version '1' do
  30. self.release = '1.27.0'
  31. end
  32. def get_latest_version(opts)
  33. get_latest_github_release('denoland', 'deno', opts)
  34. end
  35. end
  36. end