From 12c347410ea3c4ce8bfb7f5c6c9d3125e7892e74 Mon Sep 17 00:00:00 2001 From: MasterEnoc Date: Thu, 26 Nov 2020 11:43:22 -0600 Subject: [PATCH 1/3] Add Julia version 1.5.3 --- .../javascripts/templates/pages/about_tmpl.coffee | 2 +- lib/docs/scrapers/julia.rb | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 1c287f8c..4843389d 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -408,7 +408,7 @@ credits = [ 'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt' ], [ 'Julia', - '2009-2019 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors', + '2009-2020 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors', 'MIT', 'https://raw.githubusercontent.com/JuliaLang/julia/master/LICENSE.md' ], [ diff --git a/lib/docs/scrapers/julia.rb b/lib/docs/scrapers/julia.rb index 4cc9ef2a..5c6f4957 100644 --- a/lib/docs/scrapers/julia.rb +++ b/lib/docs/scrapers/julia.rb @@ -7,10 +7,21 @@ module Docs options[:attribution] = <<-HTML - © 2009–2019 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors
+ © 2009–2020 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors
Licensed under the MIT License. HTML + version '1.5' do + self.release = '1.5.3' + self.base_url = "https://docs.julialang.org/en/v#{release}/" + self.type = 'julia' + + html_filters.push 'julia/entries', 'julia/clean_html' + + options[:container] = '.docs-main' + options[:only_patterns] = [/\Amanual\//, /\Abase\//, /\Astdlib\//] + end + version '1.2' do self.release = '1.2.0' self.base_url = "https://docs.julialang.org/en/v#{release}/" From 996fddbf4e7703311e3b107860452e3bd5dd53ae Mon Sep 17 00:00:00 2001 From: MasterEnoc Date: Mon, 30 Nov 2020 09:51:28 -0600 Subject: [PATCH 2/3] Add Julia version 1.4 and 1.3 --- lib/docs/scrapers/julia.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/docs/scrapers/julia.rb b/lib/docs/scrapers/julia.rb index 5c6f4957..39c9f9d0 100644 --- a/lib/docs/scrapers/julia.rb +++ b/lib/docs/scrapers/julia.rb @@ -22,6 +22,28 @@ module Docs options[:only_patterns] = [/\Amanual\//, /\Abase\//, /\Astdlib\//] end + version '1.4' do + self.release = '1.4.2' + self.base_url = "https://docs.julialang.org/en/v#{release}/" + self.type = 'julia' + + html_filters.push 'julia/entries', 'julia/clean_html' + + options[:container] = '.docs-main' + options[:only_patterns] = [/\Amanual\//, /\Abase\//, /\Astdlib\//] + end + + version '1.3' do + self.release = '1.3.1' + self.base_url = "https://docs.julialang.org/en/v#{release}/" + self.type = 'julia' + + html_filters.push 'julia/entries', 'julia/clean_html' + + options[:container] = '#docs' + options[:only_patterns] = [/\Amanual\//, /\Abase\//, /\Astdlib\//] + end + version '1.2' do self.release = '1.2.0' self.base_url = "https://docs.julialang.org/en/v#{release}/" From 17cbea7d4eea8fe3fb5cdde799ea3a1a4ab53893 Mon Sep 17 00:00:00 2001 From: Phil Scherer Date: Mon, 30 Nov 2020 19:40:24 +0000 Subject: [PATCH 3/3] Fix HTML filter for Julia 1.4+ --- lib/docs/filters/julia/clean_html.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/julia/clean_html.rb b/lib/docs/filters/julia/clean_html.rb index 00ebfb6d..d228166a 100644 --- a/lib/docs/filters/julia/clean_html.rb +++ b/lib/docs/filters/julia/clean_html.rb @@ -4,11 +4,19 @@ module Docs def call css('> header', '> footer').remove + # Julia 1.4+ uses different HTML + at_css('h1').content = at_css('h1').content + + if at_css('#documenter-page') + @doc.children = at_css('#documenter-page').children + end + # End 1.4+ specific cleaning + css('.docstring', 'div:not([class])').each do |node| node.before(node.children).remove end - css('.docstring-header').each do |node| + css('.docstring-header', 'header').each do |node| node.name = 'h3' node.children.each { |child| child.remove if child.text? } node.remove_attribute('class')