nim.rb 770 B

1234567891011121314151617181920212223242526
  1. module Docs
  2. class Nim < UrlScraper
  3. self.type = 'simple'
  4. self.release = '2.0.2'
  5. self.base_url = 'https://nim-lang.org/docs/'
  6. self.root_path = 'overview.html'
  7. self.links = {
  8. home: 'https://nim-lang.org/',
  9. code: 'https://github.com/nim-lang/Nim'
  10. }
  11. html_filters.push 'nim/entries', 'nim/clean_html'
  12. options[:skip] = %w(theindex.html docgen.html tut1.html tut2.html tut3.html tools.html)
  13. options[:attribution] = <<-HTML
  14. &copy; 2006&ndash;2024 Andreas Rumpf<br>
  15. Licensed under the MIT License.
  16. HTML
  17. def get_latest_version(opts)
  18. doc = fetch_doc('https://nim-lang.org/docs/overview.html', opts)
  19. doc.at_css('.container > .docinfo > tbody > tr:last-child > td').content.strip
  20. end
  21. end
  22. end