tcl_tk.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. module Docs
  2. class TclTk < UrlScraper
  3. self.name = 'Tcl/Tk'
  4. self.type = 'tcl_tk'
  5. self.slug = 'tcl_tk'
  6. self.release = '8.6.6'
  7. self.base_url = 'https://www.tcl.tk/man/tcl/'
  8. self.root_path = 'contents.htm'
  9. self.links = {
  10. home: 'https://www.tcl.tk/',
  11. code: 'https://sourceforge.net/projects/tcl/files/Tcl/'
  12. }
  13. html_filters.push 'tcl_tk/entries', 'tcl_tk/clean_html', 'title'
  14. options[:root_title] = 'Tcl/Tk Documentation'
  15. options[:trailing_slash] = false
  16. options[:skip] = %w(siteinfo.htm)
  17. options[:skip_patterns] = [
  18. # ignore keyword list pages
  19. /\AKeywords\//,
  20. # ignore C-API, only required for extension developers
  21. /\ATclLib\//,
  22. /\ATkLib\//,
  23. /\AItclLib\//,
  24. /\ATdbcLib\//
  25. ]
  26. options[:attribution] = <<-HTML
  27. Licensed under <a href="http://tcl.tk/software/tcltk/license.html">Tcl/Tk terms</a>
  28. HTML
  29. def get_latest_version(opts)
  30. doc = fetch_doc('https://www.tcl.tk/man/tcl/contents.htm', opts)
  31. doc.at_css('h2').content.scan(/Tk([0-9.]+)/)[0][0]
  32. end
  33. end
  34. end