diff --git a/assets/javascripts/models/entry.coffee b/assets/javascripts/models/entry.coffee index 93555c6e..fbda5b01 100644 --- a/assets/javascripts/models/entry.coffee +++ b/assets/javascripts/models/entry.coffee @@ -58,6 +58,7 @@ class app.models.Entry extends app.Model 'crystal': 'cr' 'elixir': 'ex' 'javascript': 'js' + 'julia': 'jl' 'jquery': '$' 'knockout.js': 'ko' 'less': 'ls' diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 265fdb31..383fb226 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -383,7 +383,7 @@ credits = [ 'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt' ], [ 'Julia', - '2009-2018 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors', + '2009-2019 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors', 'MIT', 'https://raw.githubusercontent.com/JuliaLang/julia/master/LICENSE.md' ], [ diff --git a/assets/javascripts/vendor/prism.js b/assets/javascripts/vendor/prism.js index c2cbaadd..9e886921 100644 --- a/assets/javascripts/vendor/prism.js +++ b/assets/javascripts/vendor/prism.js @@ -1,5 +1,5 @@ /* PrismJS 1.17.1 -https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+c+bash+cpp+coffeescript+ruby+d+dart+markup-templating+elixir+erlang+go+java+php+json+kotlin+crystal+lua+django+matlab+typescript+nginx+nim+perl+sql+scss+python+jsx+rust+yaml */ +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+c+bash+cpp+coffeescript+ruby+d+dart+markup-templating+elixir+erlang+go+java+php+json+julia+kotlin+crystal+lua+django+matlab+typescript+nginx+nim+perl+sql+scss+python+jsx+rust+yaml */ var _self = (typeof window !== 'undefined') ? window // if in browser : ( @@ -1894,6 +1894,20 @@ Prism.languages.json = { } }; +Prism.languages.julia= { + 'comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true + }, + 'string': /("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2/, + 'keyword' : /\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/, + 'boolean' : /\b(?:true|false)\b/, + 'number' : /(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:[efp][+-]?\d+)?j?/i, + 'operator': /[-+*^%÷&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥]/, + 'punctuation' : /[{}[\];(),.:]/, + 'constant': /\b(?:(?:NaN|Inf)(?:16|32|64)?)\b/ +}; + (function (Prism) { Prism.languages.kotlin = Prism.languages.extend('clike', { 'keyword': { diff --git a/lib/docs/filters/julia/clean_html.rb b/lib/docs/filters/julia/clean_html.rb index 9c1096dc..00ebfb6d 100644 --- a/lib/docs/filters/julia/clean_html.rb +++ b/lib/docs/filters/julia/clean_html.rb @@ -21,6 +21,7 @@ module Docs css('pre').each do |node| node.content = node.content + node['data-language'] = 'julia' end doc diff --git a/lib/docs/filters/julia/entries.rb b/lib/docs/filters/julia/entries.rb index 46be86c9..f9774394 100644 --- a/lib/docs/filters/julia/entries.rb +++ b/lib/docs/filters/julia/entries.rb @@ -16,14 +16,21 @@ module Docs def additional_entries return [] unless slug.start_with?('stdlib') - css('.docstring-binding[id]').map do |node| + entries = [] + used_names = {} + + css('.docstring-binding[id]').each do |node| name = node.content name.gsub! '.:', '.' name.remove! 'Base.' category = node.parent.at_css('.docstring-category').content name << '()' if category == 'Function' || category == 'Method' - [name, node['id']] + + entries << [name, node['id']] unless used_names.key?(name) + used_names[name] = true end + + entries end end end diff --git a/lib/docs/scrapers/julia.rb b/lib/docs/scrapers/julia.rb index c9c96da6..7573ffe7 100644 --- a/lib/docs/scrapers/julia.rb +++ b/lib/docs/scrapers/julia.rb @@ -8,12 +8,32 @@ module Docs options[:only_patterns] = [/\Amanual\//, /\Astdlib\//] options[:attribution] = <<-HTML - © 2009–2018 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors
+ © 2009–2019 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors
Licensed under the MIT License. HTML + version '1.2' do + self.release = '1.2.0' + self.base_url = "https://docs.julialang.org/en/v#{release}/" + self.type = 'julia' + + html_filters.push 'julia/entries', 'julia/clean_html' + + options[:container] = '#docs' + end + + version '1.1' do + self.release = '1.1.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' + end + version '1.0' do - self.release = '1.0.1' + self.release = '1.0.4' self.base_url = "https://docs.julialang.org/en/v#{release}/" self.type = 'julia'