bun.rb 844 B

123456789101112131415161718192021222324252627282930313233
  1. module Docs
  2. class Bun < UrlScraper
  3. self.name = 'Bun'
  4. self.type = 'simple'
  5. self.slug = 'bun'
  6. self.links = {
  7. home: 'https://leafletjs.com/',
  8. code: 'https://github.com/oven-sh/bun'
  9. }
  10. self.release = '1.3.4'
  11. self.base_url = "https://bun.com/docs/"
  12. self.root_path = 'installation'
  13. html_filters.push 'bun/clean_html', 'bun/entries'
  14. # https://bun.com/docs/project/licensing
  15. options[:attribution] = <<-HTML
  16. &copy; bun.com, oven-sh, Jarred Sumner<br>
  17. Licensed under the MIT License.
  18. HTML
  19. options[:download_images] = false
  20. options[:skip_patterns] = [/^project/, /^feedback/]
  21. options[:fix_urls] = ->(url) do
  22. url.sub! %r{.md$}, ''
  23. url
  24. end
  25. def get_latest_version(opts)
  26. get_latest_github_release('oven-sh', 'bun', opts)[5..]
  27. end
  28. end
  29. end