nim.rb 853 B

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