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
1module Docs2module Docs
2 class Latex < UrlScraper3 class Latex < UrlScraper
3 self.name = 'LaTeX'4 self.name = 'LaTeX'
4 self.slug = 'latex'5 self.slug = 'latex'
5 self.type = 'simple'6 self.type = 'simple'
7 self.release = 'April 2021'
6 self.links = {8 self.links = {
7 home: 'https://ctan.org/pkg/latex2e-help-texinfo/'9 home: 'https://ctan.org/pkg/latex2e-help-texinfo/'
8 }10 }
@@ -18,5 +20,12 @@ module Docs · 9 unmodified lines
18 Public Domain Software20 Public Domain Software
19 HTML21 HTML
20 22
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
21 end30 end
22end31end