History

Merge pull request #1182 from markknol/patch-1

Update haxe version + add eval package

Simon Legner committed 5 years ago

Commit 0dfe62b2 parents e336c9d 97edd612 files · +11 −5Browse files

Unified · Split

2 files
  1. lib/docs/filters/haxe/clean_html.rb +4 −2
  2. lib/docs/scrapers/haxe.rb +7 −3
lib/docs/filters/haxe/clean_html.rb+4−2
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Haxe
33 class CleanHtmlFilter < Filter
44 def call
5− css('.viewsource', 'hr', 'h1 > small', '.inherited-fields').remove
5+ css('.viewsource', 'hr', 'h1 > small', '.inherited-fields', '.label-meta').remove
66
77 css('h4 + h1').each do |node|
88 node.after(node.previous_element)
@@ -28,8 +28,10 @@ module Docs · 19 unmodified lines
2828 end
2929
3030 css('.field').each do |node|
31+ h3 = node.at_css('h3:not(:empty)')
32+ next unless h3.present?
3133 link = node.at_css('a[name]')
32− node.at_css('h3:not(:empty)')['id'] = link['name']
34+ h3['id'] = link['name']
3335 link.before(link.children).remove
3436 node.before(node.children).remove
3537 end
lib/docs/scrapers/haxe.rb+7−3
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Haxe < UrlScraper
33 self.name = 'Haxe'
44 self.type = 'simple'
5− self.release = '3.4.7'
5+ self.release = '4.1.3'
66 self.base_url = 'https://api.haxe.org/'
77
88 html_filters.push 'haxe/clean_html', 'haxe/entries'
@@ -10,7 +10,7 @@ module Docs · 1 unmodified line
1010 options[:container] = '.span9'
1111
1212 options[:attribution] = <<-HTML
13− &copy; 2005&ndash;2018 Haxe Foundation<br>
13+ &copy; 2005&ndash;2020 Haxe Foundation<br>
1414 Licensed under a MIT license.
1515 HTML
1616
@@ -20,7 +20,7 @@ module Docs · 3 unmodified lines
2020 code: 'https://github.com/HaxeFoundation/haxe'
2121 }
2222
23− options[:skip_patterns] = [/\A(?:cpp|cs|flash|java|js|neko|php|python|lua|hl|sys)/i]
23+ options[:skip_patterns] = [/\A(?:cpp|cs|flash|java|js|neko|php|python|lua|hl|sys|eval)/i]
2424 end
2525
2626 version 'C++' do
@@ -67,6 +67,10 @@ module Docs · 40 unmodified lines
6767 self.base_url = 'https://api.haxe.org/python/'
6868 end
6969
70+ version 'Eval' do
71+ self.base_url = 'https://api.haxe.org/eval/'
72+ end
73+
7074 def get_latest_version(opts)
7175 doc = fetch_doc('https://api.haxe.org/', opts)
7276 label = doc.at_css('.container.main-content h1 > small').content