rhighlightjs 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/.document +5 -0
  2. data/.gitignore +7 -0
  3. data/LICENSE +20 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.rdoc +51 -0
  6. data/Rakefile +58 -0
  7. data/VERSION +1 -0
  8. data/assets/images/brown_papersq.png +0 -0
  9. data/assets/images/paperbg.gif +0 -0
  10. data/assets/images/school_book.png +0 -0
  11. data/assets/javascripts/highlight.js +570 -0
  12. data/assets/javascripts/highlight.pack.js +1 -0
  13. data/assets/javascripts/languages/1c.js +95 -0
  14. data/assets/javascripts/languages/apache.js +442 -0
  15. data/assets/javascripts/languages/avrasm.js +89 -0
  16. data/assets/javascripts/languages/axapta.js +52 -0
  17. data/assets/javascripts/languages/bash.js +81 -0
  18. data/assets/javascripts/languages/cpp.js +42 -0
  19. data/assets/javascripts/languages/cs.js +47 -0
  20. data/assets/javascripts/languages/css.js +81 -0
  21. data/assets/javascripts/languages/delphi.js +82 -0
  22. data/assets/javascripts/languages/diff.js +65 -0
  23. data/assets/javascripts/languages/django.js +61 -0
  24. data/assets/javascripts/languages/dos.js +33 -0
  25. data/assets/javascripts/languages/dynamic.js +460 -0
  26. data/assets/javascripts/languages/html-xml.js +140 -0
  27. data/assets/javascripts/languages/ini.js +40 -0
  28. data/assets/javascripts/languages/java.js +58 -0
  29. data/assets/javascripts/languages/javascript.js +50 -0
  30. data/assets/javascripts/languages/lisp.js +89 -0
  31. data/assets/javascripts/languages/mel.js +51 -0
  32. data/assets/javascripts/languages/parser3.js +54 -0
  33. data/assets/javascripts/languages/perl.js +152 -0
  34. data/assets/javascripts/languages/php.js +54 -0
  35. data/assets/javascripts/languages/profile.js +51 -0
  36. data/assets/javascripts/languages/python.js +75 -0
  37. data/assets/javascripts/languages/renderman.js +239 -0
  38. data/assets/javascripts/languages/ruby.js +176 -0
  39. data/assets/javascripts/languages/smalltalk.js +52 -0
  40. data/assets/javascripts/languages/sql.js +52 -0
  41. data/assets/javascripts/languages/static.js +223 -0
  42. data/assets/javascripts/languages/vbscript.js +27 -0
  43. data/assets/javascripts/languages/www.js +257 -0
  44. data/assets/javascripts/styleswitch.js +57 -0
  45. data/assets/stylesheets/ascetic.css +42 -0
  46. data/assets/stylesheets/brown_paper.css +104 -0
  47. data/assets/stylesheets/brown_papersq.png +0 -0
  48. data/assets/stylesheets/dark.css +101 -0
  49. data/assets/stylesheets/default.css +103 -0
  50. data/assets/stylesheets/far.css +113 -0
  51. data/assets/stylesheets/github.css +90 -0
  52. data/assets/stylesheets/idea.css +74 -0
  53. data/assets/stylesheets/ir_black.css +67 -0
  54. data/assets/stylesheets/magula.css +105 -0
  55. data/assets/stylesheets/notebook.css +106 -0
  56. data/assets/stylesheets/school_book.css +106 -0
  57. data/assets/stylesheets/school_book.png +0 -0
  58. data/assets/stylesheets/sunburst.css +112 -0
  59. data/assets/stylesheets/vs.css +68 -0
  60. data/assets/stylesheets/zenburn.css +113 -0
  61. data/assets/stylesheets/zenburn.css.txt +108 -0
  62. data/bin/rhighlightjs +6 -0
  63. data/init.rb +2 -0
  64. data/install.rb +3 -0
  65. data/lib/rhighlightjs.rb +28 -0
  66. data/rhighlightjs.gemspec +170 -0
  67. data/tasks/rhighlightjs_tasks.rake +18 -0
  68. data/test/rhighlightjs_test.rb +7 -0
  69. data/test/test_helper.rb +10 -0
  70. data/uninstall.rb +1 -0
  71. metadata +135 -0
@@ -0,0 +1,42 @@
1
+ /*
2
+ Language: C++
3
+ */
4
+
5
+ hljs.LANGUAGES.cpp = function(){
6
+ var CPP_KEYWORDS = {
7
+ 'keyword': {'false': 1, 'int': 1, 'float': 1, 'while': 1, 'private': 1, 'char': 1, 'catch': 1, 'export': 1, 'virtual': 1, 'operator': 2, 'sizeof': 2, 'dynamic_cast': 2, 'typedef': 2, 'const_cast': 2, 'const': 1, 'struct': 1, 'for': 1, 'static_cast': 2, 'union': 1, 'namespace': 1, 'unsigned': 1, 'long': 1, 'throw': 1, 'volatile': 2, 'static': 1, 'protected': 1, 'bool': 1, 'template': 1, 'mutable': 1, 'if': 1, 'public': 1, 'friend': 2, 'do': 1, 'return': 1, 'goto': 1, 'auto': 1, 'void': 2, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'extern': 1, 'using': 1, 'true': 1, 'class': 1, 'asm': 1, 'case': 1, 'typeid': 1, 'short': 1, 'reinterpret_cast': 2, 'default': 1, 'double': 1, 'register': 1, 'explicit': 1, 'signed': 1, 'typename': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'wchar_t': 1, 'inline': 1, 'delete': 1},
8
+ 'built_in': {'std': 1, 'string': 1, 'cin': 1, 'cout': 1, 'cerr': 1, 'clog': 1, 'stringstream': 1, 'istringstream': 1, 'ostringstream': 1, 'auto_ptr': 1, 'deque': 1, 'list': 1, 'queue': 1, 'stack': 1, 'vector': 1, 'map': 1, 'set': 1, 'bitset': 1, 'multiset': 1, 'multimap': 1}
9
+ };
10
+ return {
11
+ defaultMode: {
12
+ lexems: [hljs.UNDERSCORE_IDENT_RE],
13
+ illegal: '</',
14
+ contains: ['comment', 'string', 'number', 'preprocessor', 'stl_container'],
15
+ keywords: CPP_KEYWORDS
16
+ },
17
+ modes: [
18
+ hljs.C_LINE_COMMENT_MODE,
19
+ hljs.C_BLOCK_COMMENT_MODE,
20
+ hljs.C_NUMBER_MODE,
21
+ hljs.QUOTE_STRING_MODE,
22
+ hljs.BACKSLASH_ESCAPE,
23
+ {
24
+ className: 'string',
25
+ begin: '\'', end: '[^\\\\]\'',
26
+ illegal: '[^\\\\][^\']'
27
+ },
28
+ {
29
+ className: 'preprocessor',
30
+ begin: '#', end: '$'
31
+ },
32
+ {
33
+ className: 'stl_container',
34
+ begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap)\\s*<', end: '>',
35
+ contains: ['stl_container'],
36
+ lexems: [hljs.UNDERSCORE_IDENT_RE],
37
+ keywords: CPP_KEYWORDS,
38
+ relevance: 10
39
+ }
40
+ ]
41
+ };
42
+ }();
@@ -0,0 +1,47 @@
1
+ /*
2
+ Language: C#
3
+ Author: Jason Diamond <jason@diamond.name>
4
+ */
5
+
6
+ hljs.LANGUAGES.cs = {
7
+ defaultMode: {
8
+ lexems: [hljs.UNDERSCORE_IDENT_RE],
9
+ contains: ['comment', 'string', 'number'],
10
+ keywords: {
11
+ // Normal keywords.
12
+ 'abstract': 1, 'as': 1, 'base': 1, 'bool': 1, 'break': 1, 'byte': 1, 'case': 1, 'catch': 1, 'char': 1, 'checked': 1, 'class': 1, 'const': 1, 'continue': 1, 'decimal': 1, 'default': 1, 'delegate': 1, 'do': 1, 'do': 1, 'double': 1, 'else': 1, 'enum': 1, 'event': 1, 'explicit': 1, 'extern': 1, 'false': 1, 'finally': 1, 'fixed': 1, 'float': 1, 'for': 1, 'foreach': 1, 'goto': 1, 'if': 1, 'implicit': 1, 'in': 1, 'int': 1, 'interface': 1, 'internal': 1, 'is': 1, 'lock': 1, 'long': 1, 'namespace': 1, 'new': 1, 'null': 1, 'object': 1, 'operator': 1, 'out': 1, 'override': 1, 'params': 1, 'private': 1, 'protected': 1, 'public': 1, 'readonly': 1, 'ref': 1, 'return': 1, 'sbyte': 1, 'sealed': 1, 'short': 1, 'sizeof': 1, 'stackalloc': 1, 'static': 1, 'string': 1, 'struct': 1, 'switch': 1, 'this': 1, 'throw': 1, 'true': 1, 'try': 1, 'typeof': 1, 'uint': 1, 'ulong': 1, 'unchecked': 1, 'unsafe': 1, 'ushort': 1, 'using': 1, 'virtual': 1, 'volatile': 1, 'void': 1, 'while': 1,
13
+ // Contextual keywords.
14
+ 'ascending': 1, 'descending': 1, 'from': 1, 'get': 1, 'group': 1, 'into': 1, 'join': 1, 'let': 1, 'orderby': 1, 'partial': 1, 'select': 1, 'set': 1, 'value': 1, 'var': 1, 'where': 1, 'yield': 1
15
+ }
16
+ },
17
+ modes: [
18
+ {
19
+ className: 'comment',
20
+ begin: '///', end: '$', returnBegin: true,
21
+ contains: ['xmlDocTag']
22
+ },
23
+ {
24
+ className: 'xmlDocTag',
25
+ begin: '///|<!--|-->', end: '^'
26
+ },
27
+ {
28
+ className: 'xmlDocTag',
29
+ begin: '</?', end: '>'
30
+ },
31
+ {
32
+ className: 'string',
33
+ begin: '@"', end: '"',
34
+ contains: ['quoteQuote']
35
+ },
36
+ {
37
+ className: 'quoteQuote',
38
+ begin: '""', end: '^'
39
+ },
40
+ hljs.C_LINE_COMMENT_MODE,
41
+ hljs.C_BLOCK_COMMENT_MODE,
42
+ hljs.APOS_STRING_MODE,
43
+ hljs.QUOTE_STRING_MODE,
44
+ hljs.BACKSLASH_ESCAPE,
45
+ hljs.C_NUMBER_MODE
46
+ ]
47
+ };
@@ -0,0 +1,81 @@
1
+ /*
2
+ Language: CSS
3
+ Requires: html-xml.js
4
+ */
5
+
6
+ hljs.LANGUAGES.css = {
7
+ defaultMode: {
8
+ contains: ['at_rule', 'id', 'class', 'attr_selector', 'pseudo', 'rules', 'comment'],
9
+ keywords: hljs.HTML_TAGS,
10
+ lexems: [hljs.IDENT_RE],
11
+ illegal: '='
12
+ },
13
+ case_insensitive: true,
14
+ modes: [
15
+ {
16
+ className: 'at_rule',
17
+ begin: '@', end: '[{;]',
18
+ excludeEnd: true,
19
+ lexems: [hljs.IDENT_RE],
20
+ keywords: {'import': 1, 'page': 1, 'media': 1, 'charset': 1, 'font-face': 1},
21
+ contains: ['function', 'string', 'number', 'pseudo']
22
+ },
23
+ {
24
+ className: 'id',
25
+ begin: '\\#[A-Za-z0-9_-]+', end: '^'
26
+ },
27
+ {
28
+ className: 'class',
29
+ begin: '\\.[A-Za-z0-9_-]+', end: '^',
30
+ relevance: 0
31
+ },
32
+ {
33
+ className: 'attr_selector',
34
+ begin: '\\[', end: '\\]',
35
+ illegal: '$'
36
+ },
37
+ {
38
+ className: 'pseudo',
39
+ begin: ':(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\"\\\']+', end: '^'
40
+ },
41
+ {
42
+ className: 'rules',
43
+ begin: '{', end: '}',
44
+ contains: ['rule', 'comment'],
45
+ illegal: '[^\\s]'
46
+ },
47
+ {
48
+ className: 'rule',
49
+ begin: '[A-Z\\_\\.\\-]+\\s*:', end: ';', endsWithParent: true,
50
+ lexems: ['[A-Za-z-]+'],
51
+ keywords: {'play-during': 1, 'counter-reset': 1, 'counter-increment': 1, 'min-height': 1, 'quotes': 1, 'border-top': 1, 'pitch': 1, 'font': 1, 'pause': 1, 'list-style-image': 1, 'border-width': 1, 'cue': 1, 'outline-width': 1, 'border-left': 1, 'elevation': 1, 'richness': 1, 'speech-rate': 1, 'border-bottom': 1, 'border-spacing': 1, 'background': 1, 'list-style-type': 1, 'text-align': 1, 'page-break-inside': 1, 'orphans': 1, 'page-break-before': 1, 'text-transform': 1, 'line-height': 1, 'padding-left': 1, 'font-size': 1, 'right': 1, 'word-spacing': 1, 'padding-top': 1, 'outline-style': 1, 'bottom': 1, 'content': 1, 'border-right-style': 1, 'padding-right': 1, 'border-left-style': 1, 'voice-family': 1, 'background-color': 1, 'border-bottom-color': 1, 'outline-color': 1, 'unicode-bidi': 1, 'max-width': 1, 'font-family': 1, 'caption-side': 1, 'border-right-width': 1, 'pause-before': 1, 'border-top-style': 1, 'color': 1, 'border-collapse': 1, 'border-bottom-width': 1, 'float': 1, 'height': 1, 'max-height': 1, 'margin-right': 1, 'border-top-width': 1, 'speak': 1, 'speak-header': 1, 'top': 1, 'cue-before': 1, 'min-width': 1, 'width': 1, 'font-variant': 1, 'border-top-color': 1, 'background-position': 1, 'empty-cells': 1, 'direction': 1, 'border-right': 1, 'visibility': 1, 'padding': 1, 'border-style': 1, 'background-attachment': 1, 'overflow': 1, 'border-bottom-style': 1, 'cursor': 1, 'margin': 1, 'display': 1, 'border-left-width': 1, 'letter-spacing': 1, 'vertical-align': 1, 'clip': 1, 'border-color': 1, 'list-style': 1, 'padding-bottom': 1, 'pause-after': 1, 'speak-numeral': 1, 'margin-left': 1, 'widows': 1, 'border': 1, 'font-style': 1, 'border-left-color': 1, 'pitch-range': 1, 'background-repeat': 1, 'table-layout': 1, 'margin-bottom': 1, 'speak-punctuation': 1, 'font-weight': 1, 'border-right-color': 1, 'page-break-after': 1, 'position': 1, 'white-space': 1, 'text-indent': 1, 'background-image': 1, 'volume': 1, 'stress': 1, 'outline': 1, 'clear': 1, 'z-index': 1, 'text-decoration': 1, 'margin-top': 1, 'azimuth': 1, 'cue-after': 1, 'left': 1, 'list-style-position': 1},
52
+ contains: ['value']
53
+ },
54
+ hljs.C_BLOCK_COMMENT_MODE,
55
+ {
56
+ className: 'value',
57
+ begin: '^', endsWithParent: true, excludeEnd: true,
58
+ contains: ['function', 'number', 'hexcolor', 'string']
59
+ },
60
+ {
61
+ className: 'number',
62
+ begin: hljs.NUMBER_RE, end: '^'
63
+ },
64
+ {
65
+ className: 'hexcolor',
66
+ begin: '\\#[0-9A-F]+', end: '^'
67
+ },
68
+ {
69
+ className: 'function',
70
+ begin: hljs.IDENT_RE + '\\(', end: '\\)',
71
+ contains: ['params']
72
+ },
73
+ {
74
+ className: 'params',
75
+ begin: '^', endsWithParent: true, excludeEnd: true,
76
+ contains: ['number', 'string']
77
+ },
78
+ hljs.APOS_STRING_MODE,
79
+ hljs.QUOTE_STRING_MODE
80
+ ]
81
+ };
@@ -0,0 +1,82 @@
1
+ /*
2
+ Language: Delphi
3
+ */
4
+
5
+ hljs.LANGUAGES.delphi = function(){
6
+ var DELPHI_KEYWORDS = {'and': 1, 'safecall': 1, 'cdecl': 1, 'then': 1, 'string': 1, 'exports': 1, 'library': 1, 'not': 1, 'pascal': 1, 'set': 1, 'virtual': 1, 'file': 1, 'in': 1, 'array': 1, 'label': 1, 'packed': 1, 'end.': 1, 'index': 1, 'while': 1, 'const': 1, 'raise': 1, 'for': 1, 'to': 1, 'implementation': 1, 'with': 1, 'except': 1, 'overload': 1, 'destructor': 1, 'downto': 1, 'finally': 1, 'program': 1, 'exit': 1, 'unit': 1, 'inherited': 1, 'override': 1, 'if': 1, 'type': 1, 'until': 1, 'function': 1, 'do': 1, 'begin': 1, 'repeat': 1, 'goto': 1, 'nil': 1, 'far': 1, 'initialization': 1, 'object': 1, 'else': 1, 'var': 1, 'uses': 1, 'external': 1, 'resourcestring': 1, 'interface': 1, 'end': 1, 'finalization': 1, 'class': 1, 'asm': 1, 'mod': 1, 'case': 1, 'on': 1, 'shr': 1, 'shl': 1, 'of': 1, 'register': 1, 'xorwrite': 1, 'threadvar': 1, 'try': 1, 'record': 1, 'near': 1, 'stored': 1, 'constructor': 1, 'stdcall': 1, 'inline': 1, 'div': 1, 'out': 1, 'or': 1, 'procedure': 1};
7
+ var DELPHI_CLASS_KEYWORDS = {'safecall': 1, 'stdcall': 1, 'pascal': 1, 'stored': 1, 'const': 1, 'implementation': 1, 'finalization': 1, 'except': 1, 'to': 1, 'finally': 1, 'program': 1, 'inherited': 1, 'override': 1, 'then': 1, 'exports': 1, 'string': 1, 'read': 1, 'not': 1, 'mod': 1, 'shr': 1, 'try': 1, 'div': 1, 'shl': 1, 'set': 1, 'library': 1, 'message': 1, 'packed': 1, 'index': 1, 'for': 1, 'near': 1, 'overload': 1, 'label': 1, 'downto': 1, 'exit': 1, 'public': 1, 'goto': 1, 'interface': 1, 'asm': 1, 'on': 1, 'of': 1, 'constructor': 1, 'or': 1, 'private': 1, 'array': 1, 'unit': 1, 'raise': 1, 'destructor': 1, 'var': 1, 'type': 1, 'until': 1, 'function': 1, 'else': 1, 'external': 1, 'with': 1, 'case': 1, 'default': 1, 'record': 1, 'while': 1, 'protected': 1, 'property': 1, 'procedure': 1, 'published': 1, 'and': 1, 'cdecl': 1, 'do': 1, 'threadvar': 1, 'file': 1, 'in': 1, 'if': 1, 'end': 1, 'virtual': 1, 'write': 1, 'far': 1, 'out': 1, 'begin': 1, 'repeat': 1, 'nil': 1, 'initialization': 1, 'object': 1, 'uses': 1, 'resourcestring': 1, 'class': 1, 'register': 1, 'xorwrite': 1, 'inline': 1, 'static': 1};
8
+ return {
9
+ defaultMode: {
10
+ lexems: [hljs.IDENT_RE],
11
+ illegal: '("|\\$[G-Zg-z]|\\/\\*|</)',
12
+ contains: ['comment', 'string', 'number', 'function', 'class'],
13
+ keywords: DELPHI_KEYWORDS
14
+ },
15
+ case_insensitive: true,
16
+ modes: [
17
+ {
18
+ className: 'comment',
19
+ begin: '{', end: '}'
20
+ },
21
+ {
22
+ className: 'comment',
23
+ begin: '\\(\\*', end: '\\*\\)',
24
+ relevance: 10
25
+ },
26
+ hljs.C_LINE_COMMENT_MODE,
27
+ {
28
+ className: 'number',
29
+ begin: hljs.NUMBER_RE, end: '^',
30
+ relevance: 0
31
+ },
32
+ {
33
+ className: 'string',
34
+ begin: '\'', end: '\'',
35
+ contains: ['quote'],
36
+ relevance: 0
37
+ },
38
+ {
39
+ className: 'string',
40
+ begin: '(#\\d+)+', end: '^'
41
+ },
42
+ {
43
+ className: 'quote',
44
+ begin: '\'\'', end: '^', noMarkup: true
45
+ },
46
+ {
47
+ className: 'function',
48
+ begin: 'function\\b', end: '[:;]',
49
+ lexems: [hljs.IDENT_RE],
50
+ keywords: {'function': 1},
51
+ contains: ['title', 'params', 'comment'],
52
+ relevance: 0
53
+ },
54
+ {
55
+ className: 'function',
56
+ begin: '(procedure|constructor|destructor)\\b', end: ';',
57
+ lexems: [hljs.IDENT_RE],
58
+ keywords: {'constructor': 1, 'destructor': 1, 'procedure': 1},
59
+ contains: ['title', 'params', 'comment'],
60
+ relevance: 10
61
+ },
62
+ {
63
+ className: 'title',
64
+ begin: hljs.IDENT_RE, end: '^'
65
+ },
66
+ {
67
+ className: 'params',
68
+ begin: '\\(', end: '\\)',
69
+ lexems: [hljs.IDENT_RE],
70
+ keywords: DELPHI_KEYWORDS,
71
+ contains: ['string']
72
+ },
73
+ {
74
+ className: 'class',
75
+ begin: '=\\bclass\\b', end: 'end;',
76
+ lexems: [hljs.IDENT_RE],
77
+ keywords: DELPHI_CLASS_KEYWORDS,
78
+ contains: ['string', 'comment', 'function']
79
+ }
80
+ ]
81
+ };
82
+ }();
@@ -0,0 +1,65 @@
1
+ /*
2
+ Language: diff
3
+ Description: Unified and context diff
4
+ Author: Vasily Polovnyov <vast@whiteants.net>
5
+ */
6
+
7
+ hljs.LANGUAGES.diff = {
8
+ case_insensitive: true,
9
+ defaultMode: {
10
+ contains: ['chunk', 'header', 'addition', 'deletion', 'change']
11
+ },
12
+ modes: [
13
+ {
14
+ className: 'chunk',
15
+ begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$', end:'^',
16
+ relevance: 10
17
+ },
18
+ {
19
+ className: 'chunk',
20
+ begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$', end: '^',
21
+ relevance: 10
22
+ },
23
+ {
24
+ className: 'chunk',
25
+ begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$', end: '^',
26
+ relevance: 10
27
+ },
28
+ {
29
+ className: 'header',
30
+ begin: 'Index: ', end: '$'
31
+ },
32
+ {
33
+ className: 'header',
34
+ begin: '=====', end: '=====$'
35
+ },
36
+ {
37
+ className: 'header',
38
+ begin: '^\\-\\-\\-', end: '$'
39
+ },
40
+ {
41
+ className: 'header',
42
+ begin: '^\\*{3} ', end: '$'
43
+ },
44
+ {
45
+ className: 'header',
46
+ begin: '^\\+\\+\\+', end: '$'
47
+ },
48
+ {
49
+ className: 'header',
50
+ begin: '\\*{5}', end: '\\*{5}$'
51
+ },
52
+ {
53
+ className: 'addition',
54
+ begin: '^\\+', end: '$'
55
+ },
56
+ {
57
+ className: 'deletion',
58
+ begin: '^\\-', end: '$'
59
+ },
60
+ {
61
+ className: 'change',
62
+ begin: '^\\!', end: '$'
63
+ }
64
+ ]
65
+ }
@@ -0,0 +1,61 @@
1
+ /*
2
+ Language: Django
3
+ Requires: html-xml.js
4
+ */
5
+
6
+ hljs.LANGUAGES.django = {
7
+ defaultMode: {
8
+ contains: ['tag', 'comment', 'doctype', 'template_comment', 'template_tag', 'variable']
9
+ },
10
+ case_insensitive: true,
11
+ modes: [
12
+ hljs.XML_COMMENT,
13
+ hljs.HTML_DOCTYPE,
14
+ {
15
+ className: 'tag',
16
+ lexems: [hljs.IDENT_RE],
17
+ keywords: hljs.HTML_TAGS,
18
+ begin: '<[A-Za-z/]', end: '>',
19
+ contains: ['attribute', 'template_comment', 'template_tag', 'variable']
20
+ },
21
+ hljs.HTML_ATTR,
22
+ hljs.HTML_SHORT_ATTR,
23
+ {
24
+ className: 'value',
25
+ begin: '"', end: '"',
26
+ contains: ['template_comment', 'template_tag', 'variable']
27
+ },
28
+ hljs.HTML_VALUE,
29
+ {
30
+ className: 'template_comment',
31
+ begin: '\\{\\%\\s*comment\\s*\\%\\}', end: '\\{\\%\\s*endcomment\\s*\\%\\}'
32
+ },
33
+ {
34
+ className: 'template_comment',
35
+ begin: '\\{#', end: '#\\}'
36
+ },
37
+ {
38
+ className: 'template_tag',
39
+ begin: '\\{\\%', end: '\\%\\}',
40
+ lexems: [hljs.IDENT_RE],
41
+ keywords: {'comment': 1, 'endcomment': 1, 'load': 1, 'templatetag': 1, 'ifchanged': 1, 'endifchanged': 1, 'if': 1, 'endif': 1, 'firstof': 1, 'for': 1, 'endfor': 1, 'in': 1, 'ifnotequal': 1, 'endifnotequal': 1, 'widthratio': 1, 'extends': 1, 'include': 1, 'spaceless': 1, 'endspaceless': 1, 'regroup': 1, 'by': 1, 'as': 1, 'ifequal': 1, 'endifequal': 1, 'ssi': 1, 'now': 1, 'with': 1, 'cycle': 1, 'url': 1, 'filter': 1, 'endfilter': 1, 'debug': 1, 'block': 1, 'endblock': 1, 'else': 1},
42
+ contains: ['filter']
43
+ },
44
+ {
45
+ className: 'variable',
46
+ begin: '\\{\\{', end: '\\}\\}',
47
+ contains: ['filter']
48
+ },
49
+ {
50
+ className: 'filter',
51
+ begin: '\\|[A-Za-z]+\\:?', end: '^', excludeEnd: true,
52
+ lexems: [hljs.IDENT_RE],
53
+ keywords: {'truncatewords': 1, 'removetags': 1, 'linebreaksbr': 1, 'yesno': 1, 'get_digit': 1, 'timesince': 1, 'random': 1, 'striptags': 1, 'filesizeformat': 1, 'escape': 1, 'linebreaks': 1, 'length_is': 1, 'ljust': 1, 'rjust': 1, 'cut': 1, 'urlize': 1, 'fix_ampersands': 1, 'title': 1, 'floatformat': 1, 'capfirst': 1, 'pprint': 1, 'divisibleby': 1, 'add': 1, 'make_list': 1, 'unordered_list': 1, 'urlencode': 1, 'timeuntil': 1, 'urlizetrunc': 1, 'wordcount': 1, 'stringformat': 1, 'linenumbers': 1, 'slice': 1, 'date': 1, 'dictsort': 1, 'dictsortreversed': 1, 'default_if_none': 1, 'pluralize': 1, 'lower': 1, 'join': 1, 'center': 1, 'default': 1, 'truncatewords_html': 1, 'upper': 1, 'length': 1, 'phone2numeric': 1, 'wordwrap': 1, 'time': 1, 'addslashes': 1, 'slugify': 1, 'first': 1},
54
+ contains: ['argument']
55
+ },
56
+ {
57
+ className: 'argument',
58
+ begin: '"', end: '"'
59
+ }
60
+ ]
61
+ };
@@ -0,0 +1,33 @@
1
+ /*
2
+ Language: DOS .bat
3
+ Author: Alexander Makarov (http://rmcreative.ru/)
4
+ */
5
+
6
+ hljs.LANGUAGES.dos = {
7
+ case_insensitive: true,
8
+ defaultMode: {
9
+ lexems: [hljs.IDENT_RE],
10
+ contains: ['envvar', 'number', 'comment'],
11
+ keywords: {
12
+ 'flow': {'if':1, 'else':1, 'goto':1, 'for':1, 'in':1, 'do':1, 'call':1, 'exit':1, 'not':1, 'exist':1, 'errorlevel':1, 'defined':1, 'equ':1, 'neq':1, 'lss':1, 'leq':1, 'gtr':1, 'geq':1},
13
+ 'keyword':{'shift':1, 'cd':1, 'dir':1, 'echo':1, 'setlocal':1, 'endlocal':1, 'set':1, 'pause':1, 'copy':1},
14
+ 'stream':{'prn':1, 'nul':1, 'lpt3':1, 'lpt2':1, 'lpt1':1, 'con':1, 'com4':1, 'com3':1, 'com2':1, 'com1':1, 'aux':1},
15
+ 'winutils':{'ping':1, 'net':1, 'ipconfig':1, 'taskkill':1, 'xcopy':1, 'ren':1, 'del':1}
16
+ }
17
+ },
18
+ modes: [
19
+ {
20
+ className: 'number',
21
+ begin: '\\b\\d+', end: '^',
22
+ relevance: 0
23
+ },
24
+ {
25
+ className: 'comment',
26
+ begin: '@?rem', end: '$'
27
+ },
28
+ {
29
+ className: 'envvar',
30
+ begin: '%[^ ]+?%', end: '^'
31
+ }
32
+ ]
33
+ };