latex.rb 714 B

12345678910111213141516171819202122232425262728293031
  1. # coding: utf-8
  2. module Docs
  3. class Latex < UrlScraper
  4. self.name = 'LaTeX'
  5. self.slug = 'latex'
  6. self.type = 'simple'
  7. self.release = 'May 2022'
  8. self.links = {
  9. home: 'https://ctan.org/pkg/latex2e-help-texinfo/'
  10. }
  11. self.base_url = 'http://latexref.xyz'
  12. html_filters.push 'latex/entries', 'latex/clean_html'
  13. options[:skip_patterns] = [/^\/dev\//, /\.(dvi|pdf)$/]
  14. options[:attribution] = <<-HTML
  15. &copy; 2007–2018 Karl Berry<br>
  16. Public Domain Software
  17. HTML
  18. def get_latest_version(opts)
  19. body = fetch('https://latexref.xyz/', opts)
  20. body = body.scan(/\(\w+\s\d+\)/)[0]
  21. body.sub!('(', '')
  22. body.sub!(')', '')
  23. end
  24. end
  25. end