Merge pull request #1182 from markknol/patch-1

Update haxe version + add eval package
pull/1301/head
Simon Legner 4 years ago committed by GitHub
commit 0dfe62b733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@ module Docs
class Haxe class Haxe
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
css('.viewsource', 'hr', 'h1 > small', '.inherited-fields').remove css('.viewsource', 'hr', 'h1 > small', '.inherited-fields', '.label-meta').remove
css('h4 + h1').each do |node| css('h4 + h1').each do |node|
node.after(node.previous_element) node.after(node.previous_element)
@ -28,8 +28,10 @@ module Docs
end end
css('.field').each do |node| css('.field').each do |node|
h3 = node.at_css('h3:not(:empty)')
next unless h3.present?
link = node.at_css('a[name]') link = node.at_css('a[name]')
node.at_css('h3:not(:empty)')['id'] = link['name'] h3['id'] = link['name']
link.before(link.children).remove link.before(link.children).remove
node.before(node.children).remove node.before(node.children).remove
end end

@ -2,7 +2,7 @@ module Docs
class Haxe < UrlScraper class Haxe < UrlScraper
self.name = 'Haxe' self.name = 'Haxe'
self.type = 'simple' self.type = 'simple'
self.release = '3.4.7' self.release = '4.1.3'
self.base_url = 'https://api.haxe.org/' self.base_url = 'https://api.haxe.org/'
html_filters.push 'haxe/clean_html', 'haxe/entries' html_filters.push 'haxe/clean_html', 'haxe/entries'
@ -10,7 +10,7 @@ module Docs
options[:container] = '.span9' options[:container] = '.span9'
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2005&ndash;2018 Haxe Foundation<br> &copy; 2005&ndash;2020 Haxe Foundation<br>
Licensed under a MIT license. Licensed under a MIT license.
HTML HTML
@ -20,7 +20,7 @@ module Docs
code: 'https://github.com/HaxeFoundation/haxe' code: 'https://github.com/HaxeFoundation/haxe'
} }
options[:skip_patterns] = [/\A(?:cpp|cs|flash|java|js|neko|php|python|lua|hl|sys)/i] options[:skip_patterns] = [/\A(?:cpp|cs|flash|java|js|neko|php|python|lua|hl|sys|eval)/i]
end end
version 'C++' do version 'C++' do
@ -67,6 +67,10 @@ module Docs
self.base_url = 'https://api.haxe.org/python/' self.base_url = 'https://api.haxe.org/python/'
end end
version 'Eval' do
self.base_url = 'https://api.haxe.org/eval/'
end
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('https://api.haxe.org/', opts) doc = fetch_doc('https://api.haxe.org/', opts)
label = doc.at_css('.container.main-content h1 > small').content label = doc.at_css('.container.main-content h1 > small').content

Loading…
Cancel
Save