]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/julia-repl.js
1 /*! `julia-repl` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Description: Julia REPL sessions
9 Author: Morten Piibeleht <morten.piibeleht@gmail.com>
10 Website: https://julialang.org
14 The Julia REPL code blocks look something like the following:
16 julia> function foo(x)
19 foo (generic function with 1 method)
21 They start on a new line with "julia>". Usually there should also be a space after this, but
22 we also allow the code to start right after the > character. The code may run over multiple
23 lines, but the additional lines must start with six spaces (i.e. be indented to match
24 "julia>"). The rest of the code is assumed to be output from the executed code and will be
27 Using simply spaces to identify line continuations may get a false-positive if the output
28 also prints out six spaces, but such cases should be rare.
31 function juliaRepl(hljs
) {
36 className: 'meta.prompt',
40 // end the highlighting if we are on a new line and the line does not have at
41 // least six spaces in the beginning
47 // jldoctest Markdown blocks are used in the Julia manual and package docs indicate
48 // code snippets that should be verified when the documentation is built. They can be
49 // either REPL-like or script-like, but are usually REPL-like and therefore we apply
50 // julia-repl highlighting to them. More information can be found in Documenter's
51 // manual: https://juliadocs.github.io/Documenter.jl/latest/man/doctests.html
52 aliases: [ 'jldoctest' ],
60 hljs
.registerLanguage('julia-repl', hljsGrammar
);