ocaml.rb 819 B

1234567891011121314151617181920212223242526272829303132333435
  1. module Docs
  2. class Ocaml < FileScraper
  3. self.name = 'OCaml'
  4. self.type = 'ocaml'
  5. self.root_path = 'index.html'
  6. self.release = '4.14'
  7. self.base_url = "https://www.ocaml.org/releases/#{self.release}/htmlman/"
  8. self.links = {
  9. home: 'https://ocaml.org/',
  10. code: 'https://github.com/ocaml/ocaml'
  11. }
  12. html_filters.push 'ocaml/entries', 'ocaml/clean_html'
  13. options[:skip] = %w(
  14. libref/index.html
  15. )
  16. options[:skip_patterns] = [
  17. /\Acompilerlibref\//,
  18. /\Alibref\/type_/,
  19. /\Alibref\/Stdlib\.\w+\.html/,
  20. ]
  21. options[:attribution] = <<-HTML
  22. &copy; 1995-2022 INRIA.
  23. HTML
  24. def get_latest_version(opts)
  25. doc = fetch_doc('https://www.ocaml.org/releases/', opts)
  26. doc.css('#main-contents li > a').first.content
  27. end
  28. end
  29. end