History

Merge pull request #1555 from MasterEnoc/latex

Add get_latest_version to latex

Simon Legner committed 5 years ago

Commit 336377c2 parents 049a6a8 589aeb71 file · +9 −0Browse files

Unified · Split

lib/docs/scrapers/latex.rb+9−0
@@ -1,8 +1,10 @@
1+# coding: utf-8
12 module Docs
23 class Latex < UrlScraper
34 self.name = 'LaTeX'
45 self.slug = 'latex'
56 self.type = 'simple'
7+ self.release = 'April 2021'
68 self.links = {
79 home: 'https://ctan.org/pkg/latex2e-help-texinfo/'
810 }
@@ -18,5 +20,12 @@ module Docs · 9 unmodified lines
1820 Public Domain Software
1921 HTML
2022
23+ def get_latest_version(opts)
24+ body = fetch('https://latexref.xyz/', opts)
25+ body = body.scan(/\(\w+\s\d+\)/)[0]
26+ body.sub!('(', '')
27+ body.sub!(')', '')
28+ end
29+
2130 end
2231 end