Merge pull request #1064 from simon04/julia

julia: add versions 1.1 and 1.2; enable syntax highlighting
pull/1072/head
Jasper van Merle 6 years ago
commit 0fd990dfcb

@ -58,6 +58,7 @@ class app.models.Entry extends app.Model
'crystal': 'cr' 'crystal': 'cr'
'elixir': 'ex' 'elixir': 'ex'
'javascript': 'js' 'javascript': 'js'
'julia': 'jl'
'jquery': '$' 'jquery': '$'
'knockout.js': 'ko' 'knockout.js': 'ko'
'less': 'ls' 'less': 'ls'

@ -383,7 +383,7 @@ credits = [
'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt' 'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt'
], [ ], [
'Julia', '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', 'MIT',
'https://raw.githubusercontent.com/JuliaLang/julia/master/LICENSE.md' 'https://raw.githubusercontent.com/JuliaLang/julia/master/LICENSE.md'
], [ ], [

@ -1,5 +1,5 @@
/* PrismJS 1.17.1 /* 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') var _self = (typeof window !== 'undefined')
? window // if in browser ? 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) { (function (Prism) {
Prism.languages.kotlin = Prism.languages.extend('clike', { Prism.languages.kotlin = Prism.languages.extend('clike', {
'keyword': { 'keyword': {

@ -21,6 +21,7 @@ module Docs
css('pre').each do |node| css('pre').each do |node|
node.content = node.content node.content = node.content
node['data-language'] = 'julia'
end end
doc doc

@ -16,14 +16,21 @@ module Docs
def additional_entries def additional_entries
return [] unless slug.start_with?('stdlib') 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 = node.content
name.gsub! '.:', '.' name.gsub! '.:', '.'
name.remove! 'Base.' name.remove! 'Base.'
category = node.parent.at_css('.docstring-category').content category = node.parent.at_css('.docstring-category').content
name << '()' if category == 'Function' || category == 'Method' name << '()' if category == 'Function' || category == 'Method'
[name, node['id']]
entries << [name, node['id']] unless used_names.key?(name)
used_names[name] = true
end end
entries
end end
end end
end end

@ -8,12 +8,32 @@ module Docs
options[:only_patterns] = [/\Amanual\//, /\Astdlib\//] options[:only_patterns] = [/\Amanual\//, /\Astdlib\//]
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2009&ndash;2018 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br> &copy; 2009&ndash;2019 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors<br>
Licensed under the MIT License. Licensed under the MIT License.
HTML 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 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.base_url = "https://docs.julialang.org/en/v#{release}/"
self.type = 'julia' self.type = 'julia'

Loading…
Cancel
Save