highlight_js-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +19 -0
- data/AUTHORS.en.txt +46 -0
- data/AUTHORS.ru.txt +46 -0
- data/Gemfile +4 -0
- data/LICENSE +24 -0
- data/README.md +34 -0
- data/Rakefile +2 -0
- data/classref.txt +437 -0
- data/highlight_js-rails.gemspec +19 -0
- data/lib/highlight_js/rails/engine.rb +6 -0
- data/lib/highlight_js/version.rb +5 -0
- data/lib/highlight_js-rails.rb +2 -0
- data/vendor/assets/images/highlight_js/brown_papersq.png +0 -0
- data/vendor/assets/images/highlight_js/school_book.png +0 -0
- data/vendor/assets/javascripts/highlight_js/highlight.js +630 -0
- data/vendor/assets/javascripts/highlight_js/languages/1c.js +68 -0
- data/vendor/assets/javascripts/highlight_js/languages/apache.js +432 -0
- data/vendor/assets/javascripts/highlight_js/languages/avrasm.js +75 -0
- data/vendor/assets/javascripts/highlight_js/languages/axapta.js +43 -0
- data/vendor/assets/javascripts/highlight_js/languages/bash.js +56 -0
- data/vendor/assets/javascripts/highlight_js/languages/cmake.js +24 -0
- data/vendor/assets/javascripts/highlight_js/languages/cpp.js +62 -0
- data/vendor/assets/javascripts/highlight_js/languages/cs.js +41 -0
- data/vendor/assets/javascripts/highlight_js/languages/css.js +101 -0
- data/vendor/assets/javascripts/highlight_js/languages/delphi.js +70 -0
- data/vendor/assets/javascripts/highlight_js/languages/diff.js +64 -0
- data/vendor/assets/javascripts/highlight_js/languages/django.js +72 -0
- data/vendor/assets/javascripts/highlight_js/languages/dos.js +29 -0
- data/vendor/assets/javascripts/highlight_js/languages/erlang-repl.js +81 -0
- data/vendor/assets/javascripts/highlight_js/languages/erlang.js +201 -0
- data/vendor/assets/javascripts/highlight_js/languages/go.js +58 -0
- data/vendor/assets/javascripts/highlight_js/languages/haskell.js +77 -0
- data/vendor/assets/javascripts/highlight_js/languages/ini.js +32 -0
- data/vendor/assets/javascripts/highlight_js/languages/java.js +45 -0
- data/vendor/assets/javascripts/highlight_js/languages/javascript.js +53 -0
- data/vendor/assets/javascripts/highlight_js/languages/lisp.js +87 -0
- data/vendor/assets/javascripts/highlight_js/languages/lua.js +75 -0
- data/vendor/assets/javascripts/highlight_js/languages/mel.js +40 -0
- data/vendor/assets/javascripts/highlight_js/languages/nginx.js +224 -0
- data/vendor/assets/javascripts/highlight_js/languages/objectivec.js +94 -0
- data/vendor/assets/javascripts/highlight_js/languages/parser3.js +52 -0
- data/vendor/assets/javascripts/highlight_js/languages/perl.js +143 -0
- data/vendor/assets/javascripts/highlight_js/languages/php.js +55 -0
- data/vendor/assets/javascripts/highlight_js/languages/profile.js +49 -0
- data/vendor/assets/javascripts/highlight_js/languages/python.js +71 -0
- data/vendor/assets/javascripts/highlight_js/languages/renderman.js +230 -0
- data/vendor/assets/javascripts/highlight_js/languages/ruby.js +203 -0
- data/vendor/assets/javascripts/highlight_js/languages/scala.js +60 -0
- data/vendor/assets/javascripts/highlight_js/languages/smalltalk.js +55 -0
- data/vendor/assets/javascripts/highlight_js/languages/sql.js +90 -0
- data/vendor/assets/javascripts/highlight_js/languages/tex.js +62 -0
- data/vendor/assets/javascripts/highlight_js/languages/vala.js +75 -0
- data/vendor/assets/javascripts/highlight_js/languages/vbscript.js +30 -0
- data/vendor/assets/javascripts/highlight_js/languages/vhdl.js +30 -0
- data/vendor/assets/javascripts/highlight_js/languages/xml.js +103 -0
- data/vendor/assets/stylesheets/highlight_js/arta.css +151 -0
- data/vendor/assets/stylesheets/highlight_js/ascetic.css +45 -0
- data/vendor/assets/stylesheets/highlight_js/brown_paper.css.erb +105 -0
- data/vendor/assets/stylesheets/highlight_js/dark.css +103 -0
- data/vendor/assets/stylesheets/highlight_js/default.css +121 -0
- data/vendor/assets/stylesheets/highlight_js/far.css +118 -0
- data/vendor/assets/stylesheets/highlight_js/github.css +129 -0
- data/vendor/assets/stylesheets/highlight_js/idea.css +118 -0
- data/vendor/assets/stylesheets/highlight_js/ir_black.css +103 -0
- data/vendor/assets/stylesheets/highlight_js/magula.css +118 -0
- data/vendor/assets/stylesheets/highlight_js/school_book.css.erb +111 -0
- data/vendor/assets/stylesheets/highlight_js/solarized_dark.css +96 -0
- data/vendor/assets/stylesheets/highlight_js/solarized_light.css +96 -0
- data/vendor/assets/stylesheets/highlight_js/sunburst.css +147 -0
- data/vendor/assets/stylesheets/highlight_js/vs.css +84 -0
- data/vendor/assets/stylesheets/highlight_js/zenburn.css +115 -0
- metadata +129 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
/*
|
2
|
+
Language: C++
|
3
|
+
*/
|
4
|
+
|
5
|
+
hljs.LANGUAGES.cpp = function(){
|
6
|
+
var CPP_KEYWORDS = {
|
7
|
+
'keyword': {
|
8
|
+
'false': 1, 'int': 1, 'float': 1, 'while': 1, 'private': 1, 'char': 1,
|
9
|
+
'catch': 1, 'export': 1, 'virtual': 1, 'operator': 2, 'sizeof': 2,
|
10
|
+
'dynamic_cast': 2, 'typedef': 2, 'const_cast': 2, 'const': 1,
|
11
|
+
'struct': 1, 'for': 1, 'static_cast': 2, 'union': 1, 'namespace': 1,
|
12
|
+
'unsigned': 1, 'long': 1, 'throw': 1, 'volatile': 2, 'static': 1,
|
13
|
+
'protected': 1, 'bool': 1, 'template': 1, 'mutable': 1, 'if': 1,
|
14
|
+
'public': 1, 'friend': 2, 'do': 1, 'return': 1, 'goto': 1, 'auto': 1,
|
15
|
+
'void': 2, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'extern': 1,
|
16
|
+
'using': 1, 'true': 1, 'class': 1, 'asm': 1, 'case': 1, 'typeid': 1,
|
17
|
+
'short': 1, 'reinterpret_cast': 2, 'default': 1, 'double': 1,
|
18
|
+
'register': 1, 'explicit': 1, 'signed': 1, 'typename': 1, 'try': 1,
|
19
|
+
'this': 1, 'switch': 1, 'continue': 1, 'wchar_t': 1, 'inline': 1,
|
20
|
+
'delete': 1, 'alignof': 1, 'char16_t': 1, 'char32_t': 1, 'constexpr': 1,
|
21
|
+
'decltype': 1, 'noexcept': 1, 'nullptr': 1, 'static_assert': 1,
|
22
|
+
'thread_local': 1
|
23
|
+
},
|
24
|
+
'built_in': {
|
25
|
+
'std': 1, 'string': 1, 'cin': 1, 'cout': 1, 'cerr': 1, 'clog': 1,
|
26
|
+
'stringstream': 1, 'istringstream': 1, 'ostringstream': 1, 'auto_ptr': 1,
|
27
|
+
'deque': 1, 'list': 1, 'queue': 1, 'stack': 1, 'vector': 1, 'map': 1,
|
28
|
+
'set': 1, 'bitset': 1, 'multiset': 1, 'multimap': 1, 'unordered_set': 1,
|
29
|
+
'unordered_map': 1, 'unordered_multiset': 1, 'unordered_multimap': 1,
|
30
|
+
'array': 1, 'shared_ptr': 1
|
31
|
+
}
|
32
|
+
};
|
33
|
+
var STL_CONTAINER = {
|
34
|
+
className: 'stl_container',
|
35
|
+
begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>',
|
36
|
+
keywords: CPP_KEYWORDS,
|
37
|
+
relevance: 10
|
38
|
+
};
|
39
|
+
STL_CONTAINER.contains = [STL_CONTAINER];
|
40
|
+
return {
|
41
|
+
defaultMode: {
|
42
|
+
keywords: CPP_KEYWORDS,
|
43
|
+
illegal: '</',
|
44
|
+
contains: [
|
45
|
+
hljs.C_LINE_COMMENT_MODE,
|
46
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
47
|
+
hljs.QUOTE_STRING_MODE,
|
48
|
+
{
|
49
|
+
className: 'string',
|
50
|
+
begin: '\'', end: '[^\\\\]\'',
|
51
|
+
illegal: '[^\\\\][^\']'
|
52
|
+
},
|
53
|
+
hljs.C_NUMBER_MODE,
|
54
|
+
{
|
55
|
+
className: 'preprocessor',
|
56
|
+
begin: '#', end: '$'
|
57
|
+
},
|
58
|
+
STL_CONTAINER
|
59
|
+
]
|
60
|
+
}
|
61
|
+
};
|
62
|
+
}();
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/*
|
2
|
+
Language: C#
|
3
|
+
Author: Jason Diamond <jason@diamond.name>
|
4
|
+
*/
|
5
|
+
|
6
|
+
hljs.LANGUAGES.cs = {
|
7
|
+
defaultMode: {
|
8
|
+
keywords: {
|
9
|
+
// Normal keywords.
|
10
|
+
'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,
|
11
|
+
// Contextual keywords.
|
12
|
+
'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
|
13
|
+
},
|
14
|
+
contains: [
|
15
|
+
{
|
16
|
+
className: 'comment',
|
17
|
+
begin: '///', end: '$', returnBegin: true,
|
18
|
+
contains: [
|
19
|
+
{
|
20
|
+
className: 'xmlDocTag',
|
21
|
+
begin: '///|<!--|-->'
|
22
|
+
},
|
23
|
+
{
|
24
|
+
className: 'xmlDocTag',
|
25
|
+
begin: '</?', end: '>'
|
26
|
+
}
|
27
|
+
]
|
28
|
+
},
|
29
|
+
hljs.C_LINE_COMMENT_MODE,
|
30
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
31
|
+
{
|
32
|
+
className: 'string',
|
33
|
+
begin: '@"', end: '"',
|
34
|
+
contains: [{begin: '""'}]
|
35
|
+
},
|
36
|
+
hljs.APOS_STRING_MODE,
|
37
|
+
hljs.QUOTE_STRING_MODE,
|
38
|
+
hljs.C_NUMBER_MODE
|
39
|
+
]
|
40
|
+
}
|
41
|
+
};
|
@@ -0,0 +1,101 @@
|
|
1
|
+
/*
|
2
|
+
Language: CSS
|
3
|
+
*/
|
4
|
+
|
5
|
+
hljs.LANGUAGES.css = function() {
|
6
|
+
var FUNCTION = {
|
7
|
+
className: 'function',
|
8
|
+
begin: hljs.IDENT_RE + '\\(', end: '\\)',
|
9
|
+
contains: [{
|
10
|
+
endsWithParent: true, excludeEnd: true,
|
11
|
+
contains: [hljs.NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
|
12
|
+
}]
|
13
|
+
};
|
14
|
+
return {
|
15
|
+
case_insensitive: true,
|
16
|
+
defaultMode: {
|
17
|
+
illegal: '[=/|\']',
|
18
|
+
contains: [
|
19
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
20
|
+
{
|
21
|
+
className: 'id', begin: '\\#[A-Za-z0-9_-]+'
|
22
|
+
},
|
23
|
+
{
|
24
|
+
className: 'class', begin: '\\.[A-Za-z0-9_-]+',
|
25
|
+
relevance: 0
|
26
|
+
},
|
27
|
+
{
|
28
|
+
className: 'attr_selector',
|
29
|
+
begin: '\\[', end: '\\]',
|
30
|
+
illegal: '$'
|
31
|
+
},
|
32
|
+
{
|
33
|
+
className: 'pseudo',
|
34
|
+
begin: ':(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\"\\\']+'
|
35
|
+
},
|
36
|
+
{
|
37
|
+
className: 'at_rule',
|
38
|
+
begin: '@(font-face|page)',
|
39
|
+
lexems: '[a-z-]+',
|
40
|
+
keywords: {'font-face': 1, 'page': 1}
|
41
|
+
},
|
42
|
+
{
|
43
|
+
className: 'at_rule',
|
44
|
+
begin: '@', end: '[{;]', // at_rule eating first "{" is a good thing
|
45
|
+
// because it doesn't let it to be parsed as
|
46
|
+
// a rule set but instead drops parser into
|
47
|
+
// the defaultMode which is how it should be.
|
48
|
+
excludeEnd: true,
|
49
|
+
keywords: {'import': 1, 'page': 1, 'media': 1, 'charset': 1},
|
50
|
+
contains: [
|
51
|
+
FUNCTION,
|
52
|
+
hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE,
|
53
|
+
hljs.NUMBER_MODE
|
54
|
+
]
|
55
|
+
},
|
56
|
+
{
|
57
|
+
className: 'tag', begin: hljs.IDENT_RE,
|
58
|
+
relevance: 0
|
59
|
+
},
|
60
|
+
{
|
61
|
+
className: 'rules',
|
62
|
+
begin: '{', end: '}',
|
63
|
+
illegal: '[^\\s]',
|
64
|
+
relevance: 0,
|
65
|
+
contains: [
|
66
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
67
|
+
{
|
68
|
+
className: 'rule',
|
69
|
+
begin: '[^\\s]', returnBegin: true, end: ';', endsWithParent: true,
|
70
|
+
contains: [
|
71
|
+
{
|
72
|
+
className: 'attribute',
|
73
|
+
begin: '[A-Z\\_\\.\\-]+', end: ':',
|
74
|
+
excludeEnd: true,
|
75
|
+
illegal: '[^\\s]',
|
76
|
+
starts: {
|
77
|
+
className: 'value',
|
78
|
+
endsWithParent: true, excludeEnd: true,
|
79
|
+
contains: [
|
80
|
+
FUNCTION,
|
81
|
+
hljs.NUMBER_MODE,
|
82
|
+
hljs.QUOTE_STRING_MODE,
|
83
|
+
hljs.APOS_STRING_MODE,
|
84
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
85
|
+
{
|
86
|
+
className: 'hexcolor', begin: '\\#[0-9A-F]+'
|
87
|
+
},
|
88
|
+
{
|
89
|
+
className: 'important', begin: '!important'
|
90
|
+
}
|
91
|
+
]
|
92
|
+
}
|
93
|
+
}
|
94
|
+
]
|
95
|
+
}
|
96
|
+
]
|
97
|
+
}
|
98
|
+
]
|
99
|
+
}
|
100
|
+
};
|
101
|
+
}();
|
@@ -0,0 +1,70 @@
|
|
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
|
+
var CURLY_COMMENT = {
|
9
|
+
className: 'comment',
|
10
|
+
begin: '{', end: '}',
|
11
|
+
relevance: 0
|
12
|
+
};
|
13
|
+
var PAREN_COMMENT = {
|
14
|
+
className: 'comment',
|
15
|
+
begin: '\\(\\*', end: '\\*\\)',
|
16
|
+
relevance: 10
|
17
|
+
};
|
18
|
+
var STRING = {
|
19
|
+
className: 'string',
|
20
|
+
begin: '\'', end: '\'',
|
21
|
+
contains: [{begin: '\'\''}],
|
22
|
+
relevance: 0
|
23
|
+
};
|
24
|
+
var CHAR_STRING = {
|
25
|
+
className: 'string', begin: '(#\\d+)+'
|
26
|
+
};
|
27
|
+
var FUNCTION = {
|
28
|
+
className: 'function',
|
29
|
+
begin: '(procedure|constructor|destructor|function)\\b', end: '[:;]',
|
30
|
+
keywords: {'function': 1, 'constructor': 10, 'destructor': 10, 'procedure': 10},
|
31
|
+
contains: [
|
32
|
+
{
|
33
|
+
className: 'title', begin: hljs.IDENT_RE
|
34
|
+
},
|
35
|
+
{
|
36
|
+
className: 'params',
|
37
|
+
begin: '\\(', end: '\\)',
|
38
|
+
keywords: DELPHI_KEYWORDS,
|
39
|
+
contains: [STRING, CHAR_STRING]
|
40
|
+
},
|
41
|
+
CURLY_COMMENT, PAREN_COMMENT
|
42
|
+
]
|
43
|
+
};
|
44
|
+
return {
|
45
|
+
case_insensitive: true,
|
46
|
+
defaultMode: {
|
47
|
+
keywords: DELPHI_KEYWORDS,
|
48
|
+
illegal: '("|\\$[G-Zg-z]|\\/\\*|</)',
|
49
|
+
contains: [
|
50
|
+
CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
|
51
|
+
STRING, CHAR_STRING,
|
52
|
+
hljs.NUMBER_MODE,
|
53
|
+
FUNCTION,
|
54
|
+
{
|
55
|
+
className: 'class',
|
56
|
+
begin: '=\\bclass\\b', end: 'end;',
|
57
|
+
keywords: DELPHI_CLASS_KEYWORDS,
|
58
|
+
contains: [
|
59
|
+
STRING, CHAR_STRING,
|
60
|
+
CURLY_COMMENT, PAREN_COMMENT,
|
61
|
+
FUNCTION
|
62
|
+
]
|
63
|
+
}
|
64
|
+
]
|
65
|
+
},
|
66
|
+
modes: [
|
67
|
+
|
68
|
+
]
|
69
|
+
};
|
70
|
+
}();
|
@@ -0,0 +1,64 @@
|
|
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: [
|
11
|
+
{
|
12
|
+
className: 'chunk',
|
13
|
+
begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$',
|
14
|
+
relevance: 10
|
15
|
+
},
|
16
|
+
{
|
17
|
+
className: 'chunk',
|
18
|
+
begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$',
|
19
|
+
relevance: 10
|
20
|
+
},
|
21
|
+
{
|
22
|
+
className: 'chunk',
|
23
|
+
begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$',
|
24
|
+
relevance: 10
|
25
|
+
},
|
26
|
+
{
|
27
|
+
className: 'header',
|
28
|
+
begin: 'Index: ', end: '$'
|
29
|
+
},
|
30
|
+
{
|
31
|
+
className: 'header',
|
32
|
+
begin: '=====', end: '=====$'
|
33
|
+
},
|
34
|
+
{
|
35
|
+
className: 'header',
|
36
|
+
begin: '^\\-\\-\\-', end: '$'
|
37
|
+
},
|
38
|
+
{
|
39
|
+
className: 'header',
|
40
|
+
begin: '^\\*{3} ', end: '$'
|
41
|
+
},
|
42
|
+
{
|
43
|
+
className: 'header',
|
44
|
+
begin: '^\\+\\+\\+', end: '$'
|
45
|
+
},
|
46
|
+
{
|
47
|
+
className: 'header',
|
48
|
+
begin: '\\*{5}', end: '\\*{5}$'
|
49
|
+
},
|
50
|
+
{
|
51
|
+
className: 'addition',
|
52
|
+
begin: '^\\+', end: '$'
|
53
|
+
},
|
54
|
+
{
|
55
|
+
className: 'deletion',
|
56
|
+
begin: '^\\-', end: '$'
|
57
|
+
},
|
58
|
+
{
|
59
|
+
className: 'change',
|
60
|
+
begin: '^\\!', end: '$'
|
61
|
+
}
|
62
|
+
]
|
63
|
+
}
|
64
|
+
};
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/*
|
2
|
+
Language: Django
|
3
|
+
Requires: xml.js
|
4
|
+
*/
|
5
|
+
|
6
|
+
hljs.LANGUAGES.django = function() {
|
7
|
+
|
8
|
+
function allowsDjangoSyntax(mode, parent) {
|
9
|
+
return (
|
10
|
+
parent == undefined || // defaultMode
|
11
|
+
(!mode.className && parent.className == 'tag') || // tag_internal
|
12
|
+
mode.className == 'value' // value
|
13
|
+
);
|
14
|
+
}
|
15
|
+
|
16
|
+
function copy(mode, parent) {
|
17
|
+
var result = {};
|
18
|
+
for (var key in mode) {
|
19
|
+
if (key != 'contains') {
|
20
|
+
result[key] = mode[key];
|
21
|
+
};
|
22
|
+
var contains = [];
|
23
|
+
for (var i = 0; mode.contains && i < mode.contains.length; i++) {
|
24
|
+
contains.push(copy(mode.contains[i], mode));
|
25
|
+
}
|
26
|
+
if (allowsDjangoSyntax(mode, parent)) {
|
27
|
+
contains = DJANGO_CONTAINS.concat(contains);
|
28
|
+
}
|
29
|
+
if (contains.length) {
|
30
|
+
result.contains = contains;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
return result;
|
34
|
+
}
|
35
|
+
|
36
|
+
var FILTER = {
|
37
|
+
className: 'filter',
|
38
|
+
begin: '\\|[A-Za-z]+\\:?', excludeEnd: true,
|
39
|
+
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},
|
40
|
+
contains: [
|
41
|
+
{className: 'argument', begin: '"', end: '"'}
|
42
|
+
]
|
43
|
+
};
|
44
|
+
|
45
|
+
var DJANGO_CONTAINS = [
|
46
|
+
{
|
47
|
+
className: 'template_comment',
|
48
|
+
begin: '{%\\s*comment\\s*%}', end: '{%\\s*endcomment\\s*%}'
|
49
|
+
},
|
50
|
+
{
|
51
|
+
className: 'template_comment',
|
52
|
+
begin: '{#', end: '#}'
|
53
|
+
},
|
54
|
+
{
|
55
|
+
className: 'template_tag',
|
56
|
+
begin: '{%', end: '%}',
|
57
|
+
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},
|
58
|
+
contains: [FILTER]
|
59
|
+
},
|
60
|
+
{
|
61
|
+
className: 'variable',
|
62
|
+
begin: '{{', end: '}}',
|
63
|
+
contains: [FILTER]
|
64
|
+
}
|
65
|
+
];
|
66
|
+
|
67
|
+
return {
|
68
|
+
case_insensitive: true,
|
69
|
+
defaultMode: copy(hljs.LANGUAGES.xml.defaultMode)
|
70
|
+
};
|
71
|
+
|
72
|
+
}();
|
@@ -0,0 +1,29 @@
|
|
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
|
+
keywords: {
|
10
|
+
'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},
|
11
|
+
'keyword':{'shift':1, 'cd':1, 'dir':1, 'echo':1, 'setlocal':1, 'endlocal':1, 'set':1, 'pause':1, 'copy':1},
|
12
|
+
'stream':{'prn':1, 'nul':1, 'lpt3':1, 'lpt2':1, 'lpt1':1, 'con':1, 'com4':1, 'com3':1, 'com2':1, 'com1':1, 'aux':1},
|
13
|
+
'winutils':{'ping':1, 'net':1, 'ipconfig':1, 'taskkill':1, 'xcopy':1, 'ren':1, 'del':1}
|
14
|
+
},
|
15
|
+
contains: [
|
16
|
+
{
|
17
|
+
className: 'envvar', begin: '%[^ ]+?%'
|
18
|
+
},
|
19
|
+
{
|
20
|
+
className: 'number', begin: '\\b\\d+',
|
21
|
+
relevance: 0
|
22
|
+
},
|
23
|
+
{
|
24
|
+
className: 'comment',
|
25
|
+
begin: '@?rem', end: '$'
|
26
|
+
}
|
27
|
+
]
|
28
|
+
}
|
29
|
+
};
|
@@ -0,0 +1,81 @@
|
|
1
|
+
/*
|
2
|
+
Language: Erlang REPL
|
3
|
+
Author: Sergey Ignatov <sergey@ignatov.spb.su>
|
4
|
+
*/
|
5
|
+
|
6
|
+
hljs.LANGUAGES.erlang_repl = {
|
7
|
+
defaultMode: {
|
8
|
+
keywords: {
|
9
|
+
'special_functions':{
|
10
|
+
'spawn':10,
|
11
|
+
'spawn_link':10,
|
12
|
+
'self':2
|
13
|
+
},
|
14
|
+
'reserved':{
|
15
|
+
'after':1,
|
16
|
+
'and':1,
|
17
|
+
'andalso':5,
|
18
|
+
'band':1,
|
19
|
+
'begin':1,
|
20
|
+
'bnot':1,
|
21
|
+
'bor':1,
|
22
|
+
'bsl':1,
|
23
|
+
'bsr':1,
|
24
|
+
'bxor':1,
|
25
|
+
'case':1,
|
26
|
+
'catch':0,
|
27
|
+
'cond':1,
|
28
|
+
'div':1,
|
29
|
+
'end':1,
|
30
|
+
'fun':0,
|
31
|
+
'if':0,
|
32
|
+
'let':1,
|
33
|
+
'not':0,
|
34
|
+
'of':1,
|
35
|
+
'or':1,
|
36
|
+
'orelse':5,
|
37
|
+
'query':1,
|
38
|
+
'receive':0,
|
39
|
+
'rem':1,
|
40
|
+
'try':0,
|
41
|
+
'when':1,
|
42
|
+
'xor':1
|
43
|
+
}
|
44
|
+
},
|
45
|
+
contains: [
|
46
|
+
{
|
47
|
+
className: 'input_number', begin: '^[0-9]+> ',
|
48
|
+
relevance: 10
|
49
|
+
},
|
50
|
+
{
|
51
|
+
className: 'comment',
|
52
|
+
begin: '%', end: '$'
|
53
|
+
},
|
54
|
+
hljs.NUMBER_MODE,
|
55
|
+
hljs.APOS_STRING_MODE,
|
56
|
+
hljs.QUOTE_STRING_MODE,
|
57
|
+
{
|
58
|
+
className: 'constant', begin: '\\?(::)?([A-Z]\\w*(::)?)+'
|
59
|
+
},
|
60
|
+
{
|
61
|
+
className: 'arrow', begin: '->'
|
62
|
+
},
|
63
|
+
{
|
64
|
+
className: 'ok', begin: 'ok'
|
65
|
+
},
|
66
|
+
{
|
67
|
+
className: 'exclamation_mark', begin: '!'
|
68
|
+
},
|
69
|
+
{
|
70
|
+
className: 'function_or_atom',
|
71
|
+
begin: '(\\b[a-z\'][a-zA-Z0-9_\']*:[a-z\'][a-zA-Z0-9_\']*)|(\\b[a-z\'][a-zA-Z0-9_\']*)',
|
72
|
+
relevance: 0
|
73
|
+
},
|
74
|
+
{
|
75
|
+
className: 'variable',
|
76
|
+
begin: '[A-Z][a-zA-Z0-9_\']*',
|
77
|
+
relevance: 0
|
78
|
+
}
|
79
|
+
]
|
80
|
+
}
|
81
|
+
};
|