├── .editorconfig ├── .gitignore ├── Gulpfile.js ├── MIT-License.md ├── README.md ├── _includes ├── howto.html ├── indicator.html ├── intro.html ├── sizes.html ├── slider--a.html ├── slider--b-flat.html ├── slider--b.html ├── slider--c-weight.html ├── slider--c.html ├── slider--default-rounded.html ├── slider--default.html ├── slider-intro.html └── variations.html ├── bower.json ├── dist ├── titatoggle-dist-min.css ├── titatoggle-dist.css └── titatoggle.scss ├── docs ├── GNU-General-Public-License-v2.0.txt ├── README.md ├── css │ └── main.css ├── index.html └── js │ ├── highlight.js │ ├── index.js │ └── languages │ ├── 1c.js │ ├── abnf.js │ ├── accesslog.js │ ├── actionscript.js │ ├── ada.js │ ├── apache.js │ ├── applescript.js │ ├── arduino.js │ ├── armasm.js │ ├── asciidoc.js │ ├── aspectj.js │ ├── autohotkey.js │ ├── autoit.js │ ├── avrasm.js │ ├── awk.js │ ├── axapta.js │ ├── bash.js │ ├── basic.js │ ├── bnf.js │ ├── brainfuck.js │ ├── cal.js │ ├── capnproto.js │ ├── ceylon.js │ ├── clean.js │ ├── clojure-repl.js │ ├── clojure.js │ ├── cmake.js │ ├── coffeescript.js │ ├── coq.js │ ├── cos.js │ ├── cpp.js │ ├── crmsh.js │ ├── crystal.js │ ├── cs.js │ ├── csp.js │ ├── css.js │ ├── d.js │ ├── dart.js │ ├── delphi.js │ ├── diff.js │ ├── django.js │ ├── dns.js │ ├── dockerfile.js │ ├── dos.js │ ├── dsconfig.js │ ├── dts.js │ ├── dust.js │ ├── ebnf.js │ ├── elixir.js │ ├── elm.js │ ├── erb.js │ ├── erlang-repl.js │ ├── erlang.js │ ├── excel.js │ ├── fix.js │ ├── flix.js │ ├── fortran.js │ ├── fsharp.js │ ├── gams.js │ ├── gauss.js │ ├── gcode.js │ ├── gherkin.js │ ├── glsl.js │ ├── go.js │ ├── golo.js │ ├── gradle.js │ ├── groovy.js │ ├── haml.js │ ├── handlebars.js │ ├── haskell.js │ ├── haxe.js │ ├── hsp.js │ ├── htmlbars.js │ ├── http.js │ ├── hy.js │ ├── inform7.js │ ├── ini.js │ ├── irpf90.js │ ├── java.js │ ├── javascript.js │ ├── jboss-cli.js │ ├── json.js │ ├── julia-repl.js │ ├── julia.js │ ├── kotlin.js │ ├── lasso.js │ ├── ldif.js │ ├── leaf.js │ ├── less.js │ ├── lisp.js │ ├── livecodeserver.js │ ├── livescript.js │ ├── llvm.js │ ├── lsl.js │ ├── lua.js │ ├── makefile.js │ ├── markdown.js │ ├── mathematica.js │ ├── matlab.js │ ├── maxima.js │ ├── mel.js │ ├── mercury.js │ ├── mipsasm.js │ ├── mizar.js │ ├── mojolicious.js │ ├── monkey.js │ ├── moonscript.js │ ├── n1ql.js │ ├── nginx.js │ ├── nimrod.js │ ├── nix.js │ ├── nsis.js │ ├── objectivec.js │ ├── ocaml.js │ ├── openscad.js │ ├── oxygene.js │ ├── parser3.js │ ├── perl.js │ ├── pf.js │ ├── php.js │ ├── pony.js │ ├── powershell.js │ ├── processing.js │ ├── profile.js │ ├── prolog.js │ ├── protobuf.js │ ├── puppet.js │ ├── purebasic.js │ ├── python.js │ ├── q.js │ ├── qml.js │ ├── r.js │ ├── rib.js │ ├── roboconf.js │ ├── routeros.js │ ├── rsl.js │ ├── ruby.js │ ├── ruleslanguage.js │ ├── rust.js │ ├── scala.js │ ├── scheme.js │ ├── scilab.js │ ├── scss.js │ ├── shell.js │ ├── smali.js │ ├── smalltalk.js │ ├── sml.js │ ├── sqf.js │ ├── sql.js │ ├── stan.js │ ├── stata.js │ ├── step21.js │ ├── stylus.js │ ├── subunit.js │ ├── swift.js │ ├── taggerscript.js │ ├── tap.js │ ├── tcl.js │ ├── tex.js │ ├── thrift.js │ ├── tp.js │ ├── twig.js │ ├── typescript.js │ ├── vala.js │ ├── vbnet.js │ ├── vbscript-html.js │ ├── vbscript.js │ ├── verilog.js │ ├── vhdl.js │ ├── vim.js │ ├── x86asm.js │ ├── xl.js │ ├── xml.js │ ├── xquery.js │ ├── yaml.js │ └── zephir.js ├── index.html ├── package.json └── scss ├── _syntax.scss ├── _titatoggle.scss ├── main.scss ├── theme.scss └── titatoggle.scss /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.scss] 13 | indent_style = space 14 | indent_size = 2 15 | end_of_line = lf 16 | charset = utf-8 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | node_modules 3 | -------------------------------------------------------------------------------- /MIT-License.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TiTatoggle - (bootstrap 4 addon without JS) 2 | =========================================== 3 | 4 | Using awesome toggle buttons without Javascript or any other logic, other than plane form elements. 5 | The Pattern is the same as Twitter-Bootstrap. So it can be implemented without a breeze. 6 | 7 | Browser support: Internet Explorer 9/10/11, Edge, FireFox, Safari, Chrome, Safari Ios, Stock Android browser 4.2, Chrome Android 8 | 9 | Install package: 10 | ``` 11 | $ npm install titatoggle --save-dev (Bootstrap 4.x.x) 12 | $ npm install titatoggle@1.0.0 --save-dev (Legacy bootstrap 3.x.x) 13 | $ yarn add titatoggle 14 | $ bower install titatoggle 15 | ``` 16 | ### Example usage 17 | ```html 18 |
19 | 22 |
23 | ``` 24 | 25 | More examples can be found at the documentation site:[Titatoggle](http://kleinejan.github.io/titatoggle/) 26 | 27 | MIT License 28 | -------------------------------------------------------------------------------- /_includes/howto.html: -------------------------------------------------------------------------------- 1 |

Howto

2 |

3 | Okay and now what? 4 |

5 | 6 |

7 | You have a few options to include this into your project. 8 |

9 | 10 |

Install

11 | 12 |

Latest version (Bootstrap 4)

13 | 14 | $ npm install titatoggle --save-dev 15 | 16 |

Previous version (Bootstrap 3)

17 | 18 | $ npm install titatoggle@1.0.0 --save-dev 19 | 20 |

Bower

21 | 22 | $ bower install titatoggle 23 | 24 | 25 |

SASS

26 |

27 | Inside the project you will find _titatoggle.scss Include this file into your own project, and stuff just works. 28 | If needed, you can fiddle around with some sass variables. 29 |

30 | 31 |

CSS

32 |

33 | There is alway the option to include only the titatoggle-dist.css. Keep in mind this thing is build on top off Bootstrap 3. 34 |


35 | 	
36 | 	
37 |

38 | 39 |

License

40 |

GNU General Public License v2.0

41 | -------------------------------------------------------------------------------- /_includes/indicator.html: -------------------------------------------------------------------------------- 1 |

Indicator

2 |

3 | Small visual que for the label to show that the form-check is checked. 4 |

5 |
6 | Not so usable for the visually impaired, due 7 | to the fact it's only a color and contrast is to low. 8 |
9 |
10 | 13 |
14 |
15 | 18 |
19 |
20 | 23 |
24 |
25 | 28 |
29 | 30 |

31 | 
32 | 
33 | ... 34 | danger 35 | ... 36 |
37 | 38 |
39 | ... 40 | danger 41 | ... 42 |
43 | 44 |
45 | ... 46 | danger 47 | ... 48 |
49 | 50 |
51 | ... 52 | danger 53 | ... 54 |
55 |
56 | 57 |
58 | -------------------------------------------------------------------------------- /_includes/intro.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Bootstrap 4 Ti-Ta-Toggle 4 | (addon without JS) 5 |

6 |

7 | Using awesome toggle buttons without Javascript or any other logic, other than plane form elements. 8 | The Pattern is the same as Twitter-Bootstrap. So it can be implemented without a breeze. 9 |

10 |

11 | Browser support: Internet Explorer 9/10/11, Edge, FireFox, Safari, Chrome, Safari Ios, Stock Android browser 12 | 4.2, Chrome Android 13 |

14 |

15 | Version 1.0.0 of TitaToggle has support for Bootstrap v3.x.x 16 |

17 |
18 |
19 |
20 |
Default checkbox
21 |
22 | 25 |
26 |
27 |
28 |
With text
29 |
30 | 33 |
34 |
35 |
36 |
iOS like
37 |
38 | 41 |
42 |
43 |
44 |
Material like
45 |
46 | 49 |
50 |
51 |
52 |
53 |
54 |

55 | 57 | 59 |

60 | 61 |
62 |
63 | -------------------------------------------------------------------------------- /_includes/sizes.html: -------------------------------------------------------------------------------- 1 |

Sizes

2 |

3 | Propper sizing option should get the pony over the hill for your next project. 4 |

5 |

6 | 7 | Next to the default size there are 3 sizes: 8 |

13 | Just like Bootstrap. In the case you need something special, use the _titatoggle.less 14 | to alther your preferend settings and sizes. 15 |

16 | 17 |
18 |
19 |
Default
20 |
21 | 24 |
25 |
26 |
27 |
Small
28 |
29 | 32 |
33 |
34 |
35 |
Medium
36 |
37 | 40 |
41 |
42 |
43 |
Large
44 |
45 | 48 |
49 |
50 |
51 | 52 | 53 |

54 | 
55 | 
56 | ... 57 |
58 | 59 |
60 | ... 61 |
62 | 63 |
64 | ... 65 |
66 | 67 |
68 | ... 69 |
70 |
71 | -------------------------------------------------------------------------------- /_includes/slider--a.html: -------------------------------------------------------------------------------- 1 |

Slider A checkbox-slider--a

2 |

3 | Sometimes you need some text to double the meaning / state of the checkbox. 4 | I've noticed many people have trouble with a checkbox, when it's "On" of "Off". To make 5 | this more clear, you can use this version. 6 |

7 |
8 |
9 |
Default
10 |
11 | 14 |
15 |
16 | 19 |
20 |
21 | 24 |
25 |
26 | 29 |
30 | 31 |
32 |
33 |
Small
34 |
35 | 38 |
39 |
40 | 43 |
44 |
45 |
46 |
Medium
47 |
48 | 51 |
52 |
53 | 56 |
57 |
58 |
59 |
Large
60 |
61 | 64 |
65 |
66 | 69 |
70 |
71 |
72 | 73 |

74 | 
75 | ... 76 |
77 |
78 | -------------------------------------------------------------------------------- /_includes/slider--b-flat.html: -------------------------------------------------------------------------------- 1 |

Slider B Flat checkbox-slider--b-flat

2 |

3 | Just flat, it seems to be very fashionable. We just wait until the bevel is back. 4 |

5 |
6 |
7 |
Default
8 |
9 | 12 |
13 |
14 | 17 |
18 |
19 | 22 |
23 |
24 | 27 |
28 |
29 |
30 |
Small
31 |
32 | 35 |
36 |
37 | 40 |
41 |
42 |
43 |
Medium
44 |
45 | 48 |
49 |
50 | 53 |
54 |
55 |
56 |
Large
57 |
58 | 61 |
62 |
63 | 66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 |

75 | 
76 | ... 77 |
78 |
79 | -------------------------------------------------------------------------------- /_includes/slider--b.html: -------------------------------------------------------------------------------- 1 |

Slider B checkbox-slider--b

2 |

3 | An iOS like version of just a plain checkbox. 4 |

5 |
6 |
7 |
Default
8 |
9 | 12 |
13 |
14 | 17 |
18 |
19 | 22 |
23 |
24 | 27 |
28 |
29 |
30 |
Small
31 |
32 | 35 |
36 |
37 | 40 |
41 |
42 |
43 |
Medium
44 |
45 | 48 |
49 |
50 | 53 |
54 |
55 |
56 |
Large
57 |
58 | 61 |
62 |
63 | 66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 |

75 | 
76 | ... 77 |
78 |
79 | -------------------------------------------------------------------------------- /_includes/slider--c-weight.html: -------------------------------------------------------------------------------- 1 |

Slider C Weight checkbox-slider--c-weight

2 |

3 | Giving the slider some more weight. 4 |

5 |
6 |
7 |
Default
8 |
9 | 12 |
13 |
14 | 17 |
18 |
19 | 22 |
23 |
24 | 27 |
28 |
29 |
30 |
Small
31 |
32 | 35 |
36 |
37 | 40 |
41 |
42 |
43 |
Medium
44 |
45 | 48 |
49 |
50 | 53 |
54 |
55 |
56 |
Large
57 |
58 | 61 |
62 |
63 | 66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 |

74 | 
75 | ... 76 |
77 |
78 | -------------------------------------------------------------------------------- /_includes/slider--c.html: -------------------------------------------------------------------------------- 1 |

Slider C checkbox-slider--c

2 |

3 | Inspired by the Google material toggle boxes. And again this is just plain Bootstrap 3. 4 |

5 |
6 |
7 |
Default
8 |
9 | 12 |
13 |
14 | 17 |
18 |
19 | 22 |
23 |
24 | 27 |
28 |
29 |
30 |
Small
31 |
32 | 35 |
36 |
37 | 40 |
41 |
42 |
43 |
Medium
44 |
45 | 48 |
49 |
50 | 53 |
54 |
55 |
56 |
Large
57 |
58 | 61 |
62 |
63 | 66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 |

74 | 
75 | ... 76 |
77 |
78 | -------------------------------------------------------------------------------- /_includes/slider--default-rounded.html: -------------------------------------------------------------------------------- 1 |

Slider Default rounded checkbox-slider--a-rounded

2 |

3 | It takes the edge off. 4 |

5 |
6 |
7 |
Default
8 |
9 | 12 |
13 |
14 | 17 |
18 |
19 | 22 |
23 |
24 | 27 |
28 |
29 |
30 |
Small
31 |
32 | 35 |
36 |
37 | 40 |
41 |
42 |
43 |
Medium
44 |
45 | 48 |
49 |
50 | 53 |
54 |
55 |
56 |
Large
57 |
58 | 61 |
62 |
63 | 66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 |

75 | 
76 | ... 77 |
78 |
79 | -------------------------------------------------------------------------------- /_includes/slider--default.html: -------------------------------------------------------------------------------- 1 |

Slider default checkbox-slider--default

2 |

3 | Out of the box this would be the modest version, without any bells and whistles. 4 |

5 |
6 |
7 |
Default
8 |
9 | 12 |
13 |
14 | 17 |
18 |
19 | 22 |
23 |
24 | 27 |
28 |
29 |
30 |
Small
31 |
32 | 35 |
36 |
37 | 40 |
41 |
42 |
43 |
Medium
44 |
45 | 48 |
49 |
50 | 53 |
54 |
55 |
56 |
Large
57 |
58 | 61 |
62 |
63 | 66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 |

75 | 
76 | ... 77 |
78 |
79 | -------------------------------------------------------------------------------- /_includes/slider-intro.html: -------------------------------------------------------------------------------- 1 |

Intro

2 |

3 | The only difference between default Bootstrap checkbox is the structure. Titatoggle uses implicit labels. That makes life easy. 4 | So structure wise it's different from bootstrap. 5 |

6 | 7 |

Bootstrap 4

8 |

9 | The Bootstrap 4 default way of generating checkbox looks a like this: 10 |

11 |
12 | 13 | 16 |
17 |

18 | 
19 | 20 | 23 |
24 |
25 | 26 |

Ti-Ta-Toggle awesomenes

27 | 28 |

29 |   .checkbox-slider--TYPE
30 | 
31 |

you get this result:

32 | 33 |
34 | 38 |
39 | 40 |
41 | 44 |
45 | 46 | 47 |

48 | 
49 | 52 |
53 |
54 | 55 | 56 | 57 |
58 |

59 |

Note:

60 |

61 | Don't forget to add the span after the input 62 |

63 |

64 |
65 |
66 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "titatoggle", 3 | "version": "2.1.2", 4 | "homepage": "https://github.com/kleinejan/titatoggle", 5 | "authors": [ 6 | "Jan Enning " 7 | ], 8 | "description": "Default bootstrap 4 checkbox toggle buttons. Just default Bootstrap, add a class to use these awesome toggle buttons. Browser support: Internet Explorer 9/10.11, Edge, FireFox, Safari, Chrome, Safari Ios, Stock Android browser 4.2, Chrome Android", 9 | "main": [ 10 | "dist/_titatoggle.less", 11 | "dist/titatoggle-dist.css", 12 | "dist/titatoggle-dist-min.css" 13 | ], 14 | "moduleType": [ 15 | "yui" 16 | ], 17 | "ignore": [ 18 | "/.*", 19 | "_config.yml", 20 | "_includes", 21 | "_layouts", 22 | "node_modules", 23 | "bower_components", 24 | "css", 25 | "docs", 26 | "less", 27 | "Gruntfile.js", 28 | "index.html", 29 | "package.json" 30 | ], 31 | "keywords": [ 32 | "css", 33 | "less", 34 | "bootstrap", 35 | "togglebutton", 36 | "checkbox", 37 | "form", 38 | "buttons", 39 | "toggle" 40 | ], 41 | "license": "GNU GENERAL PUBLIC LICENSE V2.0", 42 | "dependencies": { 43 | "bootstrap": "~4.0.0" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | TiTatoggle - (bs3 addon without JS) 2 | ========== 3 | 4 | Using awesome toggle buttons without Javascript or any other logic, other than plane form elements. 5 | The Pattern is the same as Twitter-Bootstrap. So it can be implemented without a breeze. 6 | 7 | Browser support: Internet Explorer 9, FireFox, Safari, Chrome, Safari Ios, Stock Android browser 4.2, Chrome Android 8 | 9 | Install: 10 | ''' 11 | $ bower install titatoggle 12 | ''' 13 | 14 | GNU General Public License v2.0 15 | 16 | ```html 17 |
18 | 21 |
22 | ``` 23 | -------------------------------------------------------------------------------- /docs/js/languages/abnf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var regexes = { 3 | ruleDeclaration: "^[a-zA-Z][a-zA-Z0-9-]*", 4 | unexpectedChars: "[!@#$^&',?+~`|:]" 5 | }; 6 | 7 | var keywords = [ 8 | "ALPHA", 9 | "BIT", 10 | "CHAR", 11 | "CR", 12 | "CRLF", 13 | "CTL", 14 | "DIGIT", 15 | "DQUOTE", 16 | "HEXDIG", 17 | "HTAB", 18 | "LF", 19 | "LWSP", 20 | "OCTET", 21 | "SP", 22 | "VCHAR", 23 | "WSP" 24 | ]; 25 | 26 | var commentMode = hljs.COMMENT(";", "$"); 27 | 28 | var terminalBinaryMode = { 29 | className: "symbol", 30 | begin: /%b[0-1]+(-[0-1]+|(\.[0-1]+)+){0,1}/ 31 | }; 32 | 33 | var terminalDecimalMode = { 34 | className: "symbol", 35 | begin: /%d[0-9]+(-[0-9]+|(\.[0-9]+)+){0,1}/ 36 | }; 37 | 38 | var terminalHexadecimalMode = { 39 | className: "symbol", 40 | begin: /%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+){0,1}/, 41 | }; 42 | 43 | var caseSensitivityIndicatorMode = { 44 | className: "symbol", 45 | begin: /%[si]/ 46 | }; 47 | 48 | var ruleDeclarationMode = { 49 | begin: regexes.ruleDeclaration + '\\s*=', 50 | returnBegin: true, 51 | end: /=/, 52 | relevance: 0, 53 | contains: [{className: "attribute", begin: regexes.ruleDeclaration}] 54 | }; 55 | 56 | return { 57 | illegal: regexes.unexpectedChars, 58 | keywords: keywords.join(" "), 59 | contains: [ 60 | ruleDeclarationMode, 61 | commentMode, 62 | terminalBinaryMode, 63 | terminalDecimalMode, 64 | terminalHexadecimalMode, 65 | caseSensitivityIndicatorMode, 66 | hljs.QUOTE_STRING_MODE, 67 | hljs.NUMBER_MODE 68 | ] 69 | }; 70 | }; -------------------------------------------------------------------------------- /docs/js/languages/accesslog.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | contains: [ 4 | // IP 5 | { 6 | className: 'number', 7 | begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b' 8 | }, 9 | // Other numbers 10 | { 11 | className: 'number', 12 | begin: '\\b\\d+\\b', 13 | relevance: 0 14 | }, 15 | // Requests 16 | { 17 | className: 'string', 18 | begin: '"(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|PATCH|TRACE)', end: '"', 19 | keywords: 'GET POST HEAD PUT DELETE CONNECT OPTIONS PATCH TRACE', 20 | illegal: '\\n', 21 | relevance: 10 22 | }, 23 | // Dates 24 | { 25 | className: 'string', 26 | begin: /\[/, end: /\]/, 27 | illegal: '\\n' 28 | }, 29 | // Strings 30 | { 31 | className: 'string', 32 | begin: '"', end: '"', 33 | illegal: '\\n' 34 | } 35 | ] 36 | }; 37 | }; -------------------------------------------------------------------------------- /docs/js/languages/actionscript.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*'; 3 | var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)'; 4 | 5 | var AS3_REST_ARG_MODE = { 6 | className: 'rest_arg', 7 | begin: '[.]{3}', end: IDENT_RE, 8 | relevance: 10 9 | }; 10 | 11 | return { 12 | aliases: ['as'], 13 | keywords: { 14 | keyword: 'as break case catch class const continue default delete do dynamic each ' + 15 | 'else extends final finally for function get if implements import in include ' + 16 | 'instanceof interface internal is namespace native new override package private ' + 17 | 'protected public return set static super switch this throw try typeof use var void ' + 18 | 'while with', 19 | literal: 'true false null undefined' 20 | }, 21 | contains: [ 22 | hljs.APOS_STRING_MODE, 23 | hljs.QUOTE_STRING_MODE, 24 | hljs.C_LINE_COMMENT_MODE, 25 | hljs.C_BLOCK_COMMENT_MODE, 26 | hljs.C_NUMBER_MODE, 27 | { 28 | className: 'class', 29 | beginKeywords: 'package', end: '{', 30 | contains: [hljs.TITLE_MODE] 31 | }, 32 | { 33 | className: 'class', 34 | beginKeywords: 'class interface', end: '{', excludeEnd: true, 35 | contains: [ 36 | { 37 | beginKeywords: 'extends implements' 38 | }, 39 | hljs.TITLE_MODE 40 | ] 41 | }, 42 | { 43 | className: 'meta', 44 | beginKeywords: 'import include', end: ';', 45 | keywords: {'meta-keyword': 'import include'} 46 | }, 47 | { 48 | className: 'function', 49 | beginKeywords: 'function', end: '[{;]', excludeEnd: true, 50 | illegal: '\\S', 51 | contains: [ 52 | hljs.TITLE_MODE, 53 | { 54 | className: 'params', 55 | begin: '\\(', end: '\\)', 56 | contains: [ 57 | hljs.APOS_STRING_MODE, 58 | hljs.QUOTE_STRING_MODE, 59 | hljs.C_LINE_COMMENT_MODE, 60 | hljs.C_BLOCK_COMMENT_MODE, 61 | AS3_REST_ARG_MODE 62 | ] 63 | }, 64 | { 65 | begin: ':\\s*' + IDENT_FUNC_RETURN_TYPE_RE 66 | } 67 | ] 68 | }, 69 | hljs.METHOD_GUARD 70 | ], 71 | illegal: /#/ 72 | }; 73 | }; -------------------------------------------------------------------------------- /docs/js/languages/apache.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var NUMBER = {className: 'number', begin: '[\\$%]\\d+'}; 3 | return { 4 | aliases: ['apacheconf'], 5 | case_insensitive: true, 6 | contains: [ 7 | hljs.HASH_COMMENT_MODE, 8 | {className: 'section', begin: ''}, 9 | { 10 | className: 'attribute', 11 | begin: /\w+/, 12 | relevance: 0, 13 | // keywords aren’t needed for highlighting per se, they only boost relevance 14 | // for a very generally defined mode (starts with a word, ends with line-end 15 | keywords: { 16 | nomarkup: 17 | 'order deny allow setenv rewriterule rewriteengine rewritecond documentroot ' + 18 | 'sethandler errordocument loadmodule options header listen serverroot ' + 19 | 'servername' 20 | }, 21 | starts: { 22 | end: /$/, 23 | relevance: 0, 24 | keywords: { 25 | literal: 'on off all' 26 | }, 27 | contains: [ 28 | { 29 | className: 'meta', 30 | begin: '\\s\\[', end: '\\]$' 31 | }, 32 | { 33 | className: 'variable', 34 | begin: '[\\$%]\\{', end: '\\}', 35 | contains: ['self', NUMBER] 36 | }, 37 | NUMBER, 38 | hljs.QUOTE_STRING_MODE 39 | ] 40 | } 41 | } 42 | ], 43 | illegal: /\S/ 44 | }; 45 | }; -------------------------------------------------------------------------------- /docs/js/languages/autohotkey.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var BACKTICK_ESCAPE = { 3 | begin: '`[\\s\\S]' 4 | }; 5 | 6 | return { 7 | case_insensitive: true, 8 | aliases: [ 'ahk' ], 9 | keywords: { 10 | keyword: 'Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group', 11 | literal: 'A|0 true false NOT AND OR', 12 | built_in: 'ComSpec Clipboard ClipboardAll ErrorLevel', 13 | }, 14 | contains: [ 15 | { 16 | className: 'built_in', 17 | begin: 'A_[a-zA-Z0-9]+' 18 | }, 19 | BACKTICK_ESCAPE, 20 | hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [BACKTICK_ESCAPE]}), 21 | hljs.COMMENT(';', '$', {relevance: 0}), 22 | hljs.C_BLOCK_COMMENT_MODE, 23 | { 24 | className: 'number', 25 | begin: hljs.NUMBER_RE, 26 | relevance: 0 27 | }, 28 | { 29 | className: 'subst', // FIXED 30 | begin: '%(?=[a-zA-Z0-9#_$@])', end: '%', 31 | illegal: '[^a-zA-Z0-9#_$@]' 32 | }, 33 | { 34 | className: 'built_in', 35 | begin: '^\\s*\\w+\\s*,' 36 | //I don't really know if this is totally relevant 37 | }, 38 | { 39 | className: 'meta', 40 | begin: '^\\s*#\w+', end:'$', 41 | relevance: 0 42 | }, 43 | { 44 | className: 'symbol', 45 | contains: [BACKTICK_ESCAPE], 46 | variants: [ 47 | {begin: '^[^\\n";]+::(?!=)'}, 48 | {begin: '^[^\\n";]+:(?!=)', relevance: 0} // zero relevance as it catches a lot of things 49 | // followed by a single ':' in many languages 50 | ] 51 | }, 52 | { 53 | // consecutive commas, not for highlighting but just for relevance 54 | begin: ',\\s*,' 55 | } 56 | ] 57 | } 58 | }; -------------------------------------------------------------------------------- /docs/js/languages/avrasm.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | case_insensitive: true, 4 | lexemes: '\\.?' + hljs.IDENT_RE, 5 | keywords: { 6 | keyword: 7 | /* mnemonic */ 8 | 'adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs ' + 9 | 'brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr ' + 10 | 'clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor ' + 11 | 'fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul ' + 12 | 'muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs ' + 13 | 'sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub ' + 14 | 'subi swap tst wdr', 15 | built_in: 16 | /* general purpose registers */ 17 | 'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 ' + 18 | 'r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ' + 19 | /* IO Registers (ATMega128) */ 20 | 'ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h ' + 21 | 'tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ' + 22 | 'ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ' + 23 | 'ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk ' + 24 | 'tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ' + 25 | 'ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr ' + 26 | 'porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ' + 27 | 'ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf', 28 | meta: 29 | '.byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list ' + 30 | '.listmac .macro .nolist .org .set' 31 | }, 32 | contains: [ 33 | hljs.C_BLOCK_COMMENT_MODE, 34 | hljs.COMMENT( 35 | ';', 36 | '$', 37 | { 38 | relevance: 0 39 | } 40 | ), 41 | hljs.C_NUMBER_MODE, // 0x..., decimal, float 42 | hljs.BINARY_NUMBER_MODE, // 0b... 43 | { 44 | className: 'number', 45 | begin: '\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)' // $..., 0o... 46 | }, 47 | hljs.QUOTE_STRING_MODE, 48 | { 49 | className: 'string', 50 | begin: '\'', end: '[^\\\\]\'', 51 | illegal: '[^\\\\][^\']' 52 | }, 53 | {className: 'symbol', begin: '^[A-Za-z0-9_.$]+:'}, 54 | {className: 'meta', begin: '#', end: '$'}, 55 | { // подстановка в «.macro» 56 | className: 'subst', 57 | begin: '@[0-9]+' 58 | } 59 | ] 60 | }; 61 | }; -------------------------------------------------------------------------------- /docs/js/languages/awk.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var VARIABLE = { 3 | className: 'variable', 4 | variants: [ 5 | {begin: /\$[\w\d#@][\w\d_]*/}, 6 | {begin: /\$\{(.*?)}/} 7 | ] 8 | }; 9 | var KEYWORDS = 'BEGIN END if else while do for in break continue delete next nextfile function func exit|10'; 10 | var STRING = { 11 | className: 'string', 12 | contains: [hljs.BACKSLASH_ESCAPE], 13 | variants: [ 14 | { 15 | begin: /(u|b)?r?'''/, end: /'''/, 16 | relevance: 10 17 | }, 18 | { 19 | begin: /(u|b)?r?"""/, end: /"""/, 20 | relevance: 10 21 | }, 22 | { 23 | begin: /(u|r|ur)'/, end: /'/, 24 | relevance: 10 25 | }, 26 | { 27 | begin: /(u|r|ur)"/, end: /"/, 28 | relevance: 10 29 | }, 30 | { 31 | begin: /(b|br)'/, end: /'/ 32 | }, 33 | { 34 | begin: /(b|br)"/, end: /"/ 35 | }, 36 | hljs.APOS_STRING_MODE, 37 | hljs.QUOTE_STRING_MODE 38 | ] 39 | }; 40 | return { 41 | keywords: { 42 | keyword: KEYWORDS 43 | }, 44 | contains: [ 45 | VARIABLE, 46 | STRING, 47 | hljs.REGEXP_MODE, 48 | hljs.HASH_COMMENT_MODE, 49 | hljs.NUMBER_MODE 50 | ] 51 | } 52 | }; -------------------------------------------------------------------------------- /docs/js/languages/axapta.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | keywords: 'false int abstract private char boolean static null if for true ' + 4 | 'while long throw finally protected final return void enum else ' + 5 | 'break new catch byte super case short default double public try this switch ' + 6 | 'continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count ' + 7 | 'order group by asc desc index hint like dispaly edit client server ttsbegin ' + 8 | 'ttscommit str real date container anytype common div mod', 9 | contains: [ 10 | hljs.C_LINE_COMMENT_MODE, 11 | hljs.C_BLOCK_COMMENT_MODE, 12 | hljs.APOS_STRING_MODE, 13 | hljs.QUOTE_STRING_MODE, 14 | hljs.C_NUMBER_MODE, 15 | { 16 | className: 'meta', 17 | begin: '#', end: '$' 18 | }, 19 | { 20 | className: 'class', 21 | beginKeywords: 'class interface', end: '{', excludeEnd: true, 22 | illegal: ':', 23 | contains: [ 24 | {beginKeywords: 'extends implements'}, 25 | hljs.UNDERSCORE_TITLE_MODE 26 | ] 27 | } 28 | ] 29 | }; 30 | }; -------------------------------------------------------------------------------- /docs/js/languages/bash.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var VAR = { 3 | className: 'variable', 4 | variants: [ 5 | {begin: /\$[\w\d#@][\w\d_]*/}, 6 | {begin: /\$\{(.*?)}/} 7 | ] 8 | }; 9 | var QUOTE_STRING = { 10 | className: 'string', 11 | begin: /"/, end: /"/, 12 | contains: [ 13 | hljs.BACKSLASH_ESCAPE, 14 | VAR, 15 | { 16 | className: 'variable', 17 | begin: /\$\(/, end: /\)/, 18 | contains: [hljs.BACKSLASH_ESCAPE] 19 | } 20 | ] 21 | }; 22 | var APOS_STRING = { 23 | className: 'string', 24 | begin: /'/, end: /'/ 25 | }; 26 | 27 | return { 28 | aliases: ['sh', 'zsh'], 29 | lexemes: /\b-?[a-z\._]+\b/, 30 | keywords: { 31 | keyword: 32 | 'if then else elif fi for while in do done case esac function', 33 | literal: 34 | 'true false', 35 | built_in: 36 | // Shell built-ins 37 | // http://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html 38 | 'break cd continue eval exec exit export getopts hash pwd readonly return shift test times ' + 39 | 'trap umask unset ' + 40 | // Bash built-ins 41 | 'alias bind builtin caller command declare echo enable help let local logout mapfile printf ' + 42 | 'read readarray source type typeset ulimit unalias ' + 43 | // Shell modifiers 44 | 'set shopt ' + 45 | // Zsh built-ins 46 | 'autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles ' + 47 | 'compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate ' + 48 | 'fc fg float functions getcap getln history integer jobs kill limit log noglob popd print ' + 49 | 'pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit ' + 50 | 'unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof ' + 51 | 'zpty zregexparse zsocket zstyle ztcp', 52 | _: 53 | '-ne -eq -lt -gt -f -d -e -s -l -a' // relevance booster 54 | }, 55 | contains: [ 56 | { 57 | className: 'meta', 58 | begin: /^#![^\n]+sh\s*$/, 59 | relevance: 10 60 | }, 61 | { 62 | className: 'function', 63 | begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/, 64 | returnBegin: true, 65 | contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\w[\w\d_]*/})], 66 | relevance: 0 67 | }, 68 | hljs.HASH_COMMENT_MODE, 69 | QUOTE_STRING, 70 | APOS_STRING, 71 | VAR 72 | ] 73 | }; 74 | }; -------------------------------------------------------------------------------- /docs/js/languages/basic.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | case_insensitive: true, 4 | illegal: '^\.', 5 | // Support explicitely typed variables that end with $%! or #. 6 | lexemes: '[a-zA-Z][a-zA-Z0-9_\$\%\!\#]*', 7 | keywords: { 8 | keyword: 9 | 'ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE ' + 10 | 'CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ ' + 11 | 'DEFDBL DEFINT DEFSNG DEFSTR DEF|0 SEG USR DELETE DIM DRAW EDIT END ENVIRON ENVIRON$ ' + 12 | 'EOF EQV ERASE ERDEV ERDEV$ ERL ERR ERROR EXP FIELD FILES FIX FOR|0 FRE GET GOSUB|10 GOTO ' + 13 | 'HEX$ IF|0 THEN ELSE|0 INKEY$ INP INPUT INPUT# INPUT$ INSTR IMP INT IOCTL IOCTL$ KEY ON ' + 14 | 'OFF LIST KILL LEFT$ LEN LET LINE LLIST LOAD LOC LOCATE LOF LOG LPRINT USING LSET ' + 15 | 'MERGE MID$ MKDIR MKD$ MKI$ MKS$ MOD NAME NEW NEXT NOISE NOT OCT$ ON OR PEN PLAY STRIG OPEN OPTION ' + 16 | 'BASE OUT PAINT PALETTE PCOPY PEEK PMAP POINT POKE POS PRINT PRINT] PSET PRESET ' + 17 | 'PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET ' + 18 | 'RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP ' + 19 | 'SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE ' + 20 | 'WEND WIDTH WINDOW WRITE XOR' 21 | }, 22 | contains: [ 23 | hljs.QUOTE_STRING_MODE, 24 | hljs.COMMENT('REM', '$', {relevance: 10}), 25 | hljs.COMMENT('\'', '$', {relevance: 0}), 26 | { 27 | // Match line numbers 28 | className: 'symbol', 29 | begin: '^[0-9]+\ ', 30 | relevance: 10 31 | }, 32 | { 33 | // Match typed numeric constants (1000, 12.34!, 1.2e5, 1.5#, 1.2D2) 34 | className: 'number', 35 | begin: '\\b([0-9]+[0-9edED\.]*[#\!]?)', 36 | relevance: 0 37 | }, 38 | { 39 | // Match hexadecimal numbers (&Hxxxx) 40 | className: 'number', 41 | begin: '(\&[hH][0-9a-fA-F]{1,4})' 42 | }, 43 | { 44 | // Match octal numbers (&Oxxxxxx) 45 | className: 'number', 46 | begin: '(\&[oO][0-7]{1,6})' 47 | } 48 | ] 49 | }; 50 | }; -------------------------------------------------------------------------------- /docs/js/languages/bnf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs){ 2 | return { 3 | contains: [ 4 | // Attribute 5 | { 6 | className: 'attribute', 7 | begin: // 8 | }, 9 | // Specific 10 | { 11 | begin: /::=/, 12 | starts: { 13 | end: /$/, 14 | contains: [ 15 | { 16 | begin: // 17 | }, 18 | // Common 19 | hljs.C_LINE_COMMENT_MODE, 20 | hljs.C_BLOCK_COMMENT_MODE, 21 | hljs.APOS_STRING_MODE, 22 | hljs.QUOTE_STRING_MODE 23 | ] 24 | } 25 | } 26 | ] 27 | }; 28 | }; -------------------------------------------------------------------------------- /docs/js/languages/brainfuck.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs){ 2 | var LITERAL = { 3 | className: 'literal', 4 | begin: '[\\+\\-]', 5 | relevance: 0 6 | }; 7 | return { 8 | aliases: ['bf'], 9 | contains: [ 10 | hljs.COMMENT( 11 | '[^\\[\\]\\.,\\+\\-<> \r\n]', 12 | '[\\[\\]\\.,\\+\\-<> \r\n]', 13 | { 14 | returnEnd: true, 15 | relevance: 0 16 | } 17 | ), 18 | { 19 | className: 'title', 20 | begin: '[\\[\\]]', 21 | relevance: 0 22 | }, 23 | { 24 | className: 'string', 25 | begin: '[\\.,]', 26 | relevance: 0 27 | }, 28 | { 29 | // this mode works as the only relevance counter 30 | begin: /\+\+|\-\-/, returnBegin: true, 31 | contains: [LITERAL] 32 | }, 33 | LITERAL 34 | ] 35 | }; 36 | }; -------------------------------------------------------------------------------- /docs/js/languages/cal.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var KEYWORDS = 3 | 'div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to ' + 4 | 'until while with var'; 5 | var LITERALS = 'false true'; 6 | var COMMENT_MODES = [ 7 | hljs.C_LINE_COMMENT_MODE, 8 | hljs.COMMENT( 9 | /\{/, 10 | /\}/, 11 | { 12 | relevance: 0 13 | } 14 | ), 15 | hljs.COMMENT( 16 | /\(\*/, 17 | /\*\)/, 18 | { 19 | relevance: 10 20 | } 21 | ) 22 | ]; 23 | var STRING = { 24 | className: 'string', 25 | begin: /'/, end: /'/, 26 | contains: [{begin: /''/}] 27 | }; 28 | var CHAR_STRING = { 29 | className: 'string', begin: /(#\d+)+/ 30 | }; 31 | var DATE = { 32 | className: 'number', 33 | begin: '\\b\\d+(\\.\\d+)?(DT|D|T)', 34 | relevance: 0 35 | }; 36 | var DBL_QUOTED_VARIABLE = { 37 | className: 'string', // not a string technically but makes sense to be highlighted in the same style 38 | begin: '"', 39 | end: '"' 40 | }; 41 | 42 | var PROCEDURE = { 43 | className: 'function', 44 | beginKeywords: 'procedure', end: /[:;]/, 45 | keywords: 'procedure|10', 46 | contains: [ 47 | hljs.TITLE_MODE, 48 | { 49 | className: 'params', 50 | begin: /\(/, end: /\)/, 51 | keywords: KEYWORDS, 52 | contains: [STRING, CHAR_STRING] 53 | } 54 | ].concat(COMMENT_MODES) 55 | }; 56 | 57 | var OBJECT = { 58 | className: 'class', 59 | begin: 'OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)', 60 | returnBegin: true, 61 | contains: [ 62 | hljs.TITLE_MODE, 63 | PROCEDURE 64 | ] 65 | }; 66 | 67 | return { 68 | case_insensitive: true, 69 | keywords: { keyword: KEYWORDS, literal: LITERALS }, 70 | illegal: /\/\*/, 71 | contains: [ 72 | STRING, CHAR_STRING, 73 | DATE, DBL_QUOTED_VARIABLE, 74 | hljs.NUMBER_MODE, 75 | OBJECT, 76 | PROCEDURE 77 | ] 78 | }; 79 | }; -------------------------------------------------------------------------------- /docs/js/languages/capnproto.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['capnp'], 4 | keywords: { 5 | keyword: 6 | 'struct enum interface union group import using const annotation extends in of on as with from fixed', 7 | built_in: 8 | 'Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 ' + 9 | 'Text Data AnyPointer AnyStruct Capability List', 10 | literal: 11 | 'true false' 12 | }, 13 | contains: [ 14 | hljs.QUOTE_STRING_MODE, 15 | hljs.NUMBER_MODE, 16 | hljs.HASH_COMMENT_MODE, 17 | { 18 | className: 'meta', 19 | begin: /@0x[\w\d]{16};/, 20 | illegal: /\n/ 21 | }, 22 | { 23 | className: 'symbol', 24 | begin: /@\d+\b/ 25 | }, 26 | { 27 | className: 'class', 28 | beginKeywords: 'struct enum', end: /\{/, 29 | illegal: /\n/, 30 | contains: [ 31 | hljs.inherit(hljs.TITLE_MODE, { 32 | starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title 33 | }) 34 | ] 35 | }, 36 | { 37 | className: 'class', 38 | beginKeywords: 'interface', end: /\{/, 39 | illegal: /\n/, 40 | contains: [ 41 | hljs.inherit(hljs.TITLE_MODE, { 42 | starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title 43 | }) 44 | ] 45 | } 46 | ] 47 | }; 48 | }; -------------------------------------------------------------------------------- /docs/js/languages/ceylon.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | // 2.3. Identifiers and keywords 3 | var KEYWORDS = 4 | 'assembly module package import alias class interface object given value ' + 5 | 'assign void function new of extends satisfies abstracts in out return ' + 6 | 'break continue throw assert dynamic if else switch case for while try ' + 7 | 'catch finally then let this outer super is exists nonempty'; 8 | // 7.4.1 Declaration Modifiers 9 | var DECLARATION_MODIFIERS = 10 | 'shared abstract formal default actual variable late native deprecated' + 11 | 'final sealed annotation suppressWarnings small'; 12 | // 7.4.2 Documentation 13 | var DOCUMENTATION = 14 | 'doc by license see throws tagged'; 15 | var SUBST = { 16 | className: 'subst', excludeBegin: true, excludeEnd: true, 17 | begin: /``/, end: /``/, 18 | keywords: KEYWORDS, 19 | relevance: 10 20 | }; 21 | var EXPRESSIONS = [ 22 | { 23 | // verbatim string 24 | className: 'string', 25 | begin: '"""', 26 | end: '"""', 27 | relevance: 10 28 | }, 29 | { 30 | // string literal or template 31 | className: 'string', 32 | begin: '"', end: '"', 33 | contains: [SUBST] 34 | }, 35 | { 36 | // character literal 37 | className: 'string', 38 | begin: "'", 39 | end: "'" 40 | }, 41 | { 42 | // numeric literal 43 | className: 'number', 44 | begin: '#[0-9a-fA-F_]+|\\$[01_]+|[0-9_]+(?:\\.[0-9_](?:[eE][+-]?\\d+)?)?[kMGTPmunpf]?', 45 | relevance: 0 46 | } 47 | ]; 48 | SUBST.contains = EXPRESSIONS; 49 | 50 | return { 51 | keywords: { 52 | keyword: KEYWORDS + ' ' + DECLARATION_MODIFIERS, 53 | meta: DOCUMENTATION 54 | }, 55 | illegal: '\\$[^01]|#[^0-9a-fA-F]', 56 | contains: [ 57 | hljs.C_LINE_COMMENT_MODE, 58 | hljs.COMMENT('/\\*', '\\*/', {contains: ['self']}), 59 | { 60 | // compiler annotation 61 | className: 'meta', 62 | begin: '@[a-z]\\w*(?:\\:\"[^\"]*\")?' 63 | } 64 | ].concat(EXPRESSIONS) 65 | }; 66 | }; -------------------------------------------------------------------------------- /docs/js/languages/clean.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['clean','icl','dcl'], 4 | keywords: { 5 | keyword: 6 | 'if let in with where case of class instance otherwise ' + 7 | 'implementation definition system module from import qualified as ' + 8 | 'special code inline foreign export ccall stdcall generic derive ' + 9 | 'infix infixl infixr', 10 | literal: 11 | 'True False' 12 | }, 13 | contains: [ 14 | 15 | hljs.C_LINE_COMMENT_MODE, 16 | hljs.C_BLOCK_COMMENT_MODE, 17 | hljs.APOS_STRING_MODE, 18 | hljs.QUOTE_STRING_MODE, 19 | hljs.C_NUMBER_MODE, 20 | 21 | {begin: '->|<-[|:]?|::|#!?|>>=|\\{\\||\\|\\}|:==|=:|\\.\\.|<>|`'} // relevance booster 22 | ] 23 | }; 24 | }; -------------------------------------------------------------------------------- /docs/js/languages/clojure-repl.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | contains: [ 4 | { 5 | className: 'meta', 6 | begin: /^([\w.-]+|\s*#_)=>/, 7 | starts: { 8 | end: /$/, 9 | subLanguage: 'clojure' 10 | } 11 | } 12 | ] 13 | } 14 | }; -------------------------------------------------------------------------------- /docs/js/languages/cmake.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['cmake.in'], 4 | case_insensitive: true, 5 | keywords: { 6 | keyword: 7 | 'add_custom_command add_custom_target add_definitions add_dependencies ' + 8 | 'add_executable add_library add_subdirectory add_test aux_source_directory ' + 9 | 'break build_command cmake_minimum_required cmake_policy configure_file ' + 10 | 'create_test_sourcelist define_property else elseif enable_language enable_testing ' + 11 | 'endforeach endfunction endif endmacro endwhile execute_process export find_file ' + 12 | 'find_library find_package find_path find_program fltk_wrap_ui foreach function ' + 13 | 'get_cmake_property get_directory_property get_filename_component get_property ' + 14 | 'get_source_file_property get_target_property get_test_property if include ' + 15 | 'include_directories include_external_msproject include_regular_expression install ' + 16 | 'link_directories load_cache load_command macro mark_as_advanced message option ' + 17 | 'output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return ' + 18 | 'separate_arguments set set_directory_properties set_property ' + 19 | 'set_source_files_properties set_target_properties set_tests_properties site_name ' + 20 | 'source_group string target_link_libraries try_compile try_run unset variable_watch ' + 21 | 'while build_name exec_program export_library_dependencies install_files ' + 22 | 'install_programs install_targets link_libraries make_directory remove subdir_depends ' + 23 | 'subdirs use_mangled_mesa utility_source variable_requires write_file ' + 24 | 'qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or ' + 25 | 'equal less greater strless strgreater strequal matches' 26 | }, 27 | contains: [ 28 | { 29 | className: 'variable', 30 | begin: '\\${', end: '}' 31 | }, 32 | hljs.HASH_COMMENT_MODE, 33 | hljs.QUOTE_STRING_MODE, 34 | hljs.NUMBER_MODE 35 | ] 36 | }; 37 | }; -------------------------------------------------------------------------------- /docs/js/languages/crmsh.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var RESOURCES = 'primitive rsc_template'; 3 | 4 | var COMMANDS = 'group clone ms master location colocation order fencing_topology ' + 5 | 'rsc_ticket acl_target acl_group user role ' + 6 | 'tag xml'; 7 | 8 | var PROPERTY_SETS = 'property rsc_defaults op_defaults'; 9 | 10 | var KEYWORDS = 'params meta operations op rule attributes utilization'; 11 | 12 | var OPERATORS = 'read write deny defined not_defined in_range date spec in ' + 13 | 'ref reference attribute type xpath version and or lt gt tag ' + 14 | 'lte gte eq ne \\'; 15 | 16 | var TYPES = 'number string'; 17 | 18 | var LITERALS = 'Master Started Slave Stopped start promote demote stop monitor true false'; 19 | 20 | return { 21 | aliases: ['crm', 'pcmk'], 22 | case_insensitive: true, 23 | keywords: { 24 | keyword: KEYWORDS + ' ' + OPERATORS + ' ' + TYPES, 25 | literal: LITERALS 26 | }, 27 | contains: [ 28 | hljs.HASH_COMMENT_MODE, 29 | { 30 | beginKeywords: 'node', 31 | starts: { 32 | end: '\\s*([\\w_-]+:)?', 33 | starts: { 34 | className: 'title', 35 | end: '\\s*[\\$\\w_][\\w_-]*' 36 | } 37 | } 38 | }, 39 | { 40 | beginKeywords: RESOURCES, 41 | starts: { 42 | className: 'title', 43 | end: '\\s*[\\$\\w_][\\w_-]*', 44 | starts: { 45 | end: '\\s*@?[\\w_][\\w_\\.:-]*' 46 | } 47 | } 48 | }, 49 | { 50 | begin: '\\b(' + COMMANDS.split(' ').join('|') + ')\\s+', 51 | keywords: COMMANDS, 52 | starts: { 53 | className: 'title', 54 | end: '[\\$\\w_][\\w_-]*' 55 | } 56 | }, 57 | { 58 | beginKeywords: PROPERTY_SETS, 59 | starts: { 60 | className: 'title', 61 | end: '\\s*([\\w_-]+:)?' 62 | } 63 | }, 64 | hljs.QUOTE_STRING_MODE, 65 | { 66 | className: 'meta', 67 | begin: '(ocf|systemd|service|lsb):[\\w_:-]+', 68 | relevance: 0 69 | }, 70 | { 71 | className: 'number', 72 | begin: '\\b\\d+(\\.\\d+)?(ms|s|h|m)?', 73 | relevance: 0 74 | }, 75 | { 76 | className: 'literal', 77 | begin: '[-]?(infinity|inf)', 78 | relevance: 0 79 | }, 80 | { 81 | className: 'attr', 82 | begin: /([A-Za-z\$_\#][\w_-]+)=/, 83 | relevance: 0 84 | }, 85 | { 86 | className: 'tag', 87 | begin: '', 89 | relevance: 0 90 | } 91 | ] 92 | }; 93 | }; -------------------------------------------------------------------------------- /docs/js/languages/csp.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | case_insensitive: false, 4 | lexemes: '[a-zA-Z][a-zA-Z0-9_-]*', 5 | keywords: { 6 | keyword: 'base-uri child-src connect-src default-src font-src form-action' + 7 | ' frame-ancestors frame-src img-src media-src object-src plugin-types' + 8 | ' report-uri sandbox script-src style-src', 9 | }, 10 | contains: [ 11 | { 12 | className: 'string', 13 | begin: "'", end: "'" 14 | }, 15 | { 16 | className: 'attribute', 17 | begin: '^Content', end: ':', excludeEnd: true, 18 | }, 19 | ] 20 | }; 21 | }; -------------------------------------------------------------------------------- /docs/js/languages/dart.js: -------------------------------------------------------------------------------- 1 | module.exports = function (hljs) { 2 | var SUBST = { 3 | className: 'subst', 4 | begin: '\\$\\{', end: '}', 5 | keywords: 'true false null this is new super' 6 | }; 7 | 8 | var STRING = { 9 | className: 'string', 10 | variants: [ 11 | { 12 | begin: 'r\'\'\'', end: '\'\'\'' 13 | }, 14 | { 15 | begin: 'r"""', end: '"""' 16 | }, 17 | { 18 | begin: 'r\'', end: '\'', 19 | illegal: '\\n' 20 | }, 21 | { 22 | begin: 'r"', end: '"', 23 | illegal: '\\n' 24 | }, 25 | { 26 | begin: '\'\'\'', end: '\'\'\'', 27 | contains: [hljs.BACKSLASH_ESCAPE, SUBST] 28 | }, 29 | { 30 | begin: '"""', end: '"""', 31 | contains: [hljs.BACKSLASH_ESCAPE, SUBST] 32 | }, 33 | { 34 | begin: '\'', end: '\'', 35 | illegal: '\\n', 36 | contains: [hljs.BACKSLASH_ESCAPE, SUBST] 37 | }, 38 | { 39 | begin: '"', end: '"', 40 | illegal: '\\n', 41 | contains: [hljs.BACKSLASH_ESCAPE, SUBST] 42 | } 43 | ] 44 | }; 45 | SUBST.contains = [ 46 | hljs.C_NUMBER_MODE, STRING 47 | ]; 48 | 49 | var KEYWORDS = { 50 | keyword: 'assert async await break case catch class const continue default do else enum extends false final ' + 51 | 'finally for if in is new null rethrow return super switch sync this throw true try var void while with yield ' + 52 | 'abstract as dynamic export external factory get implements import library operator part set static typedef', 53 | built_in: 54 | // dart:core 55 | 'print Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set ' + 56 | 'Stopwatch String StringBuffer StringSink Symbol Type Uri bool double int num ' + 57 | // dart:html 58 | 'document window querySelector querySelectorAll Element ElementList' 59 | }; 60 | 61 | return { 62 | keywords: KEYWORDS, 63 | contains: [ 64 | STRING, 65 | hljs.COMMENT( 66 | '/\\*\\*', 67 | '\\*/', 68 | { 69 | subLanguage: 'markdown' 70 | } 71 | ), 72 | hljs.COMMENT( 73 | '///', 74 | '$', 75 | { 76 | subLanguage: 'markdown' 77 | } 78 | ), 79 | hljs.C_LINE_COMMENT_MODE, 80 | hljs.C_BLOCK_COMMENT_MODE, 81 | { 82 | className: 'class', 83 | beginKeywords: 'class interface', end: '{', excludeEnd: true, 84 | contains: [ 85 | { 86 | beginKeywords: 'extends implements' 87 | }, 88 | hljs.UNDERSCORE_TITLE_MODE 89 | ] 90 | }, 91 | hljs.C_NUMBER_MODE, 92 | { 93 | className: 'meta', begin: '@[A-Za-z]+' 94 | }, 95 | { 96 | begin: '=>' // No markup, just a relevance booster 97 | } 98 | ] 99 | } 100 | }; -------------------------------------------------------------------------------- /docs/js/languages/delphi.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var KEYWORDS = 3 | 'exports register file shl array record property for mod while set ally label uses raise not ' + 4 | 'stored class safecall var interface or private static exit index inherited to else stdcall ' + 5 | 'override shr asm far resourcestring finalization packed virtual out and protected library do ' + 6 | 'xorwrite goto near function end div overload object unit begin string on inline repeat until ' + 7 | 'destructor write message program with read initialization except default nil if case cdecl in ' + 8 | 'downto threadvar of try pascal const external constructor type public then implementation ' + 9 | 'finally published procedure absolute reintroduce operator as is abstract alias assembler ' + 10 | 'bitpacked break continue cppdecl cvar enumerator experimental platform deprecated ' + 11 | 'unimplemented dynamic export far16 forward generic helper implements interrupt iochecks ' + 12 | 'local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat ' + 13 | 'specialize strict unaligned varargs '; 14 | var COMMENT_MODES = [ 15 | hljs.C_LINE_COMMENT_MODE, 16 | hljs.COMMENT(/\{/, /\}/, {relevance: 0}), 17 | hljs.COMMENT(/\(\*/, /\*\)/, {relevance: 10}) 18 | ]; 19 | var DIRECTIVE = { 20 | className: 'meta', 21 | variants: [ 22 | {begin: /\{\$/, end: /\}/}, 23 | {begin: /\(\*\$/, end: /\*\)/} 24 | ] 25 | }; 26 | var STRING = { 27 | className: 'string', 28 | begin: /'/, end: /'/, 29 | contains: [{begin: /''/}] 30 | }; 31 | var CHAR_STRING = { 32 | className: 'string', begin: /(#\d+)+/ 33 | }; 34 | var CLASS = { 35 | begin: hljs.IDENT_RE + '\\s*=\\s*class\\s*\\(', returnBegin: true, 36 | contains: [ 37 | hljs.TITLE_MODE 38 | ] 39 | }; 40 | var FUNCTION = { 41 | className: 'function', 42 | beginKeywords: 'function constructor destructor procedure', end: /[:;]/, 43 | keywords: 'function constructor|10 destructor|10 procedure|10', 44 | contains: [ 45 | hljs.TITLE_MODE, 46 | { 47 | className: 'params', 48 | begin: /\(/, end: /\)/, 49 | keywords: KEYWORDS, 50 | contains: [STRING, CHAR_STRING, DIRECTIVE].concat(COMMENT_MODES) 51 | }, 52 | DIRECTIVE 53 | ].concat(COMMENT_MODES) 54 | }; 55 | return { 56 | aliases: ['dpr', 'dfm', 'pas', 'pascal', 'freepascal', 'lazarus', 'lpr', 'lfm'], 57 | case_insensitive: true, 58 | keywords: KEYWORDS, 59 | illegal: /"|\$[G-Zg-z]|\/\*|<\/|\|/, 60 | contains: [ 61 | STRING, CHAR_STRING, 62 | hljs.NUMBER_MODE, 63 | CLASS, 64 | FUNCTION, 65 | DIRECTIVE 66 | ].concat(COMMENT_MODES) 67 | }; 68 | }; -------------------------------------------------------------------------------- /docs/js/languages/diff.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['patch'], 4 | contains: [ 5 | { 6 | className: 'meta', 7 | relevance: 10, 8 | variants: [ 9 | {begin: /^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/}, 10 | {begin: /^\*\*\* +\d+,\d+ +\*\*\*\*$/}, 11 | {begin: /^\-\-\- +\d+,\d+ +\-\-\-\-$/} 12 | ] 13 | }, 14 | { 15 | className: 'comment', 16 | variants: [ 17 | {begin: /Index: /, end: /$/}, 18 | {begin: /={3,}/, end: /$/}, 19 | {begin: /^\-{3}/, end: /$/}, 20 | {begin: /^\*{3} /, end: /$/}, 21 | {begin: /^\+{3}/, end: /$/}, 22 | {begin: /\*{5}/, end: /\*{5}$/} 23 | ] 24 | }, 25 | { 26 | className: 'addition', 27 | begin: '^\\+', end: '$' 28 | }, 29 | { 30 | className: 'deletion', 31 | begin: '^\\-', end: '$' 32 | }, 33 | { 34 | className: 'addition', 35 | begin: '^\\!', end: '$' 36 | } 37 | ] 38 | }; 39 | }; -------------------------------------------------------------------------------- /docs/js/languages/django.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var FILTER = { 3 | begin: /\|[A-Za-z]+:?/, 4 | keywords: { 5 | name: 6 | 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' + 7 | 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' + 8 | 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' + 9 | 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' + 10 | 'dictsortreversed default_if_none pluralize lower join center default ' + 11 | 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' + 12 | 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' + 13 | 'localtime utc timezone' 14 | }, 15 | contains: [ 16 | hljs.QUOTE_STRING_MODE, 17 | hljs.APOS_STRING_MODE 18 | ] 19 | }; 20 | 21 | return { 22 | aliases: ['jinja'], 23 | case_insensitive: true, 24 | subLanguage: 'xml', 25 | contains: [ 26 | hljs.COMMENT(/\{%\s*comment\s*%}/, /\{%\s*endcomment\s*%}/), 27 | hljs.COMMENT(/\{#/, /#}/), 28 | { 29 | className: 'template-tag', 30 | begin: /\{%/, end: /%}/, 31 | contains: [ 32 | { 33 | className: 'name', 34 | begin: /\w+/, 35 | keywords: { 36 | name: 37 | 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' + 38 | 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' + 39 | 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' + 40 | 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' + 41 | 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' + 42 | 'plural get_current_language language get_available_languages ' + 43 | 'get_current_language_bidi get_language_info get_language_info_list localize ' + 44 | 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' + 45 | 'verbatim' 46 | }, 47 | starts: { 48 | endsWithParent: true, 49 | keywords: 'in by as', 50 | contains: [FILTER], 51 | relevance: 0 52 | } 53 | } 54 | ] 55 | }, 56 | { 57 | className: 'template-variable', 58 | begin: /\{\{/, end: /}}/, 59 | contains: [FILTER] 60 | } 61 | ] 62 | }; 63 | }; -------------------------------------------------------------------------------- /docs/js/languages/dns.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['bind', 'zone'], 4 | keywords: { 5 | keyword: 6 | 'IN A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME DHCID DLV DNAME DNSKEY DS HIP IPSECKEY KEY KX ' + 7 | 'LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR RRSIG RP SIG SOA SRV SSHFP TA TKEY TLSA TSIG TXT' 8 | }, 9 | contains: [ 10 | hljs.COMMENT(';', '$', {relevance: 0}), 11 | { 12 | className: 'meta', 13 | begin: /^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/ 14 | }, 15 | // IPv6 16 | { 17 | className: 'number', 18 | begin: '((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b' 19 | }, 20 | // IPv4 21 | { 22 | className: 'number', 23 | begin: '((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b' 24 | }, 25 | hljs.inherit(hljs.NUMBER_MODE, {begin: /\b\d+[dhwm]?/}) 26 | ] 27 | }; 28 | }; -------------------------------------------------------------------------------- /docs/js/languages/dockerfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['docker'], 4 | case_insensitive: true, 5 | keywords: 'from maintainer expose env arg user onbuild stopsignal', 6 | contains: [ 7 | hljs.HASH_COMMENT_MODE, 8 | hljs.APOS_STRING_MODE, 9 | hljs.QUOTE_STRING_MODE, 10 | hljs.NUMBER_MODE, 11 | { 12 | beginKeywords: 'run cmd entrypoint volume add copy workdir label healthcheck shell', 13 | starts: { 14 | end: /[^\\]\n/, 15 | subLanguage: 'bash' 16 | } 17 | } 18 | ], 19 | illegal: '', 42 | illegal: '\\n' 43 | } 44 | ] 45 | }, 46 | STRINGS, 47 | hljs.C_LINE_COMMENT_MODE, 48 | hljs.C_BLOCK_COMMENT_MODE 49 | ] 50 | }; 51 | 52 | var DTS_REFERENCE = { 53 | className: 'variable', 54 | begin: '\\&[a-z\\d_]*\\b' 55 | }; 56 | 57 | var DTS_KEYWORD = { 58 | className: 'meta-keyword', 59 | begin: '/[a-z][a-z\\d-]*/' 60 | }; 61 | 62 | var DTS_LABEL = { 63 | className: 'symbol', 64 | begin: '^\\s*[a-zA-Z_][a-zA-Z\\d_]*:' 65 | }; 66 | 67 | var DTS_CELL_PROPERTY = { 68 | className: 'params', 69 | begin: '<', 70 | end: '>', 71 | contains: [ 72 | NUMBERS, 73 | DTS_REFERENCE 74 | ] 75 | }; 76 | 77 | var DTS_NODE = { 78 | className: 'class', 79 | begin: /[a-zA-Z_][a-zA-Z\d_@]*\s{/, 80 | end: /[{;=]/, 81 | returnBegin: true, 82 | excludeEnd: true 83 | }; 84 | 85 | var DTS_ROOT_NODE = { 86 | className: 'class', 87 | begin: '/\\s*{', 88 | end: '};', 89 | relevance: 10, 90 | contains: [ 91 | DTS_REFERENCE, 92 | DTS_KEYWORD, 93 | DTS_LABEL, 94 | DTS_NODE, 95 | DTS_CELL_PROPERTY, 96 | hljs.C_LINE_COMMENT_MODE, 97 | hljs.C_BLOCK_COMMENT_MODE, 98 | NUMBERS, 99 | STRINGS 100 | ] 101 | }; 102 | 103 | return { 104 | keywords: "", 105 | contains: [ 106 | DTS_ROOT_NODE, 107 | DTS_REFERENCE, 108 | DTS_KEYWORD, 109 | DTS_LABEL, 110 | DTS_NODE, 111 | DTS_CELL_PROPERTY, 112 | hljs.C_LINE_COMMENT_MODE, 113 | hljs.C_BLOCK_COMMENT_MODE, 114 | NUMBERS, 115 | STRINGS, 116 | PREPROCESSOR, 117 | { 118 | begin: hljs.IDENT_RE + '::', 119 | keywords: "" 120 | } 121 | ] 122 | }; 123 | }; -------------------------------------------------------------------------------- /docs/js/languages/dust.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep'; 3 | return { 4 | aliases: ['dst'], 5 | case_insensitive: true, 6 | subLanguage: 'xml', 7 | contains: [ 8 | { 9 | className: 'template-tag', 10 | begin: /\{[#\/]/, end: /\}/, illegal: /;/, 11 | contains: [ 12 | { 13 | className: 'name', 14 | begin: /[a-zA-Z\.-]+/, 15 | starts: { 16 | endsWithParent: true, relevance: 0, 17 | contains: [ 18 | hljs.QUOTE_STRING_MODE 19 | ] 20 | } 21 | } 22 | ] 23 | }, 24 | { 25 | className: 'template-variable', 26 | begin: /\{/, end: /\}/, illegal: /;/, 27 | keywords: EXPRESSION_KEYWORDS 28 | } 29 | ] 30 | }; 31 | }; -------------------------------------------------------------------------------- /docs/js/languages/ebnf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var commentMode = hljs.COMMENT(/\(\*/, /\*\)/); 3 | 4 | var nonTerminalMode = { 5 | className: "attribute", 6 | begin: /^[ ]*[a-zA-Z][a-zA-Z-]*([\s-]+[a-zA-Z][a-zA-Z]*)*/ 7 | }; 8 | 9 | var specialSequenceMode = { 10 | className: "meta", 11 | begin: /\?.*\?/ 12 | }; 13 | 14 | var ruleBodyMode = { 15 | begin: /=/, end: /;/, 16 | contains: [ 17 | commentMode, 18 | specialSequenceMode, 19 | // terminals 20 | hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE 21 | ] 22 | }; 23 | 24 | return { 25 | illegal: /\S/, 26 | contains: [ 27 | commentMode, 28 | nonTerminalMode, 29 | ruleBodyMode 30 | ] 31 | }; 32 | }; -------------------------------------------------------------------------------- /docs/js/languages/elixir.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var ELIXIR_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?'; 3 | var ELIXIR_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?'; 4 | var ELIXIR_KEYWORDS = 5 | 'and false then defined module in return redo retry end for true self when ' + 6 | 'next until do begin unless nil break not case cond alias while ensure or ' + 7 | 'include use alias fn quote'; 8 | var SUBST = { 9 | className: 'subst', 10 | begin: '#\\{', end: '}', 11 | lexemes: ELIXIR_IDENT_RE, 12 | keywords: ELIXIR_KEYWORDS 13 | }; 14 | var STRING = { 15 | className: 'string', 16 | contains: [hljs.BACKSLASH_ESCAPE, SUBST], 17 | variants: [ 18 | { 19 | begin: /'/, end: /'/ 20 | }, 21 | { 22 | begin: /"/, end: /"/ 23 | } 24 | ] 25 | }; 26 | var FUNCTION = { 27 | className: 'function', 28 | beginKeywords: 'def defp defmacro', end: /\B\b/, // the mode is ended by the title 29 | contains: [ 30 | hljs.inherit(hljs.TITLE_MODE, { 31 | begin: ELIXIR_IDENT_RE, 32 | endsParent: true 33 | }) 34 | ] 35 | }; 36 | var CLASS = hljs.inherit(FUNCTION, { 37 | className: 'class', 38 | beginKeywords: 'defimpl defmodule defprotocol defrecord', end: /\bdo\b|$|;/ 39 | }); 40 | var ELIXIR_DEFAULT_CONTAINS = [ 41 | STRING, 42 | hljs.HASH_COMMENT_MODE, 43 | CLASS, 44 | FUNCTION, 45 | { 46 | className: 'symbol', 47 | begin: ':(?!\\s)', 48 | contains: [STRING, {begin: ELIXIR_METHOD_RE}], 49 | relevance: 0 50 | }, 51 | { 52 | className: 'symbol', 53 | begin: ELIXIR_IDENT_RE + ':', 54 | relevance: 0 55 | }, 56 | { 57 | className: 'number', 58 | begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b', 59 | relevance: 0 60 | }, 61 | { 62 | className: 'variable', 63 | begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))' 64 | }, 65 | { 66 | begin: '->' 67 | }, 68 | { // regexp container 69 | begin: '(' + hljs.RE_STARTERS_RE + ')\\s*', 70 | contains: [ 71 | hljs.HASH_COMMENT_MODE, 72 | { 73 | className: 'regexp', 74 | illegal: '\\n', 75 | contains: [hljs.BACKSLASH_ESCAPE, SUBST], 76 | variants: [ 77 | { 78 | begin: '/', end: '/[a-z]*' 79 | }, 80 | { 81 | begin: '%r\\[', end: '\\][a-z]*' 82 | } 83 | ] 84 | } 85 | ], 86 | relevance: 0 87 | } 88 | ]; 89 | SUBST.contains = ELIXIR_DEFAULT_CONTAINS; 90 | 91 | return { 92 | lexemes: ELIXIR_IDENT_RE, 93 | keywords: ELIXIR_KEYWORDS, 94 | contains: ELIXIR_DEFAULT_CONTAINS 95 | }; 96 | }; -------------------------------------------------------------------------------- /docs/js/languages/elm.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var COMMENT = { 3 | variants: [ 4 | hljs.COMMENT('--', '$'), 5 | hljs.COMMENT( 6 | '{-', 7 | '-}', 8 | { 9 | contains: ['self'] 10 | } 11 | ) 12 | ] 13 | }; 14 | 15 | var CONSTRUCTOR = { 16 | className: 'type', 17 | begin: '\\b[A-Z][\\w\']*', // TODO: other constructors (built-in, infix). 18 | relevance: 0 19 | }; 20 | 21 | var LIST = { 22 | begin: '\\(', end: '\\)', 23 | illegal: '"', 24 | contains: [ 25 | {className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'}, 26 | COMMENT 27 | ] 28 | }; 29 | 30 | var RECORD = { 31 | begin: '{', end: '}', 32 | contains: LIST.contains 33 | }; 34 | 35 | return { 36 | keywords: 37 | 'let in if then else case of where module import exposing ' + 38 | 'type alias as infix infixl infixr port effect command subscription', 39 | contains: [ 40 | 41 | // Top-level constructions. 42 | 43 | { 44 | beginKeywords: 'port effect module', end: 'exposing', 45 | keywords: 'port effect module where command subscription exposing', 46 | contains: [LIST, COMMENT], 47 | illegal: '\\W\\.|;' 48 | }, 49 | { 50 | begin: 'import', end: '$', 51 | keywords: 'import as exposing', 52 | contains: [LIST, COMMENT], 53 | illegal: '\\W\\.|;' 54 | }, 55 | { 56 | begin: 'type', end: '$', 57 | keywords: 'type alias', 58 | contains: [CONSTRUCTOR, LIST, RECORD, COMMENT] 59 | }, 60 | { 61 | beginKeywords: 'infix infixl infixr', end: '$', 62 | contains: [hljs.C_NUMBER_MODE, COMMENT] 63 | }, 64 | { 65 | begin: 'port', end: '$', 66 | keywords: 'port', 67 | contains: [COMMENT] 68 | }, 69 | 70 | // Literals and names. 71 | 72 | // TODO: characters. 73 | hljs.QUOTE_STRING_MODE, 74 | hljs.C_NUMBER_MODE, 75 | CONSTRUCTOR, 76 | hljs.inherit(hljs.TITLE_MODE, {begin: '^[_a-z][\\w\']*'}), 77 | COMMENT, 78 | 79 | {begin: '->|<-'} // No markup, relevance booster 80 | ], 81 | illegal: /;/ 82 | }; 83 | }; -------------------------------------------------------------------------------- /docs/js/languages/erb.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | subLanguage: 'xml', 4 | contains: [ 5 | hljs.COMMENT('<%#', '%>'), 6 | { 7 | begin: '<%[%=-]?', end: '[%-]?%>', 8 | subLanguage: 'ruby', 9 | excludeBegin: true, 10 | excludeEnd: true 11 | } 12 | ] 13 | }; 14 | }; -------------------------------------------------------------------------------- /docs/js/languages/erlang-repl.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | keywords: { 4 | built_in: 5 | 'spawn spawn_link self', 6 | keyword: 7 | 'after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if ' + 8 | 'let not of or orelse|10 query receive rem try when xor' 9 | }, 10 | contains: [ 11 | { 12 | className: 'meta', begin: '^[0-9]+> ', 13 | relevance: 10 14 | }, 15 | hljs.COMMENT('%', '$'), 16 | { 17 | className: 'number', 18 | begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)', 19 | relevance: 0 20 | }, 21 | hljs.APOS_STRING_MODE, 22 | hljs.QUOTE_STRING_MODE, 23 | { 24 | begin: '\\?(::)?([A-Z]\\w*(::)?)+' 25 | }, 26 | { 27 | begin: '->' 28 | }, 29 | { 30 | begin: 'ok' 31 | }, 32 | { 33 | begin: '!' 34 | }, 35 | { 36 | begin: '(\\b[a-z\'][a-zA-Z0-9_\']*:[a-z\'][a-zA-Z0-9_\']*)|(\\b[a-z\'][a-zA-Z0-9_\']*)', 37 | relevance: 0 38 | }, 39 | { 40 | begin: '[A-Z][a-zA-Z0-9_\']*', 41 | relevance: 0 42 | } 43 | ] 44 | }; 45 | }; -------------------------------------------------------------------------------- /docs/js/languages/fix.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | contains: [ 4 | { 5 | begin: /[^\u2401\u0001]+/, 6 | end: /[\u2401\u0001]/, 7 | excludeEnd: true, 8 | returnBegin: true, 9 | returnEnd: false, 10 | contains: [ 11 | { 12 | begin: /([^\u2401\u0001=]+)/, 13 | end: /=([^\u2401\u0001=]+)/, 14 | returnEnd: true, 15 | returnBegin: false, 16 | className: 'attr' 17 | }, 18 | { 19 | begin: /=/, 20 | end: /([\u2401\u0001])/, 21 | excludeEnd: true, 22 | excludeBegin: true, 23 | className: 'string' 24 | }] 25 | }], 26 | case_insensitive: true 27 | }; 28 | }; -------------------------------------------------------------------------------- /docs/js/languages/flix.js: -------------------------------------------------------------------------------- 1 | module.exports = function (hljs) { 2 | 3 | var CHAR = { 4 | className: 'string', 5 | begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/ 6 | }; 7 | 8 | var STRING = { 9 | className: 'string', 10 | variants: [ 11 | { 12 | begin: '"', end: '"' 13 | } 14 | ] 15 | }; 16 | 17 | var NAME = { 18 | className: 'title', 19 | begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/ 20 | }; 21 | 22 | var METHOD = { 23 | className: 'function', 24 | beginKeywords: 'def', 25 | end: /[:={\[(\n;]/, 26 | excludeEnd: true, 27 | contains: [NAME] 28 | }; 29 | 30 | return { 31 | keywords: { 32 | literal: 'true false', 33 | keyword: 'case class def else enum if impl import in lat rel index let match namespace switch type yield with' 34 | }, 35 | contains: [ 36 | hljs.C_LINE_COMMENT_MODE, 37 | hljs.C_BLOCK_COMMENT_MODE, 38 | CHAR, 39 | STRING, 40 | METHOD, 41 | hljs.C_NUMBER_MODE 42 | ] 43 | }; 44 | }; -------------------------------------------------------------------------------- /docs/js/languages/fsharp.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var TYPEPARAM = { 3 | begin: '<', end: '>', 4 | contains: [ 5 | hljs.inherit(hljs.TITLE_MODE, {begin: /'[a-zA-Z0-9_]+/}) 6 | ] 7 | }; 8 | 9 | return { 10 | aliases: ['fs'], 11 | keywords: 12 | 'abstract and as assert base begin class default delegate do done ' + 13 | 'downcast downto elif else end exception extern false finally for ' + 14 | 'fun function global if in inherit inline interface internal lazy let ' + 15 | 'match member module mutable namespace new null of open or ' + 16 | 'override private public rec return sig static struct then to ' + 17 | 'true try type upcast use val void when while with yield', 18 | illegal: /\/\*/, 19 | contains: [ 20 | { 21 | // monad builder keywords (matches before non-bang kws) 22 | className: 'keyword', 23 | begin: /\b(yield|return|let|do)!/ 24 | }, 25 | { 26 | className: 'string', 27 | begin: '@"', end: '"', 28 | contains: [{begin: '""'}] 29 | }, 30 | { 31 | className: 'string', 32 | begin: '"""', end: '"""' 33 | }, 34 | hljs.COMMENT('\\(\\*', '\\*\\)'), 35 | { 36 | className: 'class', 37 | beginKeywords: 'type', end: '\\(|=|$', excludeEnd: true, 38 | contains: [ 39 | hljs.UNDERSCORE_TITLE_MODE, 40 | TYPEPARAM 41 | ] 42 | }, 43 | { 44 | className: 'meta', 45 | begin: '\\[<', end: '>\\]', 46 | relevance: 10 47 | }, 48 | { 49 | className: 'symbol', 50 | begin: '\\B(\'[A-Za-z])\\b', 51 | contains: [hljs.BACKSLASH_ESCAPE] 52 | }, 53 | hljs.C_LINE_COMMENT_MODE, 54 | hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}), 55 | hljs.C_NUMBER_MODE 56 | ] 57 | }; 58 | }; -------------------------------------------------------------------------------- /docs/js/languages/gcode.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var GCODE_IDENT_RE = '[A-Z_][A-Z0-9_.]*'; 3 | var GCODE_CLOSE_RE = '\\%'; 4 | var GCODE_KEYWORDS = 5 | 'IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT ' + 6 | 'EQ LT GT NE GE LE OR XOR'; 7 | var GCODE_START = { 8 | className: 'meta', 9 | begin: '([O])([0-9]+)' 10 | }; 11 | var GCODE_CODE = [ 12 | hljs.C_LINE_COMMENT_MODE, 13 | hljs.C_BLOCK_COMMENT_MODE, 14 | hljs.COMMENT(/\(/, /\)/), 15 | hljs.inherit(hljs.C_NUMBER_MODE, {begin: '([-+]?([0-9]*\\.?[0-9]+\\.?))|' + hljs.C_NUMBER_RE}), 16 | hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}), 17 | hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}), 18 | { 19 | className: 'name', 20 | begin: '([G])([0-9]+\\.?[0-9]?)' 21 | }, 22 | { 23 | className: 'name', 24 | begin: '([M])([0-9]+\\.?[0-9]?)' 25 | }, 26 | { 27 | className: 'attr', 28 | begin: '(VC|VS|#)', 29 | end: '(\\d+)' 30 | }, 31 | { 32 | className: 'attr', 33 | begin: '(VZOFX|VZOFY|VZOFZ)' 34 | }, 35 | { 36 | className: 'built_in', 37 | begin: '(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)', 38 | end: '([-+]?([0-9]*\\.?[0-9]+\\.?))(\\])' 39 | }, 40 | { 41 | className: 'symbol', 42 | variants: [ 43 | { 44 | begin: 'N', end: '\\d+', 45 | illegal: '\\W' 46 | } 47 | ] 48 | } 49 | ]; 50 | 51 | return { 52 | aliases: ['nc'], 53 | // Some implementations (CNC controls) of G-code are interoperable with uppercase and lowercase letters seamlessly. 54 | // However, most prefer all uppercase and uppercase is customary. 55 | case_insensitive: true, 56 | lexemes: GCODE_IDENT_RE, 57 | keywords: GCODE_KEYWORDS, 58 | contains: [ 59 | { 60 | className: 'meta', 61 | begin: GCODE_CLOSE_RE 62 | }, 63 | GCODE_START 64 | ].concat(GCODE_CODE) 65 | }; 66 | }; -------------------------------------------------------------------------------- /docs/js/languages/gherkin.js: -------------------------------------------------------------------------------- 1 | module.exports = function (hljs) { 2 | return { 3 | aliases: ['feature'], 4 | keywords: 'Feature Background Ability Business\ Need Scenario Scenarios Scenario\ Outline Scenario\ Template Examples Given And Then But When', 5 | contains: [ 6 | { 7 | className: 'symbol', 8 | begin: '\\*', 9 | relevance: 0 10 | }, 11 | { 12 | className: 'meta', 13 | begin: '@[^@\\s]+' 14 | }, 15 | { 16 | begin: '\\|', end: '\\|\\w*$', 17 | contains: [ 18 | { 19 | className: 'string', 20 | begin: '[^|]+' 21 | } 22 | ] 23 | }, 24 | { 25 | className: 'variable', 26 | begin: '<', end: '>' 27 | }, 28 | hljs.HASH_COMMENT_MODE, 29 | { 30 | className: 'string', 31 | begin: '"""', end: '"""' 32 | }, 33 | hljs.QUOTE_STRING_MODE 34 | ] 35 | }; 36 | }; -------------------------------------------------------------------------------- /docs/js/languages/go.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var GO_KEYWORDS = { 3 | keyword: 4 | 'break default func interface select case map struct chan else goto package switch ' + 5 | 'const fallthrough if range type continue for import return var go defer ' + 6 | 'bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 ' + 7 | 'uint16 uint32 uint64 int uint uintptr rune', 8 | literal: 9 | 'true false iota nil', 10 | built_in: 11 | 'append cap close complex copy imag len make new panic print println real recover delete' 12 | }; 13 | return { 14 | aliases: ['golang'], 15 | keywords: GO_KEYWORDS, 16 | illegal: '', 48 | end: ',\\s+', 49 | returnBegin: true, 50 | endsWithParent: true, 51 | contains: [ 52 | { 53 | className: 'attr', 54 | begin: ':\\w+' 55 | }, 56 | hljs.APOS_STRING_MODE, 57 | hljs.QUOTE_STRING_MODE, 58 | { 59 | begin: '\\w+', 60 | relevance: 0 61 | } 62 | ] 63 | } 64 | ] 65 | }, 66 | { 67 | begin: '\\(\\s*', 68 | end: '\\s*\\)', 69 | excludeEnd: true, 70 | contains: [ 71 | { 72 | begin: '\\w+\\s*=', 73 | end: '\\s+', 74 | returnBegin: true, 75 | endsWithParent: true, 76 | contains: [ 77 | { 78 | className: 'attr', 79 | begin: '\\w+', 80 | relevance: 0 81 | }, 82 | hljs.APOS_STRING_MODE, 83 | hljs.QUOTE_STRING_MODE, 84 | { 85 | begin: '\\w+', 86 | relevance: 0 87 | } 88 | ] 89 | } 90 | ] 91 | } 92 | ] 93 | }, 94 | { 95 | begin: '^\\s*[=~]\\s*' 96 | }, 97 | { 98 | begin: '#{', 99 | starts: { 100 | end: '}', 101 | subLanguage: 'ruby' 102 | } 103 | } 104 | ] 105 | }; 106 | }; -------------------------------------------------------------------------------- /docs/js/languages/handlebars.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var BUILT_INS = {'builtin-name': 'each in with if else unless bindattr action collection debugger log outlet template unbound view yield'}; 3 | return { 4 | aliases: ['hbs', 'html.hbs', 'html.handlebars'], 5 | case_insensitive: true, 6 | subLanguage: 'xml', 7 | contains: [ 8 | hljs.COMMENT('{{!(--)?', '(--)?}}'), 9 | { 10 | className: 'template-tag', 11 | begin: /\{\{[#\/]/, end: /\}\}/, 12 | contains: [ 13 | { 14 | className: 'name', 15 | begin: /[a-zA-Z\.-]+/, 16 | keywords: BUILT_INS, 17 | starts: { 18 | endsWithParent: true, relevance: 0, 19 | contains: [ 20 | hljs.QUOTE_STRING_MODE 21 | ] 22 | } 23 | } 24 | ] 25 | }, 26 | { 27 | className: 'template-variable', 28 | begin: /\{\{/, end: /\}\}/, 29 | keywords: BUILT_INS 30 | } 31 | ] 32 | }; 33 | }; -------------------------------------------------------------------------------- /docs/js/languages/htmlbars.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var BUILT_INS = 'action collection component concat debugger each each-in else get hash if input link-to loc log mut outlet partial query-params render textarea unbound unless with yield view'; 3 | 4 | var ATTR_ASSIGNMENT = { 5 | illegal: /\}\}/, 6 | begin: /[a-zA-Z0-9_]+=/, 7 | returnBegin: true, 8 | relevance: 0, 9 | contains: [ 10 | { 11 | className: 'attr', begin: /[a-zA-Z0-9_]+/ 12 | } 13 | ] 14 | }; 15 | 16 | var SUB_EXPR = { 17 | illegal: /\}\}/, 18 | begin: /\)/, end: /\)/, 19 | contains: [ 20 | { 21 | begin: /[a-zA-Z\.\-]+/, 22 | keywords: {built_in: BUILT_INS}, 23 | starts: { 24 | endsWithParent: true, relevance: 0, 25 | contains: [ 26 | hljs.QUOTE_STRING_MODE, 27 | ] 28 | } 29 | } 30 | ] 31 | }; 32 | 33 | var TAG_INNARDS = { 34 | endsWithParent: true, relevance: 0, 35 | keywords: {keyword: 'as', built_in: BUILT_INS}, 36 | contains: [ 37 | hljs.QUOTE_STRING_MODE, 38 | ATTR_ASSIGNMENT, 39 | hljs.NUMBER_MODE 40 | ] 41 | }; 42 | 43 | return { 44 | case_insensitive: true, 45 | subLanguage: 'xml', 46 | contains: [ 47 | hljs.COMMENT('{{!(--)?', '(--)?}}'), 48 | { 49 | className: 'template-tag', 50 | begin: /\{\{[#\/]/, end: /\}\}/, 51 | contains: [ 52 | { 53 | className: 'name', 54 | begin: /[a-zA-Z\.\-]+/, 55 | keywords: {'builtin-name': BUILT_INS}, 56 | starts: TAG_INNARDS 57 | } 58 | ] 59 | }, 60 | { 61 | className: 'template-variable', 62 | begin: /\{\{[a-zA-Z][a-zA-Z\-]+/, end: /\}\}/, 63 | keywords: {keyword: 'as', built_in: BUILT_INS}, 64 | contains: [ 65 | hljs.QUOTE_STRING_MODE 66 | ] 67 | } 68 | ] 69 | }; 70 | }; -------------------------------------------------------------------------------- /docs/js/languages/http.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var VERSION = 'HTTP/[0-9\\.]+'; 3 | return { 4 | aliases: ['https'], 5 | illegal: '\\S', 6 | contains: [ 7 | { 8 | begin: '^' + VERSION, end: '$', 9 | contains: [{className: 'number', begin: '\\b\\d{3}\\b'}] 10 | }, 11 | { 12 | begin: '^[A-Z]+ (.*?) ' + VERSION + '$', returnBegin: true, end: '$', 13 | contains: [ 14 | { 15 | className: 'string', 16 | begin: ' ', end: ' ', 17 | excludeBegin: true, excludeEnd: true 18 | }, 19 | { 20 | begin: VERSION 21 | }, 22 | { 23 | className: 'keyword', 24 | begin: '[A-Z]+' 25 | } 26 | ] 27 | }, 28 | { 29 | className: 'attribute', 30 | begin: '^\\w', end: ': ', excludeEnd: true, 31 | illegal: '\\n|\\s|=', 32 | starts: {end: '$', relevance: 0} 33 | }, 34 | { 35 | begin: '\\n\\n', 36 | starts: {subLanguage: [], endsWithParent: true} 37 | } 38 | ] 39 | }; 40 | }; -------------------------------------------------------------------------------- /docs/js/languages/inform7.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var START_BRACKET = '\\['; 3 | var END_BRACKET = '\\]'; 4 | return { 5 | aliases: ['i7'], 6 | case_insensitive: true, 7 | keywords: { 8 | // Some keywords more or less unique to I7, for relevance. 9 | keyword: 10 | // kind: 11 | 'thing room person man woman animal container ' + 12 | 'supporter backdrop door ' + 13 | // characteristic: 14 | 'scenery open closed locked inside gender ' + 15 | // verb: 16 | 'is are say understand ' + 17 | // misc keyword: 18 | 'kind of rule' 19 | }, 20 | contains: [ 21 | { 22 | className: 'string', 23 | begin: '"', end: '"', 24 | relevance: 0, 25 | contains: [ 26 | { 27 | className: 'subst', 28 | begin: START_BRACKET, end: END_BRACKET 29 | } 30 | ] 31 | }, 32 | { 33 | className: 'section', 34 | begin: /^(Volume|Book|Part|Chapter|Section|Table)\b/, 35 | end: '$' 36 | }, 37 | { 38 | // Rule definition 39 | // This is here for relevance. 40 | begin: /^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/, 41 | end: ':', 42 | contains: [ 43 | { 44 | //Rule name 45 | begin: '\\(This', end: '\\)' 46 | } 47 | ] 48 | }, 49 | { 50 | className: 'comment', 51 | begin: START_BRACKET, end: END_BRACKET, 52 | contains: ['self'] 53 | } 54 | ] 55 | }; 56 | }; -------------------------------------------------------------------------------- /docs/js/languages/ini.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var STRING = { 3 | className: "string", 4 | contains: [hljs.BACKSLASH_ESCAPE], 5 | variants: [ 6 | { 7 | begin: "'''", end: "'''", 8 | relevance: 10 9 | }, { 10 | begin: '"""', end: '"""', 11 | relevance: 10 12 | }, { 13 | begin: '"', end: '"' 14 | }, { 15 | begin: "'", end: "'" 16 | } 17 | ] 18 | }; 19 | return { 20 | aliases: ['toml'], 21 | case_insensitive: true, 22 | illegal: /\S/, 23 | contains: [ 24 | hljs.COMMENT(';', '$'), 25 | hljs.HASH_COMMENT_MODE, 26 | { 27 | className: 'section', 28 | begin: /^\s*\[+/, end: /\]+/ 29 | }, 30 | { 31 | begin: /^[a-z0-9\[\]_-]+\s*=\s*/, end: '$', 32 | returnBegin: true, 33 | contains: [ 34 | { 35 | className: 'attr', 36 | begin: /[a-z0-9\[\]_-]+/ 37 | }, 38 | { 39 | begin: /=/, endsWithParent: true, 40 | relevance: 0, 41 | contains: [ 42 | { 43 | className: 'literal', 44 | begin: /\bon|off|true|false|yes|no\b/ 45 | }, 46 | { 47 | className: 'variable', 48 | variants: [ 49 | {begin: /\$[\w\d"][\w\d_]*/}, 50 | {begin: /\$\{(.*?)}/} 51 | ] 52 | }, 53 | STRING, 54 | { 55 | className: 'number', 56 | begin: /([\+\-]+)?[\d]+_[\d_]+/ 57 | }, 58 | hljs.NUMBER_MODE 59 | ] 60 | } 61 | ] 62 | } 63 | ] 64 | }; 65 | }; -------------------------------------------------------------------------------- /docs/js/languages/jboss-cli.js: -------------------------------------------------------------------------------- 1 | module.exports = function (hljs) { 2 | var PARAM = { 3 | begin: /[\w-]+ *=/, returnBegin: true, 4 | relevance: 0, 5 | contains: [{className: 'attr', begin: /[\w-]+/}] 6 | }; 7 | var PARAMSBLOCK = { 8 | className: 'params', 9 | begin: /\(/, 10 | end: /\)/, 11 | contains: [PARAM], 12 | relevance : 0 13 | }; 14 | var OPERATION = { 15 | className: 'function', 16 | begin: /:[\w\-.]+/, 17 | relevance: 0 18 | }; 19 | var PATH = { 20 | className: 'string', 21 | begin: /\B(([\/.])[\w\-.\/=]+)+/, 22 | }; 23 | var COMMAND_PARAMS = { 24 | className: 'params', 25 | begin: /--[\w\-=\/]+/, 26 | }; 27 | return { 28 | aliases: ['wildfly-cli'], 29 | lexemes: '[a-z\-]+', 30 | keywords: { 31 | keyword: 'alias batch cd clear command connect connection-factory connection-info data-source deploy ' + 32 | 'deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls ' + 33 | 'patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias ' + 34 | 'undeploy unset version xa-data-source', // module 35 | literal: 'true false' 36 | }, 37 | contains: [ 38 | hljs.HASH_COMMENT_MODE, 39 | hljs.QUOTE_STRING_MODE, 40 | COMMAND_PARAMS, 41 | OPERATION, 42 | PATH, 43 | PARAMSBLOCK 44 | ] 45 | } 46 | }; -------------------------------------------------------------------------------- /docs/js/languages/json.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var LITERALS = {literal: 'true false null'}; 3 | var TYPES = [ 4 | hljs.QUOTE_STRING_MODE, 5 | hljs.C_NUMBER_MODE 6 | ]; 7 | var VALUE_CONTAINER = { 8 | end: ',', endsWithParent: true, excludeEnd: true, 9 | contains: TYPES, 10 | keywords: LITERALS 11 | }; 12 | var OBJECT = { 13 | begin: '{', end: '}', 14 | contains: [ 15 | { 16 | className: 'attr', 17 | begin: /"/, end: /"/, 18 | contains: [hljs.BACKSLASH_ESCAPE], 19 | illegal: '\\n', 20 | }, 21 | hljs.inherit(VALUE_CONTAINER, {begin: /:/}) 22 | ], 23 | illegal: '\\S' 24 | }; 25 | var ARRAY = { 26 | begin: '\\[', end: '\\]', 27 | contains: [hljs.inherit(VALUE_CONTAINER)], // inherit is a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents 28 | illegal: '\\S' 29 | }; 30 | TYPES.splice(TYPES.length, 0, OBJECT, ARRAY); 31 | return { 32 | contains: TYPES, 33 | keywords: LITERALS, 34 | illegal: '\\S' 35 | }; 36 | }; -------------------------------------------------------------------------------- /docs/js/languages/julia-repl.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | contains: [ 4 | { 5 | className: 'meta', 6 | begin: /^julia>/, 7 | relevance: 10, 8 | starts: { 9 | // end the highlighting if we are on a new line and the line does not have at 10 | // least six spaces in the beginning 11 | end: /^(?![ ]{6})/, 12 | subLanguage: 'julia' 13 | }, 14 | // jldoctest Markdown blocks are used in the Julia manual and package docs indicate 15 | // code snippets that should be verified when the documentation is built. They can be 16 | // either REPL-like or script-like, but are usually REPL-like and therefore we apply 17 | // julia-repl highlighting to them. More information can be found in Documenter's 18 | // manual: https://juliadocs.github.io/Documenter.jl/latest/man/doctests.html 19 | aliases: ['jldoctest'] 20 | } 21 | ] 22 | } 23 | }; -------------------------------------------------------------------------------- /docs/js/languages/ldif.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | contains: [ 4 | { 5 | className: 'attribute', 6 | begin: '^dn', end: ': ', excludeEnd: true, 7 | starts: {end: '$', relevance: 0}, 8 | relevance: 10 9 | }, 10 | { 11 | className: 'attribute', 12 | begin: '^\\w', end: ': ', excludeEnd: true, 13 | starts: {end: '$', relevance: 0} 14 | }, 15 | { 16 | className: 'literal', 17 | begin: '^-', end: '$' 18 | }, 19 | hljs.HASH_COMMENT_MODE 20 | ] 21 | }; 22 | }; -------------------------------------------------------------------------------- /docs/js/languages/leaf.js: -------------------------------------------------------------------------------- 1 | module.exports = function (hljs) { 2 | return { 3 | contains: [ 4 | { 5 | className: 'function', 6 | begin: '#+' + '[A-Za-z_0-9]*' + '\\(', 7 | end:' {', 8 | returnBegin: true, 9 | excludeEnd: true, 10 | contains : [ 11 | { 12 | className: 'keyword', 13 | begin: '#+' 14 | }, 15 | { 16 | className: 'title', 17 | begin: '[A-Za-z_][A-Za-z_0-9]*' 18 | }, 19 | { 20 | className: 'params', 21 | begin: '\\(', end: '\\)', 22 | endsParent: true, 23 | contains: [ 24 | { 25 | className: 'string', 26 | begin: '"', 27 | end: '"' 28 | }, 29 | { 30 | className: 'variable', 31 | begin: '[A-Za-z_][A-Za-z_0-9]*' 32 | } 33 | ] 34 | } 35 | ] 36 | } 37 | ] 38 | }; 39 | }; -------------------------------------------------------------------------------- /docs/js/languages/lisp.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*'; 3 | var MEC_RE = '\\|[^]*?\\|'; 4 | var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|\\-)?\\d+)?'; 5 | var SHEBANG = { 6 | className: 'meta', 7 | begin: '^#!', end: '$' 8 | }; 9 | var LITERAL = { 10 | className: 'literal', 11 | begin: '\\b(t{1}|nil)\\b' 12 | }; 13 | var NUMBER = { 14 | className: 'number', 15 | variants: [ 16 | {begin: LISP_SIMPLE_NUMBER_RE, relevance: 0}, 17 | {begin: '#(b|B)[0-1]+(/[0-1]+)?'}, 18 | {begin: '#(o|O)[0-7]+(/[0-7]+)?'}, 19 | {begin: '#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?'}, 20 | {begin: '#(c|C)\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'} 21 | ] 22 | }; 23 | var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}); 24 | var COMMENT = hljs.COMMENT( 25 | ';', '$', 26 | { 27 | relevance: 0 28 | } 29 | ); 30 | var VARIABLE = { 31 | begin: '\\*', end: '\\*' 32 | }; 33 | var KEYWORD = { 34 | className: 'symbol', 35 | begin: '[:&]' + LISP_IDENT_RE 36 | }; 37 | var IDENT = { 38 | begin: LISP_IDENT_RE, 39 | relevance: 0 40 | }; 41 | var MEC = { 42 | begin: MEC_RE 43 | }; 44 | var QUOTED_LIST = { 45 | begin: '\\(', end: '\\)', 46 | contains: ['self', LITERAL, STRING, NUMBER, IDENT] 47 | }; 48 | var QUOTED = { 49 | contains: [NUMBER, STRING, VARIABLE, KEYWORD, QUOTED_LIST, IDENT], 50 | variants: [ 51 | { 52 | begin: '[\'`]\\(', end: '\\)' 53 | }, 54 | { 55 | begin: '\\(quote ', end: '\\)', 56 | keywords: {name: 'quote'} 57 | }, 58 | { 59 | begin: '\'' + MEC_RE 60 | } 61 | ] 62 | }; 63 | var QUOTED_ATOM = { 64 | variants: [ 65 | {begin: '\'' + LISP_IDENT_RE}, 66 | {begin: '#\'' + LISP_IDENT_RE + '(::' + LISP_IDENT_RE + ')*'} 67 | ] 68 | }; 69 | var LIST = { 70 | begin: '\\(\\s*', end: '\\)' 71 | }; 72 | var BODY = { 73 | endsWithParent: true, 74 | relevance: 0 75 | }; 76 | LIST.contains = [ 77 | { 78 | className: 'name', 79 | variants: [ 80 | {begin: LISP_IDENT_RE}, 81 | {begin: MEC_RE} 82 | ] 83 | }, 84 | BODY 85 | ]; 86 | BODY.contains = [QUOTED, QUOTED_ATOM, LIST, LITERAL, NUMBER, STRING, COMMENT, VARIABLE, KEYWORD, MEC, IDENT]; 87 | 88 | return { 89 | illegal: /\S/, 90 | contains: [ 91 | NUMBER, 92 | SHEBANG, 93 | LITERAL, 94 | STRING, 95 | COMMENT, 96 | QUOTED, 97 | QUOTED_ATOM, 98 | LIST, 99 | IDENT 100 | ] 101 | }; 102 | }; -------------------------------------------------------------------------------- /docs/js/languages/lua.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var OPENING_LONG_BRACKET = '\\[=*\\['; 3 | var CLOSING_LONG_BRACKET = '\\]=*\\]'; 4 | var LONG_BRACKETS = { 5 | begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET, 6 | contains: ['self'] 7 | }; 8 | var COMMENTS = [ 9 | hljs.COMMENT('--(?!' + OPENING_LONG_BRACKET + ')', '$'), 10 | hljs.COMMENT( 11 | '--' + OPENING_LONG_BRACKET, 12 | CLOSING_LONG_BRACKET, 13 | { 14 | contains: [LONG_BRACKETS], 15 | relevance: 10 16 | } 17 | ) 18 | ]; 19 | return { 20 | lexemes: hljs.UNDERSCORE_IDENT_RE, 21 | keywords: { 22 | literal: "true false nil", 23 | keyword: "and break do else elseif end for goto if in local not or repeat return then until while", 24 | built_in: 25 | //Metatags and globals: 26 | '_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len ' + 27 | '__gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert ' + 28 | //Standard methods and properties: 29 | 'collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring' + 30 | 'module next pairs pcall print rawequal rawget rawset require select setfenv' + 31 | 'setmetatable tonumber tostring type unpack xpcall arg self' + 32 | //Library methods and properties (one line per library): 33 | 'coroutine resume yield status wrap create running debug getupvalue ' + 34 | 'debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv ' + 35 | 'io lines write close flush open output type read stderr stdin input stdout popen tmpfile ' + 36 | 'math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan ' + 37 | 'os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall ' + 38 | 'string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower ' + 39 | 'table setn insert getn foreachi maxn foreach concat sort remove' 40 | }, 41 | contains: COMMENTS.concat([ 42 | { 43 | className: 'function', 44 | beginKeywords: 'function', end: '\\)', 45 | contains: [ 46 | hljs.inherit(hljs.TITLE_MODE, {begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'}), 47 | { 48 | className: 'params', 49 | begin: '\\(', endsWithParent: true, 50 | contains: COMMENTS 51 | } 52 | ].concat(COMMENTS) 53 | }, 54 | hljs.C_NUMBER_MODE, 55 | hljs.APOS_STRING_MODE, 56 | hljs.QUOTE_STRING_MODE, 57 | { 58 | className: 'string', 59 | begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET, 60 | contains: [LONG_BRACKETS], 61 | relevance: 5 62 | } 63 | ]) 64 | }; 65 | }; -------------------------------------------------------------------------------- /docs/js/languages/makefile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | /* Variables: simple (eg $(var)) and special (eg $@) */ 3 | var VARIABLE = { 4 | className: 'variable', 5 | variants: [ 6 | { 7 | begin: '\\$\\(' + hljs.UNDERSCORE_IDENT_RE + '\\)', 8 | contains: [hljs.BACKSLASH_ESCAPE], 9 | }, 10 | { 11 | begin: /\$[@%', 16 | subLanguage: 'xml', 17 | relevance: 0 18 | }, 19 | // lists (indicators only) 20 | { 21 | className: 'bullet', 22 | begin: '^([*+-]|(\\d+\\.))\\s+' 23 | }, 24 | // strong segments 25 | { 26 | className: 'strong', 27 | begin: '[*_]{2}.+?[*_]{2}' 28 | }, 29 | // emphasis segments 30 | { 31 | className: 'emphasis', 32 | variants: [ 33 | { begin: '\\*.+?\\*' }, 34 | { begin: '_.+?_' 35 | , relevance: 0 36 | } 37 | ] 38 | }, 39 | // blockquotes 40 | { 41 | className: 'quote', 42 | begin: '^>\\s+', end: '$' 43 | }, 44 | // code snippets 45 | { 46 | className: 'code', 47 | variants: [ 48 | { 49 | begin: '^```\w*\s*$', end: '^```\s*$' 50 | }, 51 | { 52 | begin: '`.+?`' 53 | }, 54 | { 55 | begin: '^( {4}|\t)', end: '$', 56 | relevance: 0 57 | } 58 | ] 59 | }, 60 | // horizontal rules 61 | { 62 | begin: '^[-\\*]{3,}', end: '$' 63 | }, 64 | // using links - title and link 65 | { 66 | begin: '\\[.+?\\][\\(\\[].*?[\\)\\]]', 67 | returnBegin: true, 68 | contains: [ 69 | { 70 | className: 'string', 71 | begin: '\\[', end: '\\]', 72 | excludeBegin: true, 73 | returnEnd: true, 74 | relevance: 0 75 | }, 76 | { 77 | className: 'link', 78 | begin: '\\]\\(', end: '\\)', 79 | excludeBegin: true, excludeEnd: true 80 | }, 81 | { 82 | className: 'symbol', 83 | begin: '\\]\\[', end: '\\]', 84 | excludeBegin: true, excludeEnd: true 85 | } 86 | ], 87 | relevance: 10 88 | }, 89 | { 90 | begin: /^\[[^\n]+\]:/, 91 | returnBegin: true, 92 | contains: [ 93 | { 94 | className: 'symbol', 95 | begin: /\[/, end: /\]/, 96 | excludeBegin: true, excludeEnd: true 97 | }, 98 | { 99 | className: 'link', 100 | begin: /:\s*/, end: /$/, 101 | excludeBegin: true 102 | } 103 | ] 104 | } 105 | ] 106 | }; 107 | }; -------------------------------------------------------------------------------- /docs/js/languages/mercury.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var KEYWORDS = { 3 | keyword: 4 | 'module use_module import_module include_module end_module initialise ' + 5 | 'mutable initialize finalize finalise interface implementation pred ' + 6 | 'mode func type inst solver any_pred any_func is semidet det nondet ' + 7 | 'multi erroneous failure cc_nondet cc_multi typeclass instance where ' + 8 | 'pragma promise external trace atomic or_else require_complete_switch ' + 9 | 'require_det require_semidet require_multi require_nondet ' + 10 | 'require_cc_multi require_cc_nondet require_erroneous require_failure', 11 | meta: 12 | // pragma 13 | 'inline no_inline type_spec source_file fact_table obsolete memo ' + 14 | 'loop_check minimal_model terminates does_not_terminate ' + 15 | 'check_termination promise_equivalent_clauses ' + 16 | // preprocessor 17 | 'foreign_proc foreign_decl foreign_code foreign_type ' + 18 | 'foreign_import_module foreign_export_enum foreign_export ' + 19 | 'foreign_enum may_call_mercury will_not_call_mercury thread_safe ' + 20 | 'not_thread_safe maybe_thread_safe promise_pure promise_semipure ' + 21 | 'tabled_for_io local untrailed trailed attach_to_io_state ' + 22 | 'can_pass_as_mercury_type stable will_not_throw_exception ' + 23 | 'may_modify_trail will_not_modify_trail may_duplicate ' + 24 | 'may_not_duplicate affects_liveness does_not_affect_liveness ' + 25 | 'doesnt_affect_liveness no_sharing unknown_sharing sharing', 26 | built_in: 27 | 'some all not if then else true fail false try catch catch_any ' + 28 | 'semidet_true semidet_false semidet_fail impure_true impure semipure' 29 | }; 30 | 31 | var COMMENT = hljs.COMMENT('%', '$'); 32 | 33 | var NUMCODE = { 34 | className: 'number', 35 | begin: "0'.\\|0[box][0-9a-fA-F]*" 36 | }; 37 | 38 | var ATOM = hljs.inherit(hljs.APOS_STRING_MODE, {relevance: 0}); 39 | var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {relevance: 0}); 40 | var STRING_FMT = { 41 | className: 'subst', 42 | begin: '\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]', 43 | relevance: 0 44 | }; 45 | STRING.contains.push(STRING_FMT); 46 | 47 | var IMPLICATION = { 48 | className: 'built_in', 49 | variants: [ 50 | {begin: '<=>'}, 51 | {begin: '<=', relevance: 0}, 52 | {begin: '=>', relevance: 0}, 53 | {begin: '/\\\\'}, 54 | {begin: '\\\\/'} 55 | ] 56 | }; 57 | 58 | var HEAD_BODY_CONJUNCTION = { 59 | className: 'built_in', 60 | variants: [ 61 | {begin: ':-\\|-->'}, 62 | {begin: '=', relevance: 0} 63 | ] 64 | }; 65 | 66 | return { 67 | aliases: ['m', 'moo'], 68 | keywords: KEYWORDS, 69 | contains: [ 70 | IMPLICATION, 71 | HEAD_BODY_CONJUNCTION, 72 | COMMENT, 73 | hljs.C_BLOCK_COMMENT_MODE, 74 | NUMCODE, 75 | hljs.NUMBER_MODE, 76 | ATOM, 77 | STRING, 78 | {begin: /:-/} // relevance booster 79 | ] 80 | }; 81 | }; -------------------------------------------------------------------------------- /docs/js/languages/mizar.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | keywords: 4 | 'environ vocabularies notations constructors definitions ' + 5 | 'registrations theorems schemes requirements begin end definition ' + 6 | 'registration cluster existence pred func defpred deffunc theorem ' + 7 | 'proof let take assume then thus hence ex for st holds consider ' + 8 | 'reconsider such that and in provided of as from be being by means ' + 9 | 'equals implies iff redefine define now not or attr is mode ' + 10 | 'suppose per cases set thesis contradiction scheme reserve struct ' + 11 | 'correctness compatibility coherence symmetry assymetry ' + 12 | 'reflexivity irreflexivity connectedness uniqueness commutativity ' + 13 | 'idempotence involutiveness projectivity', 14 | contains: [ 15 | hljs.COMMENT('::', '$') 16 | ] 17 | }; 18 | }; -------------------------------------------------------------------------------- /docs/js/languages/mojolicious.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | subLanguage: 'xml', 4 | contains: [ 5 | { 6 | className: 'meta', 7 | begin: '^__(END|DATA)__$' 8 | }, 9 | // mojolicious line 10 | { 11 | begin: "^\\s*%{1,2}={0,2}", end: '$', 12 | subLanguage: 'perl' 13 | }, 14 | // mojolicious block 15 | { 16 | begin: "<%{1,2}={0,2}", 17 | end: "={0,1}%>", 18 | subLanguage: 'perl', 19 | excludeBegin: true, 20 | excludeEnd: true 21 | } 22 | ] 23 | }; 24 | }; -------------------------------------------------------------------------------- /docs/js/languages/monkey.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var NUMBER = { 3 | className: 'number', relevance: 0, 4 | variants: [ 5 | { 6 | begin: '[$][a-fA-F0-9]+' 7 | }, 8 | hljs.NUMBER_MODE 9 | ] 10 | }; 11 | 12 | return { 13 | case_insensitive: true, 14 | keywords: { 15 | keyword: 'public private property continue exit extern new try catch ' + 16 | 'eachin not abstract final select case default const local global field ' + 17 | 'end if then else elseif endif while wend repeat until forever for ' + 18 | 'to step next return module inline throw import', 19 | 20 | built_in: 'DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil ' + 21 | 'Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI', 22 | 23 | literal: 'true false null and or shl shr mod' 24 | }, 25 | illegal: /\/\*/, 26 | contains: [ 27 | hljs.COMMENT('#rem', '#end'), 28 | hljs.COMMENT( 29 | "'", 30 | '$', 31 | { 32 | relevance: 0 33 | } 34 | ), 35 | { 36 | className: 'function', 37 | beginKeywords: 'function method', end: '[(=:]|$', 38 | illegal: /\n/, 39 | contains: [ 40 | hljs.UNDERSCORE_TITLE_MODE 41 | ] 42 | }, 43 | { 44 | className: 'class', 45 | beginKeywords: 'class interface', end: '$', 46 | contains: [ 47 | { 48 | beginKeywords: 'extends implements' 49 | }, 50 | hljs.UNDERSCORE_TITLE_MODE 51 | ] 52 | }, 53 | { 54 | className: 'built_in', 55 | begin: '\\b(self|super)\\b' 56 | }, 57 | { 58 | className: 'meta', 59 | begin: '\\s*#', end: '$', 60 | keywords: {'meta-keyword': 'if else elseif endif end then'} 61 | }, 62 | { 63 | className: 'meta', 64 | begin: '^\\s*strict\\b' 65 | }, 66 | { 67 | beginKeywords: 'alias', end: '=', 68 | contains: [hljs.UNDERSCORE_TITLE_MODE] 69 | }, 70 | hljs.QUOTE_STRING_MODE, 71 | NUMBER 72 | ] 73 | } 74 | }; -------------------------------------------------------------------------------- /docs/js/languages/nginx.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var VAR = { 3 | className: 'variable', 4 | variants: [ 5 | {begin: /\$\d+/}, 6 | {begin: /\$\{/, end: /}/}, 7 | {begin: '[\\$\\@]' + hljs.UNDERSCORE_IDENT_RE} 8 | ] 9 | }; 10 | var DEFAULT = { 11 | endsWithParent: true, 12 | lexemes: '[a-z/_]+', 13 | keywords: { 14 | literal: 15 | 'on off yes no true false none blocked debug info notice warn error crit ' + 16 | 'select break last permanent redirect kqueue rtsig epoll poll /dev/poll' 17 | }, 18 | relevance: 0, 19 | illegal: '=>', 20 | contains: [ 21 | hljs.HASH_COMMENT_MODE, 22 | { 23 | className: 'string', 24 | contains: [hljs.BACKSLASH_ESCAPE, VAR], 25 | variants: [ 26 | {begin: /"/, end: /"/}, 27 | {begin: /'/, end: /'/} 28 | ] 29 | }, 30 | // this swallows entire URLs to avoid detecting numbers within 31 | { 32 | begin: '([a-z]+):/', end: '\\s', endsWithParent: true, excludeEnd: true, 33 | contains: [VAR] 34 | }, 35 | { 36 | className: 'regexp', 37 | contains: [hljs.BACKSLASH_ESCAPE, VAR], 38 | variants: [ 39 | {begin: "\\s\\^", end: "\\s|{|;", returnEnd: true}, 40 | // regexp locations (~, ~*) 41 | {begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: true}, 42 | // *.example.com 43 | {begin: "\\*(\\.[a-z\\-]+)+"}, 44 | // sub.example.* 45 | {begin: "([a-z\\-]+\\.)+\\*"} 46 | ] 47 | }, 48 | // IP 49 | { 50 | className: 'number', 51 | begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b' 52 | }, 53 | // units 54 | { 55 | className: 'number', 56 | begin: '\\b\\d+[kKmMgGdshdwy]*\\b', 57 | relevance: 0 58 | }, 59 | VAR 60 | ] 61 | }; 62 | 63 | return { 64 | aliases: ['nginxconf'], 65 | contains: [ 66 | hljs.HASH_COMMENT_MODE, 67 | { 68 | begin: hljs.UNDERSCORE_IDENT_RE + '\\s+{', returnBegin: true, 69 | end: '{', 70 | contains: [ 71 | { 72 | className: 'section', 73 | begin: hljs.UNDERSCORE_IDENT_RE 74 | } 75 | ], 76 | relevance: 0 77 | }, 78 | { 79 | begin: hljs.UNDERSCORE_IDENT_RE + '\\s', end: ';|{', returnBegin: true, 80 | contains: [ 81 | { 82 | className: 'attribute', 83 | begin: hljs.UNDERSCORE_IDENT_RE, 84 | starts: DEFAULT 85 | } 86 | ], 87 | relevance: 0 88 | } 89 | ], 90 | illegal: '[^\\s\\}]' 91 | }; 92 | }; -------------------------------------------------------------------------------- /docs/js/languages/nimrod.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['nim'], 4 | keywords: { 5 | keyword: 6 | 'addr and as asm bind block break case cast const continue converter ' + 7 | 'discard distinct div do elif else end enum except export finally ' + 8 | 'for from generic if import in include interface is isnot iterator ' + 9 | 'let macro method mixin mod nil not notin object of or out proc ptr ' + 10 | 'raise ref return shl shr static template try tuple type using var ' + 11 | 'when while with without xor yield', 12 | literal: 13 | 'shared guarded stdin stdout stderr result true false', 14 | built_in: 15 | 'int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float ' + 16 | 'float32 float64 bool char string cstring pointer expr stmt void ' + 17 | 'auto any range array openarray varargs seq set clong culong cchar ' + 18 | 'cschar cshort cint csize clonglong cfloat cdouble clongdouble ' + 19 | 'cuchar cushort cuint culonglong cstringarray semistatic' 20 | }, 21 | contains: [ { 22 | className: 'meta', // Actually pragma 23 | begin: /{\./, 24 | end: /\.}/, 25 | relevance: 10 26 | }, { 27 | className: 'string', 28 | begin: /[a-zA-Z]\w*"/, 29 | end: /"/, 30 | contains: [{begin: /""/}] 31 | }, { 32 | className: 'string', 33 | begin: /([a-zA-Z]\w*)?"""/, 34 | end: /"""/ 35 | }, 36 | hljs.QUOTE_STRING_MODE, 37 | { 38 | className: 'type', 39 | begin: /\b[A-Z]\w+\b/, 40 | relevance: 0 41 | }, { 42 | className: 'number', 43 | relevance: 0, 44 | variants: [ 45 | {begin: /\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/}, 46 | {begin: /\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/}, 47 | {begin: /\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/}, 48 | {begin: /\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/} 49 | ] 50 | }, 51 | hljs.HASH_COMMENT_MODE 52 | ] 53 | } 54 | }; -------------------------------------------------------------------------------- /docs/js/languages/nix.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var NIX_KEYWORDS = { 3 | keyword: 4 | 'rec with let in inherit assert if else then', 5 | literal: 6 | 'true false or and null', 7 | built_in: 8 | 'import abort baseNameOf dirOf isNull builtins map removeAttrs throw ' + 9 | 'toString derivation' 10 | }; 11 | var ANTIQUOTE = { 12 | className: 'subst', 13 | begin: /\$\{/, 14 | end: /}/, 15 | keywords: NIX_KEYWORDS 16 | }; 17 | var ATTRS = { 18 | begin: /[a-zA-Z0-9-_]+(\s*=)/, returnBegin: true, 19 | relevance: 0, 20 | contains: [ 21 | { 22 | className: 'attr', 23 | begin: /\S+/ 24 | } 25 | ] 26 | }; 27 | var STRING = { 28 | className: 'string', 29 | contains: [ANTIQUOTE], 30 | variants: [ 31 | {begin: "''", end: "''"}, 32 | {begin: '"', end: '"'} 33 | ] 34 | }; 35 | var EXPRESSIONS = [ 36 | hljs.NUMBER_MODE, 37 | hljs.HASH_COMMENT_MODE, 38 | hljs.C_BLOCK_COMMENT_MODE, 39 | STRING, 40 | ATTRS 41 | ]; 42 | ANTIQUOTE.contains = EXPRESSIONS; 43 | return { 44 | aliases: ["nixos"], 45 | keywords: NIX_KEYWORDS, 46 | contains: EXPRESSIONS 47 | }; 48 | }; -------------------------------------------------------------------------------- /docs/js/languages/ocaml.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | /* missing support for heredoc-like string (OCaml 4.0.2+) */ 3 | return { 4 | aliases: ['ml'], 5 | keywords: { 6 | keyword: 7 | 'and as assert asr begin class constraint do done downto else end ' + 8 | 'exception external for fun function functor if in include ' + 9 | 'inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method ' + 10 | 'mod module mutable new object of open! open or private rec sig struct ' + 11 | 'then to try type val! val virtual when while with ' + 12 | /* camlp4 */ 13 | 'parser value', 14 | built_in: 15 | /* built-in types */ 16 | 'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit ' + 17 | /* (some) types in Pervasives */ 18 | 'in_channel out_channel ref', 19 | literal: 20 | 'true false' 21 | }, 22 | illegal: /\/\/|>>/, 23 | lexemes: '[a-z_]\\w*!?', 24 | contains: [ 25 | { 26 | className: 'literal', 27 | begin: '\\[(\\|\\|)?\\]|\\(\\)', 28 | relevance: 0 29 | }, 30 | hljs.COMMENT( 31 | '\\(\\*', 32 | '\\*\\)', 33 | { 34 | contains: ['self'] 35 | } 36 | ), 37 | { /* type variable */ 38 | className: 'symbol', 39 | begin: '\'[A-Za-z_](?!\')[\\w\']*' 40 | /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */ 41 | }, 42 | { /* polymorphic variant */ 43 | className: 'type', 44 | begin: '`[A-Z][\\w\']*' 45 | }, 46 | { /* module or constructor */ 47 | className: 'type', 48 | begin: '\\b[A-Z][\\w\']*', 49 | relevance: 0 50 | }, 51 | { /* don't color identifiers, but safely catch all identifiers with '*/ 52 | begin: '[a-z_]\\w*\'[\\w\']*', relevance: 0 53 | }, 54 | hljs.inherit(hljs.APOS_STRING_MODE, {className: 'string', relevance: 0}), 55 | hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}), 56 | { 57 | className: 'number', 58 | begin: 59 | '\\b(0[xX][a-fA-F0-9_]+[Lln]?|' + 60 | '0[oO][0-7_]+[Lln]?|' + 61 | '0[bB][01_]+[Lln]?|' + 62 | '[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)', 63 | relevance: 0 64 | }, 65 | { 66 | begin: /[-=]>/ // relevance booster 67 | } 68 | ] 69 | } 70 | }; -------------------------------------------------------------------------------- /docs/js/languages/openscad.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var SPECIAL_VARS = { 3 | className: 'keyword', 4 | begin: '\\$(f[asn]|t|vp[rtd]|children)' 5 | }, 6 | LITERALS = { 7 | className: 'literal', 8 | begin: 'false|true|PI|undef' 9 | }, 10 | NUMBERS = { 11 | className: 'number', 12 | begin: '\\b\\d+(\\.\\d+)?(e-?\\d+)?', //adds 1e5, 1e-10 13 | relevance: 0 14 | }, 15 | STRING = hljs.inherit(hljs.QUOTE_STRING_MODE,{illegal: null}), 16 | PREPRO = { 17 | className: 'meta', 18 | keywords: {'meta-keyword': 'include use'}, 19 | begin: 'include|use <', 20 | end: '>' 21 | }, 22 | PARAMS = { 23 | className: 'params', 24 | begin: '\\(', end: '\\)', 25 | contains: ['self', NUMBERS, STRING, SPECIAL_VARS, LITERALS] 26 | }, 27 | MODIFIERS = { 28 | begin: '[*!#%]', 29 | relevance: 0 30 | }, 31 | FUNCTIONS = { 32 | className: 'function', 33 | beginKeywords: 'module function', 34 | end: '\\=|\\{', 35 | contains: [PARAMS, hljs.UNDERSCORE_TITLE_MODE] 36 | }; 37 | 38 | return { 39 | aliases: ['scad'], 40 | keywords: { 41 | keyword: 'function module include use for intersection_for if else \\%', 42 | literal: 'false true PI undef', 43 | built_in: 'circle square polygon text sphere cube cylinder polyhedron translate rotate scale resize mirror multmatrix color offset hull minkowski union difference intersection abs sign sin cos tan acos asin atan atan2 floor round ceil ln log pow sqrt exp rands min max concat lookup str chr search version version_num norm cross parent_module echo import import_dxf dxf_linear_extrude linear_extrude rotate_extrude surface projection render children dxf_cross dxf_dim let assign' 44 | }, 45 | contains: [ 46 | hljs.C_LINE_COMMENT_MODE, 47 | hljs.C_BLOCK_COMMENT_MODE, 48 | NUMBERS, 49 | PREPRO, 50 | STRING, 51 | SPECIAL_VARS, 52 | MODIFIERS, 53 | FUNCTIONS 54 | ] 55 | } 56 | }; -------------------------------------------------------------------------------- /docs/js/languages/oxygene.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var OXYGENE_KEYWORDS = 'abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue '+ 3 | 'create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false '+ 4 | 'final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited '+ 5 | 'inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of '+ 6 | 'old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly '+ 7 | 'record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple '+ 8 | 'type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal '+ 9 | 'register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained'; 10 | var CURLY_COMMENT = hljs.COMMENT( 11 | '{', 12 | '}', 13 | { 14 | relevance: 0 15 | } 16 | ); 17 | var PAREN_COMMENT = hljs.COMMENT( 18 | '\\(\\*', 19 | '\\*\\)', 20 | { 21 | relevance: 10 22 | } 23 | ); 24 | var STRING = { 25 | className: 'string', 26 | begin: '\'', end: '\'', 27 | contains: [{begin: '\'\''}] 28 | }; 29 | var CHAR_STRING = { 30 | className: 'string', begin: '(#\\d+)+' 31 | }; 32 | var FUNCTION = { 33 | className: 'function', 34 | beginKeywords: 'function constructor destructor procedure method', end: '[:;]', 35 | keywords: 'function constructor|10 destructor|10 procedure|10 method|10', 36 | contains: [ 37 | hljs.TITLE_MODE, 38 | { 39 | className: 'params', 40 | begin: '\\(', end: '\\)', 41 | keywords: OXYGENE_KEYWORDS, 42 | contains: [STRING, CHAR_STRING] 43 | }, 44 | CURLY_COMMENT, PAREN_COMMENT 45 | ] 46 | }; 47 | return { 48 | case_insensitive: true, 49 | lexemes: /\.?\w+/, 50 | keywords: OXYGENE_KEYWORDS, 51 | illegal: '("|\\$[G-Zg-z]|\\/\\*||->)', 52 | contains: [ 53 | CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE, 54 | STRING, CHAR_STRING, 55 | hljs.NUMBER_MODE, 56 | FUNCTION, 57 | { 58 | className: 'class', 59 | begin: '=\\bclass\\b', end: 'end;', 60 | keywords: OXYGENE_KEYWORDS, 61 | contains: [ 62 | STRING, CHAR_STRING, 63 | CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE, 64 | FUNCTION 65 | ] 66 | } 67 | ] 68 | }; 69 | }; -------------------------------------------------------------------------------- /docs/js/languages/parser3.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var CURLY_SUBCOMMENT = hljs.COMMENT( 3 | '{', 4 | '}', 5 | { 6 | contains: ['self'] 7 | } 8 | ); 9 | return { 10 | subLanguage: 'xml', relevance: 0, 11 | contains: [ 12 | hljs.COMMENT('^#', '$'), 13 | hljs.COMMENT( 14 | '\\^rem{', 15 | '}', 16 | { 17 | relevance: 10, 18 | contains: [ 19 | CURLY_SUBCOMMENT 20 | ] 21 | } 22 | ), 23 | { 24 | className: 'meta', 25 | begin: '^@(?:BASE|USE|CLASS|OPTIONS)$', 26 | relevance: 10 27 | }, 28 | { 29 | className: 'title', 30 | begin: '@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$' 31 | }, 32 | { 33 | className: 'variable', 34 | begin: '\\$\\{?[\\w\\-\\.\\:]+\\}?' 35 | }, 36 | { 37 | className: 'keyword', 38 | begin: '\\^[\\w\\-\\.\\:]+' 39 | }, 40 | { 41 | className: 'number', 42 | begin: '\\^#[0-9a-fA-F]+' 43 | }, 44 | hljs.C_NUMBER_MODE 45 | ] 46 | }; 47 | }; -------------------------------------------------------------------------------- /docs/js/languages/pf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var MACRO = { 3 | className: 'variable', 4 | begin: /\$[\w\d#@][\w\d_]*/ 5 | }; 6 | var TABLE = { 7 | className: 'variable', 8 | begin: /<(?!\/)/, end: />/ 9 | }; 10 | var QUOTE_STRING = { 11 | className: 'string', 12 | begin: /"/, end: /"/ 13 | }; 14 | 15 | return { 16 | aliases: ['pf.conf'], 17 | lexemes: /[a-z0-9_<>-]+/, 18 | keywords: { 19 | built_in: /* block match pass are "actions" in pf.conf(5), the rest are 20 | * lexically similar top-level commands. 21 | */ 22 | 'block match pass load anchor|5 antispoof|10 set table', 23 | keyword: 24 | 'in out log quick on rdomain inet inet6 proto from port os to route' + 25 | 'allow-opts divert-packet divert-reply divert-to flags group icmp-type' + 26 | 'icmp6-type label once probability recieved-on rtable prio queue' + 27 | 'tos tag tagged user keep fragment for os drop' + 28 | 'af-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robin' + 29 | 'source-hash static-port' + 30 | 'dup-to reply-to route-to' + 31 | 'parent bandwidth default min max qlimit' + 32 | 'block-policy debug fingerprints hostid limit loginterface optimization' + 33 | 'reassemble ruleset-optimization basic none profile skip state-defaults' + 34 | 'state-policy timeout' + 35 | 'const counters persist' + 36 | 'no modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppy' + 37 | 'source-track global rule max-src-nodes max-src-states max-src-conn' + 38 | 'max-src-conn-rate overload flush' + 39 | 'scrub|5 max-mss min-ttl no-df|10 random-id', 40 | literal: 41 | 'all any no-route self urpf-failed egress|5 unknown' 42 | }, 43 | contains: [ 44 | hljs.HASH_COMMENT_MODE, 45 | hljs.NUMBER_MODE, 46 | hljs.QUOTE_STRING_MODE, 47 | MACRO, 48 | TABLE 49 | ] 50 | }; 51 | }; -------------------------------------------------------------------------------- /docs/js/languages/pony.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var KEYWORDS = { 3 | keyword: 4 | 'actor addressof and as be break class compile_error compile_intrinsic' + 5 | 'consume continue delegate digestof do else elseif embed end error' + 6 | 'for fun if ifdef in interface is isnt lambda let match new not object' + 7 | 'or primitive recover repeat return struct then trait try type until ' + 8 | 'use var where while with xor', 9 | meta: 10 | 'iso val tag trn box ref', 11 | literal: 12 | 'this false true' 13 | }; 14 | 15 | var TRIPLE_QUOTE_STRING_MODE = { 16 | className: 'string', 17 | begin: '"""', end: '"""', 18 | relevance: 10 19 | }; 20 | 21 | var QUOTE_STRING_MODE = { 22 | className: 'string', 23 | begin: '"', end: '"', 24 | contains: [hljs.BACKSLASH_ESCAPE] 25 | }; 26 | 27 | var SINGLE_QUOTE_CHAR_MODE = { 28 | className: 'string', 29 | begin: '\'', end: '\'', 30 | contains: [hljs.BACKSLASH_ESCAPE], 31 | relevance: 0 32 | }; 33 | 34 | var TYPE_NAME = { 35 | className: 'type', 36 | begin: '\\b_?[A-Z][\\w]*', 37 | relevance: 0 38 | }; 39 | 40 | var PRIMED_NAME = { 41 | begin: hljs.IDENT_RE + '\'', relevance: 0 42 | }; 43 | 44 | var CLASS = { 45 | className: 'class', 46 | beginKeywords: 'class actor', end: '$', 47 | contains: [ 48 | hljs.TITLE_MODE, 49 | hljs.C_LINE_COMMENT_MODE 50 | ] 51 | } 52 | 53 | var FUNCTION = { 54 | className: 'function', 55 | beginKeywords: 'new fun', end: '=>', 56 | contains: [ 57 | hljs.TITLE_MODE, 58 | { 59 | begin: /\(/, end: /\)/, 60 | contains: [ 61 | TYPE_NAME, 62 | PRIMED_NAME, 63 | hljs.C_NUMBER_MODE, 64 | hljs.C_BLOCK_COMMENT_MODE 65 | ] 66 | }, 67 | { 68 | begin: /:/, endsWithParent: true, 69 | contains: [TYPE_NAME] 70 | }, 71 | hljs.C_LINE_COMMENT_MODE 72 | ] 73 | } 74 | 75 | return { 76 | keywords: KEYWORDS, 77 | contains: [ 78 | CLASS, 79 | FUNCTION, 80 | TYPE_NAME, 81 | TRIPLE_QUOTE_STRING_MODE, 82 | QUOTE_STRING_MODE, 83 | SINGLE_QUOTE_CHAR_MODE, 84 | PRIMED_NAME, 85 | hljs.C_NUMBER_MODE, 86 | hljs.C_LINE_COMMENT_MODE, 87 | hljs.C_BLOCK_COMMENT_MODE 88 | ] 89 | }; 90 | }; -------------------------------------------------------------------------------- /docs/js/languages/profile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | contains: [ 4 | hljs.C_NUMBER_MODE, 5 | { 6 | begin: '[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}', end: ':', 7 | excludeEnd: true 8 | }, 9 | { 10 | begin: '(ncalls|tottime|cumtime)', end: '$', 11 | keywords: 'ncalls tottime|10 cumtime|10 filename', 12 | relevance: 10 13 | }, 14 | { 15 | begin: 'function calls', end: '$', 16 | contains: [hljs.C_NUMBER_MODE], 17 | relevance: 10 18 | }, 19 | hljs.APOS_STRING_MODE, 20 | hljs.QUOTE_STRING_MODE, 21 | { 22 | className: 'string', 23 | begin: '\\(', end: '\\)$', 24 | excludeBegin: true, excludeEnd: true, 25 | relevance: 0 26 | } 27 | ] 28 | }; 29 | }; -------------------------------------------------------------------------------- /docs/js/languages/prolog.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | 3 | var ATOM = { 4 | 5 | begin: /[a-z][A-Za-z0-9_]*/, 6 | relevance: 0 7 | }; 8 | 9 | var VAR = { 10 | 11 | className: 'symbol', 12 | variants: [ 13 | {begin: /[A-Z][a-zA-Z0-9_]*/}, 14 | {begin: /_[A-Za-z0-9_]*/}, 15 | ], 16 | relevance: 0 17 | }; 18 | 19 | var PARENTED = { 20 | 21 | begin: /\(/, 22 | end: /\)/, 23 | relevance: 0 24 | }; 25 | 26 | var LIST = { 27 | 28 | begin: /\[/, 29 | end: /\]/ 30 | }; 31 | 32 | var LINE_COMMENT = { 33 | 34 | className: 'comment', 35 | begin: /%/, end: /$/, 36 | contains: [hljs.PHRASAL_WORDS_MODE] 37 | }; 38 | 39 | var BACKTICK_STRING = { 40 | 41 | className: 'string', 42 | begin: /`/, end: /`/, 43 | contains: [hljs.BACKSLASH_ESCAPE] 44 | }; 45 | 46 | var CHAR_CODE = { 47 | 48 | className: 'string', // 0'a etc. 49 | begin: /0\'(\\\'|.)/ 50 | }; 51 | 52 | var SPACE_CODE = { 53 | 54 | className: 'string', 55 | begin: /0\'\\s/ // 0'\s 56 | }; 57 | 58 | var PRED_OP = { // relevance booster 59 | begin: /:-/ 60 | }; 61 | 62 | var inner = [ 63 | 64 | ATOM, 65 | VAR, 66 | PARENTED, 67 | PRED_OP, 68 | LIST, 69 | LINE_COMMENT, 70 | hljs.C_BLOCK_COMMENT_MODE, 71 | hljs.QUOTE_STRING_MODE, 72 | hljs.APOS_STRING_MODE, 73 | BACKTICK_STRING, 74 | CHAR_CODE, 75 | SPACE_CODE, 76 | hljs.C_NUMBER_MODE 77 | ]; 78 | 79 | PARENTED.contains = inner; 80 | LIST.contains = inner; 81 | 82 | return { 83 | contains: inner.concat([ 84 | {begin: /\.$/} // relevance booster 85 | ]) 86 | }; 87 | }; -------------------------------------------------------------------------------- /docs/js/languages/protobuf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | keywords: { 4 | keyword: 'package import option optional required repeated group', 5 | built_in: 'double float int32 int64 uint32 uint64 sint32 sint64 ' + 6 | 'fixed32 fixed64 sfixed32 sfixed64 bool string bytes', 7 | literal: 'true false' 8 | }, 9 | contains: [ 10 | hljs.QUOTE_STRING_MODE, 11 | hljs.NUMBER_MODE, 12 | hljs.C_LINE_COMMENT_MODE, 13 | { 14 | className: 'class', 15 | beginKeywords: 'message enum service', end: /\{/, 16 | illegal: /\n/, 17 | contains: [ 18 | hljs.inherit(hljs.TITLE_MODE, { 19 | starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title 20 | }) 21 | ] 22 | }, 23 | { 24 | className: 'function', 25 | beginKeywords: 'rpc', 26 | end: /;/, excludeEnd: true, 27 | keywords: 'rpc returns' 28 | }, 29 | { 30 | begin: /^\s*[A-Z_]+/, 31 | end: /\s*=/, excludeEnd: true 32 | } 33 | ] 34 | }; 35 | }; -------------------------------------------------------------------------------- /docs/js/languages/purebasic.js: -------------------------------------------------------------------------------- 1 | module.exports = // Base deafult colors in PB IDE: background: #FFFFDF; foreground: #000000; 2 | 3 | function(hljs) { 4 | var STRINGS = { // PB IDE color: #0080FF (Azure Radiance) 5 | className: 'string', 6 | begin: '(~)?"', end: '"', 7 | illegal: '\\n' 8 | }; 9 | var CONSTANTS = { // PB IDE color: #924B72 (Cannon Pink) 10 | // "#" + a letter or underscore + letters, digits or underscores + (optional) "$" 11 | className: 'symbol', 12 | begin: '#[a-zA-Z_]\\w*\\$?' 13 | }; 14 | 15 | return { 16 | aliases: ['pb', 'pbi'], 17 | keywords: // PB IDE color: #006666 (Blue Stone) + Bold 18 | // The following keywords list was taken and adapted from GuShH's PureBasic language file for GeSHi... 19 | 'And As Break CallDebugger Case CompilerCase CompilerDefault CompilerElse CompilerEndIf CompilerEndSelect ' + 20 | 'CompilerError CompilerIf CompilerSelect Continue Data DataSection EndDataSection Debug DebugLevel ' + 21 | 'Default Define Dim DisableASM DisableDebugger DisableExplicit Else ElseIf EnableASM ' + 22 | 'EnableDebugger EnableExplicit End EndEnumeration EndIf EndImport EndInterface EndMacro EndProcedure ' + 23 | 'EndSelect EndStructure EndStructureUnion EndWith Enumeration Extends FakeReturn For Next ForEach ' + 24 | 'ForEver Global Gosub Goto If Import ImportC IncludeBinary IncludeFile IncludePath Interface Macro ' + 25 | 'NewList Not Or ProcedureReturn Protected Prototype ' + 26 | 'PrototypeC Read ReDim Repeat Until Restore Return Select Shared Static Step Structure StructureUnion ' + 27 | 'Swap To Wend While With XIncludeFile XOr ' + 28 | 'Procedure ProcedureC ProcedureCDLL ProcedureDLL Declare DeclareC DeclareCDLL DeclareDLL', 29 | contains: [ 30 | // COMMENTS | PB IDE color: #00AAAA (Persian Green) 31 | hljs.COMMENT(';', '$', {relevance: 0}), 32 | 33 | { // PROCEDURES DEFINITIONS 34 | className: 'function', 35 | begin: '\\b(Procedure|Declare)(C|CDLL|DLL)?\\b', 36 | end: '\\(', 37 | excludeEnd: true, 38 | returnBegin: true, 39 | contains: [ 40 | { // PROCEDURE KEYWORDS | PB IDE color: #006666 (Blue Stone) + Bold 41 | className: 'keyword', 42 | begin: '(Procedure|Declare)(C|CDLL|DLL)?', 43 | excludeEnd: true 44 | }, 45 | { // PROCEDURE RETURN TYPE SETTING | PB IDE color: #000000 (Black) 46 | className: 'type', 47 | begin: '\\.\\w*' 48 | // end: ' ', 49 | }, 50 | hljs.UNDERSCORE_TITLE_MODE // PROCEDURE NAME | PB IDE color: #006666 (Blue Stone) 51 | ] 52 | }, 53 | STRINGS, 54 | CONSTANTS 55 | ] 56 | }; 57 | }; -------------------------------------------------------------------------------- /docs/js/languages/q.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var Q_KEYWORDS = { 3 | keyword: 4 | 'do while select delete by update from', 5 | literal: 6 | '0b 1b', 7 | built_in: 8 | 'neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum', 9 | type: 10 | '`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid' 11 | }; 12 | return { 13 | aliases:['k', 'kdb'], 14 | keywords: Q_KEYWORDS, 15 | lexemes: /(`?)[A-Za-z0-9_]+\b/, 16 | contains: [ 17 | hljs.C_LINE_COMMENT_MODE, 18 | hljs.QUOTE_STRING_MODE, 19 | hljs.C_NUMBER_MODE 20 | ] 21 | }; 22 | }; -------------------------------------------------------------------------------- /docs/js/languages/r.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var IDENT_RE = '([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*'; 3 | 4 | return { 5 | contains: [ 6 | hljs.HASH_COMMENT_MODE, 7 | { 8 | begin: IDENT_RE, 9 | lexemes: IDENT_RE, 10 | keywords: { 11 | keyword: 12 | 'function if in break next repeat else for return switch while try tryCatch ' + 13 | 'stop warning require library attach detach source setMethod setGeneric ' + 14 | 'setGroupGeneric setClass ...', 15 | literal: 16 | 'NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 ' + 17 | 'NA_complex_|10' 18 | }, 19 | relevance: 0 20 | }, 21 | { 22 | // hex value 23 | className: 'number', 24 | begin: "0[xX][0-9a-fA-F]+[Li]?\\b", 25 | relevance: 0 26 | }, 27 | { 28 | // explicit integer 29 | className: 'number', 30 | begin: "\\d+(?:[eE][+\\-]?\\d*)?L\\b", 31 | relevance: 0 32 | }, 33 | { 34 | // number with trailing decimal 35 | className: 'number', 36 | begin: "\\d+\\.(?!\\d)(?:i\\b)?", 37 | relevance: 0 38 | }, 39 | { 40 | // number 41 | className: 'number', 42 | begin: "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b", 43 | relevance: 0 44 | }, 45 | { 46 | // number with leading decimal 47 | className: 'number', 48 | begin: "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b", 49 | relevance: 0 50 | }, 51 | 52 | { 53 | // escaped identifier 54 | begin: '`', 55 | end: '`', 56 | relevance: 0 57 | }, 58 | 59 | { 60 | className: 'string', 61 | contains: [hljs.BACKSLASH_ESCAPE], 62 | variants: [ 63 | {begin: '"', end: '"'}, 64 | {begin: "'", end: "'"} 65 | ] 66 | } 67 | ] 68 | }; 69 | }; -------------------------------------------------------------------------------- /docs/js/languages/rib.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | keywords: 4 | 'ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis ' + 5 | 'Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone ' + 6 | 'CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail ' + 7 | 'DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format ' + 8 | 'FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry ' + 9 | 'Hider Hyperboloid Identity Illuminate Imager Interior LightSource ' + 10 | 'MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte ' + 11 | 'MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option ' + 12 | 'Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples ' + 13 | 'PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection ' + 14 | 'Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ' + 15 | 'ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere ' + 16 | 'SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd ' + 17 | 'TransformPoints Translate TrimCurve WorldBegin WorldEnd', 18 | illegal: '%$#]', 8 | starts: { 9 | end: '$', subLanguage: 'bash' 10 | } 11 | }, 12 | ] 13 | } 14 | }; -------------------------------------------------------------------------------- /docs/js/languages/smali.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var smali_instr_low_prio = ['add', 'and', 'cmp', 'cmpg', 'cmpl', 'const', 'div', 'double', 'float', 'goto', 'if', 'int', 'long', 'move', 'mul', 'neg', 'new', 'nop', 'not', 'or', 'rem', 'return', 'shl', 'shr', 'sput', 'sub', 'throw', 'ushr', 'xor']; 3 | var smali_instr_high_prio = ['aget', 'aput', 'array', 'check', 'execute', 'fill', 'filled', 'goto/16', 'goto/32', 'iget', 'instance', 'invoke', 'iput', 'monitor', 'packed', 'sget', 'sparse']; 4 | var smali_keywords = ['transient', 'constructor', 'abstract', 'final', 'synthetic', 'public', 'private', 'protected', 'static', 'bridge', 'system']; 5 | return { 6 | aliases: ['smali'], 7 | contains: [ 8 | { 9 | className: 'string', 10 | begin: '"', end: '"', 11 | relevance: 0 12 | }, 13 | hljs.COMMENT( 14 | '#', 15 | '$', 16 | { 17 | relevance: 0 18 | } 19 | ), 20 | { 21 | className: 'keyword', 22 | variants: [ 23 | {begin: '\\s*\\.end\\s[a-zA-Z0-9]*'}, 24 | {begin: '^[ ]*\\.[a-zA-Z]*', relevance: 0}, 25 | {begin: '\\s:[a-zA-Z_0-9]*', relevance: 0}, 26 | {begin: '\\s(' + smali_keywords.join('|') + ')'} 27 | ] 28 | }, 29 | { 30 | className: 'built_in', 31 | variants : [ 32 | { 33 | begin: '\\s('+smali_instr_low_prio.join('|')+')\\s' 34 | }, 35 | { 36 | begin: '\\s('+smali_instr_low_prio.join('|')+')((\\-|/)[a-zA-Z0-9]+)+\\s', 37 | relevance: 10 38 | }, 39 | { 40 | begin: '\\s('+smali_instr_high_prio.join('|')+')((\\-|/)[a-zA-Z0-9]+)*\\s', 41 | relevance: 10 42 | }, 43 | ] 44 | }, 45 | { 46 | className: 'class', 47 | begin: 'L[^\(;:\n]*;', 48 | relevance: 0 49 | }, 50 | { 51 | begin: '[vp][0-9]+', 52 | } 53 | ] 54 | }; 55 | }; -------------------------------------------------------------------------------- /docs/js/languages/smalltalk.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*'; 3 | var CHAR = { 4 | className: 'string', 5 | begin: '\\$.{1}' 6 | }; 7 | var SYMBOL = { 8 | className: 'symbol', 9 | begin: '#' + hljs.UNDERSCORE_IDENT_RE 10 | }; 11 | return { 12 | aliases: ['st'], 13 | keywords: 'self super nil true false thisContext', // only 6 14 | contains: [ 15 | hljs.COMMENT('"', '"'), 16 | hljs.APOS_STRING_MODE, 17 | { 18 | className: 'type', 19 | begin: '\\b[A-Z][A-Za-z0-9_]*', 20 | relevance: 0 21 | }, 22 | { 23 | begin: VAR_IDENT_RE + ':', 24 | relevance: 0 25 | }, 26 | hljs.C_NUMBER_MODE, 27 | SYMBOL, 28 | CHAR, 29 | { 30 | // This looks more complicated than needed to avoid combinatorial 31 | // explosion under V8. It effectively means `| var1 var2 ... |` with 32 | // whitespace adjacent to `|` being optional. 33 | begin: '\\|[ ]*' + VAR_IDENT_RE + '([ ]+' + VAR_IDENT_RE + ')*[ ]*\\|', 34 | returnBegin: true, end: /\|/, 35 | illegal: /\S/, 36 | contains: [{begin: '(\\|[ ]*)?' + VAR_IDENT_RE}] 37 | }, 38 | { 39 | begin: '\\#\\(', end: '\\)', 40 | contains: [ 41 | hljs.APOS_STRING_MODE, 42 | CHAR, 43 | hljs.C_NUMBER_MODE, 44 | SYMBOL 45 | ] 46 | } 47 | ] 48 | }; 49 | }; -------------------------------------------------------------------------------- /docs/js/languages/sml.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['ml'], 4 | keywords: { 5 | keyword: 6 | /* according to Definition of Standard ML 97 */ 7 | 'abstype and andalso as case datatype do else end eqtype ' + 8 | 'exception fn fun functor handle if in include infix infixr ' + 9 | 'let local nonfix of op open orelse raise rec sharing sig ' + 10 | 'signature struct structure then type val with withtype where while', 11 | built_in: 12 | /* built-in types according to basis library */ 13 | 'array bool char exn int list option order real ref string substring vector unit word', 14 | literal: 15 | 'true false NONE SOME LESS EQUAL GREATER nil' 16 | }, 17 | illegal: /\/\/|>>/, 18 | lexemes: '[a-z_]\\w*!?', 19 | contains: [ 20 | { 21 | className: 'literal', 22 | begin: /\[(\|\|)?\]|\(\)/, 23 | relevance: 0 24 | }, 25 | hljs.COMMENT( 26 | '\\(\\*', 27 | '\\*\\)', 28 | { 29 | contains: ['self'] 30 | } 31 | ), 32 | { /* type variable */ 33 | className: 'symbol', 34 | begin: '\'[A-Za-z_](?!\')[\\w\']*' 35 | /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */ 36 | }, 37 | { /* polymorphic variant */ 38 | className: 'type', 39 | begin: '`[A-Z][\\w\']*' 40 | }, 41 | { /* module or constructor */ 42 | className: 'type', 43 | begin: '\\b[A-Z][\\w\']*', 44 | relevance: 0 45 | }, 46 | { /* don't color identifiers, but safely catch all identifiers with '*/ 47 | begin: '[a-z_]\\w*\'[\\w\']*' 48 | }, 49 | hljs.inherit(hljs.APOS_STRING_MODE, {className: 'string', relevance: 0}), 50 | hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}), 51 | { 52 | className: 'number', 53 | begin: 54 | '\\b(0[xX][a-fA-F0-9_]+[Lln]?|' + 55 | '0[oO][0-7_]+[Lln]?|' + 56 | '0[bB][01_]+[Lln]?|' + 57 | '[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)', 58 | relevance: 0 59 | }, 60 | { 61 | begin: /[-=]>/ // relevance booster 62 | } 63 | ] 64 | }; 65 | }; -------------------------------------------------------------------------------- /docs/js/languages/step21.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var STEP21_IDENT_RE = '[A-Z_][A-Z0-9_.]*'; 3 | var STEP21_KEYWORDS = { 4 | keyword: 'HEADER ENDSEC DATA' 5 | }; 6 | var STEP21_START = { 7 | className: 'meta', 8 | begin: 'ISO-10303-21;', 9 | relevance: 10 10 | }; 11 | var STEP21_CLOSE = { 12 | className: 'meta', 13 | begin: 'END-ISO-10303-21;', 14 | relevance: 10 15 | }; 16 | 17 | return { 18 | aliases: ['p21', 'step', 'stp'], 19 | case_insensitive: true, // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized. 20 | lexemes: STEP21_IDENT_RE, 21 | keywords: STEP21_KEYWORDS, 22 | contains: [ 23 | STEP21_START, 24 | STEP21_CLOSE, 25 | hljs.C_LINE_COMMENT_MODE, 26 | hljs.C_BLOCK_COMMENT_MODE, 27 | hljs.COMMENT('/\\*\\*!', '\\*/'), 28 | hljs.C_NUMBER_MODE, 29 | hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}), 30 | hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}), 31 | { 32 | className: 'string', 33 | begin: "'", end: "'" 34 | }, 35 | { 36 | className: 'symbol', 37 | variants: [ 38 | { 39 | begin: '#', end: '\\d+', 40 | illegal: '\\W' 41 | } 42 | ] 43 | } 44 | ] 45 | }; 46 | }; -------------------------------------------------------------------------------- /docs/js/languages/subunit.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var DETAILS = { 3 | className: 'string', 4 | begin: '\\[\n(multipart)?', end: '\\]\n' 5 | }; 6 | var TIME = { 7 | className: 'string', 8 | begin: '\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}\.\\d+Z' 9 | }; 10 | var PROGRESSVALUE = { 11 | className: 'string', 12 | begin: '(\\+|-)\\d+' 13 | }; 14 | var KEYWORDS = { 15 | className: 'keyword', 16 | relevance: 10, 17 | variants: [ 18 | { begin: '^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?' }, 19 | { begin: '^progress(:?)(\\s+)?(pop|push)?' }, 20 | { begin: '^tags:' }, 21 | { begin: '^time:' } 22 | ], 23 | }; 24 | return { 25 | case_insensitive: true, 26 | contains: [ 27 | DETAILS, 28 | TIME, 29 | PROGRESSVALUE, 30 | KEYWORDS 31 | ] 32 | }; 33 | }; -------------------------------------------------------------------------------- /docs/js/languages/taggerscript.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | 3 | var COMMENT = { 4 | className: 'comment', 5 | begin: /\$noop\(/, 6 | end: /\)/, 7 | contains: [{ 8 | begin: /\(/, 9 | end: /\)/, 10 | contains: ['self', { 11 | begin: /\\./ 12 | }] 13 | }], 14 | relevance: 10 15 | }; 16 | 17 | var FUNCTION = { 18 | className: 'keyword', 19 | begin: /\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*/, 20 | end: /\(/, 21 | excludeEnd: true 22 | }; 23 | 24 | var VARIABLE = { 25 | className: 'variable', 26 | begin: /%[_a-zA-Z0-9:]*/, 27 | end: '%' 28 | }; 29 | 30 | var ESCAPE_SEQUENCE = { 31 | className: 'symbol', 32 | begin: /\\./ 33 | }; 34 | 35 | return { 36 | contains: [ 37 | COMMENT, 38 | FUNCTION, 39 | VARIABLE, 40 | ESCAPE_SEQUENCE 41 | ] 42 | }; 43 | }; -------------------------------------------------------------------------------- /docs/js/languages/tap.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | case_insensitive: true, 4 | contains: [ 5 | hljs.HASH_COMMENT_MODE, 6 | // version of format and total amount of testcases 7 | { 8 | className: 'meta', 9 | variants: [ 10 | { begin: '^TAP version (\\d+)$' }, 11 | { begin: '^1\\.\\.(\\d+)$' } 12 | ], 13 | }, 14 | // YAML block 15 | { 16 | begin: '(\s+)?---$', end: '\\.\\.\\.$', 17 | subLanguage: 'yaml', 18 | relevance: 0 19 | }, 20 | // testcase number 21 | { 22 | className: 'number', 23 | begin: ' (\\d+) ' 24 | }, 25 | // testcase status and description 26 | { 27 | className: 'symbol', 28 | variants: [ 29 | { begin: '^ok' }, 30 | { begin: '^not ok' } 31 | ], 32 | }, 33 | ] 34 | }; 35 | }; -------------------------------------------------------------------------------- /docs/js/languages/tcl.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['tk'], 4 | keywords: 'after append apply array auto_execok auto_import auto_load auto_mkindex ' + 5 | 'auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock ' + 6 | 'close concat continue dde dict encoding eof error eval exec exit expr fblocked ' + 7 | 'fconfigure fcopy file fileevent filename flush for foreach format gets glob global ' + 8 | 'history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list ' + 9 | 'llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 '+ 10 | 'mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex '+ 11 | 'platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename '+ 12 | 'return safe scan seek set socket source split string subst switch tcl_endOfWord '+ 13 | 'tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter '+ 14 | 'tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update '+ 15 | 'uplevel upvar variable vwait while', 16 | contains: [ 17 | hljs.COMMENT(';[ \\t]*#', '$'), 18 | hljs.COMMENT('^[ \\t]*#', '$'), 19 | { 20 | beginKeywords: 'proc', 21 | end: '[\\{]', 22 | excludeEnd: true, 23 | contains: [ 24 | { 25 | className: 'title', 26 | begin: '[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*', 27 | end: '[ \\t\\n\\r]', 28 | endsWithParent: true, 29 | excludeEnd: true 30 | } 31 | ] 32 | }, 33 | { 34 | excludeEnd: true, 35 | variants: [ 36 | { 37 | begin: '\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*\\(([a-zA-Z0-9_])*\\)', 38 | end: '[^a-zA-Z0-9_\\}\\$]' 39 | }, 40 | { 41 | begin: '\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*', 42 | end: '(\\))?[^a-zA-Z0-9_\\}\\$]' 43 | } 44 | ] 45 | }, 46 | { 47 | className: 'string', 48 | contains: [hljs.BACKSLASH_ESCAPE], 49 | variants: [ 50 | hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}), 51 | hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}) 52 | ] 53 | }, 54 | { 55 | className: 'number', 56 | variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE] 57 | } 58 | ] 59 | } 60 | }; -------------------------------------------------------------------------------- /docs/js/languages/tex.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var COMMAND = { 3 | className: 'tag', 4 | begin: /\\/, 5 | relevance: 0, 6 | contains: [ 7 | { 8 | className: 'name', 9 | variants: [ 10 | {begin: /[a-zA-Zа-яА-я]+[*]?/}, 11 | {begin: /[^a-zA-Zа-яА-я0-9]/} 12 | ], 13 | starts: { 14 | endsWithParent: true, 15 | relevance: 0, 16 | contains: [ 17 | { 18 | className: 'string', // because it looks like attributes in HTML tags 19 | variants: [ 20 | {begin: /\[/, end: /\]/}, 21 | {begin: /\{/, end: /\}/} 22 | ] 23 | }, 24 | { 25 | begin: /\s*=\s*/, endsWithParent: true, 26 | relevance: 0, 27 | contains: [ 28 | { 29 | className: 'number', 30 | begin: /-?\d*\.?\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?/ 31 | } 32 | ] 33 | } 34 | ] 35 | } 36 | } 37 | ] 38 | }; 39 | 40 | return { 41 | contains: [ 42 | COMMAND, 43 | { 44 | className: 'formula', 45 | contains: [COMMAND], 46 | relevance: 0, 47 | variants: [ 48 | {begin: /\$\$/, end: /\$\$/}, 49 | {begin: /\$/, end: /\$/} 50 | ] 51 | }, 52 | hljs.COMMENT( 53 | '%', 54 | '$', 55 | { 56 | relevance: 0 57 | } 58 | ) 59 | ] 60 | }; 61 | }; -------------------------------------------------------------------------------- /docs/js/languages/thrift.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var BUILT_IN_TYPES = 'bool byte i16 i32 i64 double string binary'; 3 | return { 4 | keywords: { 5 | keyword: 6 | 'namespace const typedef struct enum service exception void oneway set list map required optional', 7 | built_in: 8 | BUILT_IN_TYPES, 9 | literal: 10 | 'true false' 11 | }, 12 | contains: [ 13 | hljs.QUOTE_STRING_MODE, 14 | hljs.NUMBER_MODE, 15 | hljs.C_LINE_COMMENT_MODE, 16 | hljs.C_BLOCK_COMMENT_MODE, 17 | { 18 | className: 'class', 19 | beginKeywords: 'struct enum service exception', end: /\{/, 20 | illegal: /\n/, 21 | contains: [ 22 | hljs.inherit(hljs.TITLE_MODE, { 23 | starts: {endsWithParent: true, excludeEnd: true} // hack: eating everything after the first title 24 | }) 25 | ] 26 | }, 27 | { 28 | begin: '\\b(set|list|map)\\s*<', end: '>', 29 | keywords: BUILT_IN_TYPES, 30 | contains: ['self'] 31 | } 32 | ] 33 | }; 34 | }; -------------------------------------------------------------------------------- /docs/js/languages/tp.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var TPID = { 3 | className: 'number', 4 | begin: '[1-9][0-9]*', /* no leading zeros */ 5 | relevance: 0 6 | }; 7 | var TPLABEL = { 8 | className: 'symbol', 9 | begin: ':[^\\]]+' 10 | }; 11 | var TPDATA = { 12 | className: 'built_in', 13 | begin: '(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|\ 14 | TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[', end: '\\]', 15 | contains: [ 16 | 'self', 17 | TPID, 18 | TPLABEL 19 | ] 20 | }; 21 | var TPIO = { 22 | className: 'built_in', 23 | begin: '(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[', end: '\\]', 24 | contains: [ 25 | 'self', 26 | TPID, 27 | hljs.QUOTE_STRING_MODE, /* for pos section at bottom */ 28 | TPLABEL 29 | ] 30 | }; 31 | 32 | return { 33 | keywords: { 34 | keyword: 35 | 'ABORT ACC ADJUST AND AP_LD BREAK CALL CNT COL CONDITION CONFIG DA DB ' + 36 | 'DIV DETECT ELSE END ENDFOR ERR_NUM ERROR_PROG FINE FOR GP GUARD INC ' + 37 | 'IF JMP LINEAR_MAX_SPEED LOCK MOD MONITOR OFFSET Offset OR OVERRIDE ' + 38 | 'PAUSE PREG PTH RT_LD RUN SELECT SKIP Skip TA TB TO TOOL_OFFSET ' + 39 | 'Tool_Offset UF UT UFRAME_NUM UTOOL_NUM UNLOCK WAIT X Y Z W P R STRLEN ' + 40 | 'SUBSTR FINDSTR VOFFSET PROG ATTR MN POS', 41 | literal: 42 | 'ON OFF max_speed LPOS JPOS ENABLE DISABLE START STOP RESET' 43 | }, 44 | contains: [ 45 | TPDATA, 46 | TPIO, 47 | { 48 | className: 'keyword', 49 | begin: '/(PROG|ATTR|MN|POS|END)\\b' 50 | }, 51 | { 52 | /* this is for cases like ,CALL */ 53 | className: 'keyword', 54 | begin: '(CALL|RUN|POINT_LOGIC|LBL)\\b' 55 | }, 56 | { 57 | /* this is for cases like CNT100 where the default lexemes do not 58 | * separate the keyword and the number */ 59 | className: 'keyword', 60 | begin: '\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)' 61 | }, 62 | { 63 | /* to catch numbers that do not have a word boundary on the left */ 64 | className: 'number', 65 | begin: '\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b', 66 | relevance: 0 67 | }, 68 | hljs.COMMENT('//', '[;$]'), 69 | hljs.COMMENT('!', '[;$]'), 70 | hljs.COMMENT('--eg:', '$'), 71 | hljs.QUOTE_STRING_MODE, 72 | { 73 | className: 'string', 74 | begin: '\'', end: '\'' 75 | }, 76 | hljs.C_NUMBER_MODE, 77 | { 78 | className: 'variable', 79 | begin: '\\$[A-Za-z0-9_]+' 80 | } 81 | ] 82 | }; 83 | }; -------------------------------------------------------------------------------- /docs/js/languages/twig.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var PARAMS = { 3 | className: 'params', 4 | begin: '\\(', end: '\\)' 5 | }; 6 | 7 | var FUNCTION_NAMES = 'attribute block constant cycle date dump include ' + 8 | 'max min parent random range source template_from_string'; 9 | 10 | var FUNCTIONS = { 11 | beginKeywords: FUNCTION_NAMES, 12 | keywords: {name: FUNCTION_NAMES}, 13 | relevance: 0, 14 | contains: [ 15 | PARAMS 16 | ] 17 | }; 18 | 19 | var FILTER = { 20 | begin: /\|[A-Za-z_]+:?/, 21 | keywords: 22 | 'abs batch capitalize convert_encoding date date_modify default ' + 23 | 'escape first format join json_encode keys last length lower ' + 24 | 'merge nl2br number_format raw replace reverse round slice sort split ' + 25 | 'striptags title trim upper url_encode', 26 | contains: [ 27 | FUNCTIONS 28 | ] 29 | }; 30 | 31 | var TAGS = 'autoescape block do embed extends filter flush for ' + 32 | 'if import include macro sandbox set spaceless use verbatim'; 33 | 34 | TAGS = TAGS + ' ' + TAGS.split(' ').map(function(t){return 'end' + t}).join(' '); 35 | 36 | return { 37 | aliases: ['craftcms'], 38 | case_insensitive: true, 39 | subLanguage: 'xml', 40 | contains: [ 41 | hljs.COMMENT(/\{#/, /#}/), 42 | { 43 | className: 'template-tag', 44 | begin: /\{%/, end: /%}/, 45 | contains: [ 46 | { 47 | className: 'name', 48 | begin: /\w+/, 49 | keywords: TAGS, 50 | starts: { 51 | endsWithParent: true, 52 | contains: [FILTER, FUNCTIONS], 53 | relevance: 0 54 | } 55 | } 56 | ] 57 | }, 58 | { 59 | className: 'template-variable', 60 | begin: /\{\{/, end: /}}/, 61 | contains: ['self', FILTER, FUNCTIONS] 62 | } 63 | ] 64 | }; 65 | }; -------------------------------------------------------------------------------- /docs/js/languages/vala.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | keywords: { 4 | keyword: 5 | // Value types 6 | 'char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 ' + 7 | 'uint16 uint32 uint64 float double bool struct enum string void ' + 8 | // Reference types 9 | 'weak unowned owned ' + 10 | // Modifiers 11 | 'async signal static abstract interface override virtual delegate ' + 12 | // Control Structures 13 | 'if while do for foreach else switch case break default return try catch ' + 14 | // Visibility 15 | 'public private protected internal ' + 16 | // Other 17 | 'using new this get set const stdout stdin stderr var', 18 | built_in: 19 | 'DBus GLib CCode Gee Object Gtk Posix', 20 | literal: 21 | 'false true null' 22 | }, 23 | contains: [ 24 | { 25 | className: 'class', 26 | beginKeywords: 'class interface namespace', end: '{', excludeEnd: true, 27 | illegal: '[^,:\\n\\s\\.]', 28 | contains: [ 29 | hljs.UNDERSCORE_TITLE_MODE 30 | ] 31 | }, 32 | hljs.C_LINE_COMMENT_MODE, 33 | hljs.C_BLOCK_COMMENT_MODE, 34 | { 35 | className: 'string', 36 | begin: '"""', end: '"""', 37 | relevance: 5 38 | }, 39 | hljs.APOS_STRING_MODE, 40 | hljs.QUOTE_STRING_MODE, 41 | hljs.C_NUMBER_MODE, 42 | { 43 | className: 'meta', 44 | begin: '^#', end: '$', 45 | relevance: 2 46 | } 47 | ] 48 | }; 49 | }; -------------------------------------------------------------------------------- /docs/js/languages/vbnet.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['vb'], 4 | case_insensitive: true, 5 | keywords: { 6 | keyword: 7 | 'addhandler addressof alias and andalso aggregate ansi as assembly auto binary by byref byval ' + /* a-b */ 8 | 'call case catch class compare const continue custom declare default delegate dim distinct do ' + /* c-d */ 9 | 'each equals else elseif end enum erase error event exit explicit finally for friend from function ' + /* e-f */ 10 | 'get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue ' + /* g-i */ 11 | 'join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass ' + /* j-m */ 12 | 'namespace narrowing new next not notinheritable notoverridable ' + /* n */ 13 | 'of off on operator option optional or order orelse overloads overridable overrides ' + /* o */ 14 | 'paramarray partial preserve private property protected public ' + /* p */ 15 | 'raiseevent readonly redim rem removehandler resume return ' + /* r */ 16 | 'select set shadows shared skip static step stop structure strict sub synclock ' + /* s */ 17 | 'take text then throw to try unicode until using when where while widening with withevents writeonly xor', /* t-x */ 18 | built_in: 19 | 'boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype ' + /* b-c */ 20 | 'date decimal directcast double gettype getxmlnamespace iif integer long object ' + /* d-o */ 21 | 'sbyte short single string trycast typeof uinteger ulong ushort', /* s-u */ 22 | literal: 23 | 'true false nothing' 24 | }, 25 | illegal: '//|{|}|endif|gosub|variant|wend', /* reserved deprecated keywords */ 26 | contains: [ 27 | hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [{begin: '""'}]}), 28 | hljs.COMMENT( 29 | '\'', 30 | '$', 31 | { 32 | returnBegin: true, 33 | contains: [ 34 | { 35 | className: 'doctag', 36 | begin: '\'\'\'|', 37 | contains: [hljs.PHRASAL_WORDS_MODE] 38 | }, 39 | { 40 | className: 'doctag', 41 | begin: '', 42 | contains: [hljs.PHRASAL_WORDS_MODE] 43 | } 44 | ] 45 | } 46 | ), 47 | hljs.C_NUMBER_MODE, 48 | { 49 | className: 'meta', 50 | begin: '#', end: '$', 51 | keywords: {'meta-keyword': 'if else elseif end region externalsource'} 52 | } 53 | ] 54 | }; 55 | }; -------------------------------------------------------------------------------- /docs/js/languages/vbscript-html.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | subLanguage: 'xml', 4 | contains: [ 5 | { 6 | begin: '<%', end: '%>', 7 | subLanguage: 'vbscript' 8 | } 9 | ] 10 | }; 11 | }; -------------------------------------------------------------------------------- /docs/js/languages/vbscript.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | return { 3 | aliases: ['vbs'], 4 | case_insensitive: true, 5 | keywords: { 6 | keyword: 7 | 'call class const dim do loop erase execute executeglobal exit for each next function ' + 8 | 'if then else on error option explicit new private property let get public randomize ' + 9 | 'redim rem select case set stop sub while wend with end to elseif is or xor and not ' + 10 | 'class_initialize class_terminate default preserve in me byval byref step resume goto', 11 | built_in: 12 | 'lcase month vartype instrrev ubound setlocale getobject rgb getref string ' + 13 | 'weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency ' + 14 | 'conversions csng timevalue second year space abs clng timeserial fixs len asc ' + 15 | 'isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate ' + 16 | 'instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex ' + 17 | 'chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim ' + 18 | 'strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion ' + 19 | 'scriptengine split scriptengineminorversion cint sin datepart ltrim sqr ' + 20 | 'scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw ' + 21 | 'chrw regexp server response request cstr err', 22 | literal: 23 | 'true false null nothing empty' 24 | }, 25 | illegal: '//', 26 | contains: [ 27 | hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [{begin: '""'}]}), 28 | hljs.COMMENT( 29 | /'/, 30 | /$/, 31 | { 32 | relevance: 0 33 | } 34 | ), 35 | hljs.C_NUMBER_MODE 36 | ] 37 | }; 38 | }; -------------------------------------------------------------------------------- /docs/js/languages/vhdl.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | // Regular expression for VHDL numeric literals. 3 | 4 | // Decimal literal: 5 | var INTEGER_RE = '\\d(_|\\d)*'; 6 | var EXPONENT_RE = '[eE][-+]?' + INTEGER_RE; 7 | var DECIMAL_LITERAL_RE = INTEGER_RE + '(\\.' + INTEGER_RE + ')?' + '(' + EXPONENT_RE + ')?'; 8 | // Based literal: 9 | var BASED_INTEGER_RE = '\\w+'; 10 | var BASED_LITERAL_RE = INTEGER_RE + '#' + BASED_INTEGER_RE + '(\\.' + BASED_INTEGER_RE + ')?' + '#' + '(' + EXPONENT_RE + ')?'; 11 | 12 | var NUMBER_RE = '\\b(' + BASED_LITERAL_RE + '|' + DECIMAL_LITERAL_RE + ')'; 13 | 14 | return { 15 | case_insensitive: true, 16 | keywords: { 17 | keyword: 18 | 'abs access after alias all and architecture array assert assume assume_guarantee attribute ' + 19 | 'begin block body buffer bus case component configuration constant context cover disconnect ' + 20 | 'downto default else elsif end entity exit fairness file for force function generate ' + 21 | 'generic group guarded if impure in inertial inout is label library linkage literal ' + 22 | 'loop map mod nand new next nor not null of on open or others out package port ' + 23 | 'postponed procedure process property protected pure range record register reject ' + 24 | 'release rem report restrict restrict_guarantee return rol ror select sequence ' + 25 | 'severity shared signal sla sll sra srl strong subtype then to transport type ' + 26 | 'unaffected units until use variable vmode vprop vunit wait when while with xnor xor', 27 | built_in: 28 | 'boolean bit character ' + 29 | 'integer time delay_length natural positive ' + 30 | 'string bit_vector file_open_kind file_open_status ' + 31 | 'std_logic std_logic_vector unsigned signed boolean_vector integer_vector ' + 32 | 'std_ulogic std_ulogic_vector unresolved_unsigned u_unsigned unresolved_signed u_signed' + 33 | 'real_vector time_vector', 34 | literal: 35 | 'false true note warning error failure ' + // severity_level 36 | 'line text side width' // textio 37 | }, 38 | illegal: '{', 39 | contains: [ 40 | hljs.C_BLOCK_COMMENT_MODE, // VHDL-2008 block commenting. 41 | hljs.COMMENT('--', '$'), 42 | hljs.QUOTE_STRING_MODE, 43 | { 44 | className: 'number', 45 | begin: NUMBER_RE, 46 | relevance: 0 47 | }, 48 | { 49 | className: 'string', 50 | begin: '\'(U|X|0|1|Z|W|L|H|-)\'', 51 | contains: [hljs.BACKSLASH_ESCAPE] 52 | }, 53 | { 54 | className: 'symbol', 55 | begin: '\'[A-Za-z](_?[A-Za-z0-9])*', 56 | contains: [hljs.BACKSLASH_ESCAPE] 57 | } 58 | ] 59 | }; 60 | }; -------------------------------------------------------------------------------- /docs/js/languages/xl.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var BUILTIN_MODULES = 3 | 'ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo ' + 4 | 'StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts'; 5 | 6 | var XL_KEYWORDS = { 7 | keyword: 8 | 'if then else do while until for loop import with is as where when by data constant ' + 9 | 'integer real text name boolean symbol infix prefix postfix block tree', 10 | literal: 11 | 'true false nil', 12 | built_in: 13 | 'in mod rem and or xor not abs sign floor ceil sqrt sin cos tan asin ' + 14 | 'acos atan exp expm1 log log2 log10 log1p pi at text_length text_range ' + 15 | 'text_find text_replace contains page slide basic_slide title_slide ' + 16 | 'title subtitle fade_in fade_out fade_at clear_color color line_color ' + 17 | 'line_width texture_wrap texture_transform texture scale_?x scale_?y ' + 18 | 'scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y ' + 19 | 'rotate_?z? rectangle circle ellipse sphere path line_to move_to ' + 20 | 'quad_to curve_to theme background contents locally time mouse_?x ' + 21 | 'mouse_?y mouse_buttons ' + 22 | BUILTIN_MODULES 23 | }; 24 | 25 | var DOUBLE_QUOTE_TEXT = { 26 | className: 'string', 27 | begin: '"', end: '"', illegal: '\\n' 28 | }; 29 | var SINGLE_QUOTE_TEXT = { 30 | className: 'string', 31 | begin: '\'', end: '\'', illegal: '\\n' 32 | }; 33 | var LONG_TEXT = { 34 | className: 'string', 35 | begin: '<<', end: '>>' 36 | }; 37 | var BASED_NUMBER = { 38 | className: 'number', 39 | begin: '[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?' 40 | }; 41 | var IMPORT = { 42 | beginKeywords: 'import', end: '$', 43 | keywords: XL_KEYWORDS, 44 | contains: [DOUBLE_QUOTE_TEXT] 45 | }; 46 | var FUNCTION_DEFINITION = { 47 | className: 'function', 48 | begin: /[a-z][^\n]*->/, returnBegin: true, end: /->/, 49 | contains: [ 50 | hljs.inherit(hljs.TITLE_MODE, {starts: { 51 | endsWithParent: true, 52 | keywords: XL_KEYWORDS 53 | }}) 54 | ] 55 | }; 56 | return { 57 | aliases: ['tao'], 58 | lexemes: /[a-zA-Z][a-zA-Z0-9_?]*/, 59 | keywords: XL_KEYWORDS, 60 | contains: [ 61 | hljs.C_LINE_COMMENT_MODE, 62 | hljs.C_BLOCK_COMMENT_MODE, 63 | DOUBLE_QUOTE_TEXT, 64 | SINGLE_QUOTE_TEXT, 65 | LONG_TEXT, 66 | FUNCTION_DEFINITION, 67 | IMPORT, 68 | BASED_NUMBER, 69 | hljs.NUMBER_MODE 70 | ] 71 | }; 72 | }; -------------------------------------------------------------------------------- /docs/js/languages/xml.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+'; 3 | var TAG_INTERNALS = { 4 | endsWithParent: true, 5 | illegal: /`]+/} 24 | ] 25 | } 26 | ] 27 | } 28 | ] 29 | }; 30 | return { 31 | aliases: ['html', 'xhtml', 'rss', 'atom', 'xjb', 'xsd', 'xsl', 'plist'], 32 | case_insensitive: true, 33 | contains: [ 34 | { 35 | className: 'meta', 36 | begin: '', 37 | relevance: 10, 38 | contains: [{begin: '\\[', end: '\\]'}] 39 | }, 40 | hljs.COMMENT( 41 | '', 43 | { 44 | relevance: 10 45 | } 46 | ), 47 | { 48 | begin: '<\\!\\[CDATA\\[', end: '\\]\\]>', 49 | relevance: 10 50 | }, 51 | { 52 | begin: /<\?(php)?/, end: /\?>/, 53 | subLanguage: 'php', 54 | contains: [{begin: '/\\*', end: '\\*/', skip: true}] 55 | }, 56 | { 57 | className: 'tag', 58 | /* 59 | The lookahead pattern (?=...) ensures that 'begin' only matches 60 | '|$)', end: '>', 65 | keywords: {name: 'style'}, 66 | contains: [TAG_INTERNALS], 67 | starts: { 68 | end: '', returnEnd: true, 69 | subLanguage: ['css', 'xml'] 70 | } 71 | }, 72 | { 73 | className: 'tag', 74 | // See the comment in the