فهرست منبع

Merge pull request #1387 from MasterEnoc/julia

Add Julia version 1.5.3
Simon Legner 5 سال پیش
والد
کامیت
2313e7ac9f
3فایلهای تغییر یافته به همراه44 افزوده شده و 3 حذف شده
  1. 1 1
      assets/javascripts/templates/pages/about_tmpl.coffee
  2. 9 1
      lib/docs/filters/julia/clean_html.rb
  3. 34 1
      lib/docs/scrapers/julia.rb

+ 1 - 1
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'
   ], [

+ 9 - 1
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')

+ 34 - 1
lib/docs/scrapers/julia.rb

@@ -7,10 +7,43 @@ module Docs
 
 
     options[:attribution] = <<-HTML
-      &copy; 2009&ndash;2019 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br>
+      &copy; 2009&ndash;2020 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br>
       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.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}/"