History

Merge pull request #1064 from simon04/julia

Jasper van Merle committed 7 years ago

Commit 0fd990d2 parents c25865b 79260c26 files · +49 −6Browse files

Showing the changes to lib/docs (3 of 6 files). Show all

Unified · Split

3 files
  1. lib/docs/filters/julia/clean_html.rb +1 −0
  2. lib/docs/filters/julia/entries.rb +9 −2
  3. lib/docs/scrapers/julia.rb +22 −2
lib/docs/filters/julia/clean_html.rb+1−0
@@ -21,6 +21,7 @@ module Docs · 20 unmodified lines
2121
2222 css('pre').each do |node|
2323 node.content = node.content
24+ node['data-language'] = 'julia'
2425 end
2526
2627 doc
lib/docs/filters/julia/entries.rb+9−2
@@ -16,14 +16,21 @@ module Docs · 15 unmodified lines
1616 def additional_entries
1717 return [] unless slug.start_with?('stdlib')
1818
19− css('.docstring-binding[id]').map do |node|
19+ entries = []
20+ used_names = {}
21+
22+ css('.docstring-binding[id]').each do |node|
2023 name = node.content
2124 name.gsub! '.:', '.'
2225 name.remove! 'Base.'
2326 category = node.parent.at_css('.docstring-category').content
2427 name << '()' if category == 'Function' || category == 'Method'
25− [name, node['id']]
28+
29+ entries << [name, node['id']] unless used_names.key?(name)
30+ used_names[name] = true
2631 end
32+
33+ entries
2734 end
2835 end
2936 end
lib/docs/scrapers/julia.rb+22−2
@@ -8,12 +8,32 @@ module Docs · 7 unmodified lines
88 options[:only_patterns] = [/\Amanual\//, /\Astdlib\//]
99
1010 options[:attribution] = <<-HTML
11− &copy; 2009&ndash;2018 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br>
11+ &copy; 2009&ndash;2019 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br>
1212 Licensed under the MIT License.
1313 HTML
1414
15+ version '1.2' do
16+ self.release = '1.2.0'
17+ self.base_url = "https://docs.julialang.org/en/v#{release}/"
18+ self.type = 'julia'
19+
20+ html_filters.push 'julia/entries', 'julia/clean_html'
21+
22+ options[:container] = '#docs'
23+ end
24+
25+ version '1.1' do
26+ self.release = '1.1.1'
27+ self.base_url = "https://docs.julialang.org/en/v#{release}/"
28+ self.type = 'julia'
29+
30+ html_filters.push 'julia/entries', 'julia/clean_html'
31+
32+ options[:container] = '#docs'
33+ end
34+
1535 version '1.0' do
16− self.release = '1.0.1'
36+ self.release = '1.0.4'
1737 self.base_url = "https://docs.julialang.org/en/v#{release}/"
1838 self.type = 'julia'
1939