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
2 class Haxe2 class Haxe
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 css('.viewsource', 'hr', 'h1 > small', '.inherited-fields').remove5 css('.viewsource', 'hr', 'h1 > small', '.inherited-fields', '.label-meta').remove
6 6
7 css('h4 + h1').each do |node|7 css('h4 + h1').each do |node|
8 node.after(node.previous_element)8 node.after(node.previous_element)
@@ -28,8 +28,10 @@ module Docs · 19 unmodified lines
28 end28 end
29 29
30 css('.field').each do |node|30 css('.field').each do |node|
31 h3 = node.at_css('h3:not(:empty)')
32 next unless h3.present?
31 link = node.at_css('a[name]')33 link = node.at_css('a[name]')
32 node.at_css('h3:not(:empty)')['id'] = link['name']34 h3['id'] = link['name']
33 link.before(link.children).remove35 link.before(link.children).remove
34 node.before(node.children).remove36 node.before(node.children).remove
35 end37 end
lib/docs/scrapers/haxe.rb+7−3
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Haxe < UrlScraper2 class Haxe < UrlScraper
3 self.name = 'Haxe'3 self.name = 'Haxe'
4 self.type = 'simple'4 self.type = 'simple'
5 self.release = '3.4.7'5 self.release = '4.1.3'
6 self.base_url = 'https://api.haxe.org/'6 self.base_url = 'https://api.haxe.org/'
7 7
8 html_filters.push 'haxe/clean_html', 'haxe/entries'8 html_filters.push 'haxe/clean_html', 'haxe/entries'
@@ -10,7 +10,7 @@ module Docs · 1 unmodified line
10 options[:container] = '.span9'10 options[:container] = '.span9'
11 11
12 options[:attribution] = <<-HTML12 options[:attribution] = <<-HTML
13 &copy; 2005&ndash;2018 Haxe Foundation<br>13 &copy; 2005&ndash;2020 Haxe Foundation<br>
14 Licensed under a MIT license.14 Licensed under a MIT license.
15 HTML15 HTML
16 16
@@ -20,7 +20,7 @@ module Docs · 3 unmodified lines
20 code: 'https://github.com/HaxeFoundation/haxe'20 code: 'https://github.com/HaxeFoundation/haxe'
21 }21 }
22 22
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]
24 end24 end
25 25
26 version 'C++' do26 version 'C++' do
@@ -67,6 +67,10 @@ module Docs · 40 unmodified lines
67 self.base_url = 'https://api.haxe.org/python/'67 self.base_url = 'https://api.haxe.org/python/'
68 end68 end
69 69
70 version 'Eval' do
71 self.base_url = 'https://api.haxe.org/eval/'
72 end
73
70 def get_latest_version(opts)74 def get_latest_version(opts)
71 doc = fetch_doc('https://api.haxe.org/', opts)75 doc = fetch_doc('https://api.haxe.org/', opts)
72 label = doc.at_css('.container.main-content h1 > small').content76 label = doc.at_css('.container.main-content h1 > small').content