Skip to content

Commit 0941990

Browse files
committed
Add julia-repl alias and document Julia aliases
1 parent 56849b8 commit 0941990

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/languages/julia.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,25 @@ function(hljs) {
8484

8585
// placeholder for recursive self-reference
8686
var DEFAULT = {
87-
aliases: ['jldoctest'],
87+
// The aliases here are placeholders for future grammars that incorporate Julia code.
88+
// However, simply applying ordinary Julia highlighting is good enough for now.
89+
//
90+
// `julia-repl` should highlight interactive REPL code snippets. A REPL line starts with
91+
// "julia>" and is followed by Julia code, which should be highlighted accordingly.
92+
// Generally the code is a single Julia statement, which may also span multiple lines.
93+
// The Julia code may then be followed by the output of the executed code and should not
94+
// be highlighted. For example:
95+
//
96+
// julia> function foo(x)
97+
// x + 1
98+
// end
99+
// foo (generic function with 1 method) <-- should not be highlighted
100+
//
101+
// `jldoctest` Markdown blocks are used in the Julia manual and package docs indicate
102+
// code snippets that should be verified when the documentation is built. They can be
103+
// either REPL-type or script-type, and are documented in Documenter's manual:
104+
// https://juliadocs.github.io/Documenter.jl/latest/man/doctests.html
105+
aliases: ['jldoctest', 'julia-repl'],
88106
lexemes: VARIABLE_NAME_RE, keywords: KEYWORDS, illegal: /<\//
89107
};
90108

0 commit comments

Comments
 (0)