nim.rb 769 B

123456789101112131415161718192021222324252627
  1. module Docs
  2. class Nim < UrlScraper
  3. self.type = 'simple'
  4. self.release = '0.19.0'
  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.txt)
  13. options[:attribution] = <<-HTML
  14. &copy; 2006&ndash;2018 Andreas Rumpf<br>
  15. Licensed under the MIT License.
  16. HTML
  17. def get_latest_version(options, &block)
  18. fetch_doc('https://nim-lang.org/docs/overview.html', options) do |doc|
  19. block.call doc.at_css('.container > .docinfo > tbody > tr:last-child > td').content.strip
  20. end
  21. end
  22. end
  23. end