devdocs/lib/docs/scrapers/markdown.rb
MasterEnoc 4ab95dc382 Fix get_latest_version procedure that were showing bad information
- markdown: update scraper and fix get_latest_version

- rails: fix get_latest_version, it was showing an outdated
  version as the latest version

- apache: fix get_latest_version, it was showing and
  outdated version as the latest version

- cakephp: fix get_latest_version, it was showing and
  outdated version as the latest version
2020-11-09 10:01:45 -06:00

23 lines
650 B
Ruby

module Docs
class Markdown < UrlScraper
self.name = 'Markdown'
self.type = 'simple'
self.release = '1.0.1'
self.base_url = 'https://daringfireball.net/projects/markdown/syntax'
html_filters.push 'markdown/clean_html', 'markdown/entries'
options[:container] = '.article'
options[:skip_links] = true
options[:attribution] = <<-HTML
&copy; 2004 John Gruber<br>
Licensed under the BSD License.
HTML
def get_latest_version(opts)
doc = fetch_doc('http://daringfireball.net/projects/markdown', opts)
doc.at_css('.article p a').content.scan(/\d\.\d*\.*\d*\.*\d*\.*/)[0]
end
end
end