shinmun 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/LICENSE +18 -0
- data/README.md +249 -0
- data/Rakefile +60 -0
- data/bin/shinmun +12 -0
- data/example/posts/2008/9/example.md +19 -0
- data/example/posts/blog.yml +10 -0
- data/example/posts/uuid.state +3 -0
- data/example/public/controllers/comments.php +56 -0
- data/example/public/images/loading.gif +0 -0
- data/example/public/javascripts/comments.js +60 -0
- data/example/public/javascripts/highlight.js +505 -0
- data/example/public/javascripts/images/bg-fill.png +0 -0
- data/example/public/javascripts/images/bg.png +0 -0
- data/example/public/javascripts/images/blockquote.png +0 -0
- data/example/public/javascripts/images/bold.png +0 -0
- data/example/public/javascripts/images/code.png +0 -0
- data/example/public/javascripts/images/h1.png +0 -0
- data/example/public/javascripts/images/hr.png +0 -0
- data/example/public/javascripts/images/img.png +0 -0
- data/example/public/javascripts/images/italic.png +0 -0
- data/example/public/javascripts/images/link.png +0 -0
- data/example/public/javascripts/images/ol.png +0 -0
- data/example/public/javascripts/images/redo.png +0 -0
- data/example/public/javascripts/images/separator.png +0 -0
- data/example/public/javascripts/images/ul.png +0 -0
- data/example/public/javascripts/images/undo.png +0 -0
- data/example/public/javascripts/images/wmd-on.png +0 -0
- data/example/public/javascripts/images/wmd.png +0 -0
- data/example/public/javascripts/jquery-form.js +869 -0
- data/example/public/javascripts/jquery.js +3383 -0
- data/example/public/javascripts/languages/1c.js +82 -0
- data/example/public/javascripts/languages/axapta.js +52 -0
- data/example/public/javascripts/languages/bash.js +80 -0
- data/example/public/javascripts/languages/diff.js +64 -0
- data/example/public/javascripts/languages/dos.js +33 -0
- data/example/public/javascripts/languages/dynamic.js +460 -0
- data/example/public/javascripts/languages/ini.js +36 -0
- data/example/public/javascripts/languages/javascript.js +38 -0
- data/example/public/javascripts/languages/lisp.js +86 -0
- data/example/public/javascripts/languages/mel.js +50 -0
- data/example/public/javascripts/languages/profile.js +50 -0
- data/example/public/javascripts/languages/renderman.js +71 -0
- data/example/public/javascripts/languages/smalltalk.js +53 -0
- data/example/public/javascripts/languages/sql.js +50 -0
- data/example/public/javascripts/languages/static.js +175 -0
- data/example/public/javascripts/languages/vbscript.js +25 -0
- data/example/public/javascripts/languages/www.js +245 -0
- data/example/public/javascripts/prettyDate.js +36 -0
- data/example/public/javascripts/showdown.js +421 -0
- data/example/public/javascripts/template.js +165 -0
- data/example/public/javascripts/wmd-base.js +1799 -0
- data/example/public/javascripts/wmd-plus.js +311 -0
- data/example/public/javascripts/wmd.js +73 -0
- data/example/public/stylesheets/grid.css +243 -0
- data/example/public/stylesheets/grid.png +0 -0
- data/example/public/stylesheets/highlight/ascetic.css +38 -0
- data/example/public/stylesheets/highlight/dark.css +96 -0
- data/example/public/stylesheets/highlight/default.css +91 -0
- data/example/public/stylesheets/highlight/far.css +95 -0
- data/example/public/stylesheets/highlight/idea.css +75 -0
- data/example/public/stylesheets/highlight/sunburst.css +112 -0
- data/example/public/stylesheets/highlight/zenburn.css +108 -0
- data/example/public/stylesheets/print.css +76 -0
- data/example/public/stylesheets/reset.css +45 -0
- data/example/public/stylesheets/style.css +141 -0
- data/example/public/stylesheets/typography.css +59 -0
- data/example/templates/feed.rxml +21 -0
- data/example/templates/layout.rhtml +54 -0
- data/example/templates/page.rhtml +4 -0
- data/example/templates/post.rhtml +57 -0
- data/example/templates/posts.rhtml +10 -0
- data/lib/shinmun.rb +420 -0
- metadata +151 -0
@@ -0,0 +1,460 @@
|
|
1
|
+
hljs.LANGUAGES.python = {
|
2
|
+
defaultMode: {
|
3
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
4
|
+
illegal: '(</|->)',
|
5
|
+
contains: ['comment', 'string', 'function', 'class', 'number', 'decorator'],
|
6
|
+
keywords: {
|
7
|
+
'keyword': {'and': 1, 'elif': 1, 'is': 1, 'global': 1, 'as': 1, 'in': 1, 'if': 1, 'from': 1, 'raise': 1, 'for': 1, 'except': 1, 'finally': 1, 'print': 1, 'import': 1, 'pass': 1, 'return': 1, 'exec': 1, 'else': 1, 'break': 1, 'not': 1, 'with': 1, 'class': 1, 'assert': 1, 'yield': 1, 'try': 1, 'while': 1, 'continue': 1, 'del': 1, 'or': 1, 'def': 1, 'lambda': 1},
|
8
|
+
'built_in': {'None': 1, 'True': 1, 'False': 1, 'Ellipsis': 1, 'NotImplemented': 1}
|
9
|
+
}
|
10
|
+
},
|
11
|
+
modes: [
|
12
|
+
{
|
13
|
+
className: 'function',
|
14
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
15
|
+
begin: '\\bdef ', end: ':',
|
16
|
+
illegal: '$',
|
17
|
+
keywords: {'def': 1},
|
18
|
+
contains: ['title', 'params'],
|
19
|
+
relevance: 10
|
20
|
+
},
|
21
|
+
{
|
22
|
+
className: 'class',
|
23
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
24
|
+
begin: '\\bclass ', end: ':',
|
25
|
+
illegal: '[${]',
|
26
|
+
keywords: {'class': 1},
|
27
|
+
contains: ['title', 'params',],
|
28
|
+
relevance: 10
|
29
|
+
},
|
30
|
+
{
|
31
|
+
className: 'title',
|
32
|
+
begin: hljs.UNDERSCORE_IDENT_RE, end: '^'
|
33
|
+
},
|
34
|
+
{
|
35
|
+
className: 'params',
|
36
|
+
begin: '\\(', end: '\\)',
|
37
|
+
contains: ['string']
|
38
|
+
},
|
39
|
+
hljs.HASH_COMMENT_MODE,
|
40
|
+
hljs.C_NUMBER_MODE,
|
41
|
+
{
|
42
|
+
className: 'string',
|
43
|
+
begin: '\'\'\'', end: '\'\'\'',
|
44
|
+
relevance: 10
|
45
|
+
},
|
46
|
+
{
|
47
|
+
className: 'string',
|
48
|
+
begin: '"""', end: '"""',
|
49
|
+
relevance: 10
|
50
|
+
},
|
51
|
+
hljs.APOS_STRING_MODE,
|
52
|
+
hljs.QUOTE_STRING_MODE,
|
53
|
+
hljs.BACKSLASH_ESCAPE,
|
54
|
+
{
|
55
|
+
className: 'string',
|
56
|
+
begin: 'r\'', end: '\'',
|
57
|
+
relevance: 10
|
58
|
+
},
|
59
|
+
{
|
60
|
+
className: 'string',
|
61
|
+
begin: 'r"', end: '"',
|
62
|
+
relevance: 10
|
63
|
+
},
|
64
|
+
{
|
65
|
+
className: 'string',
|
66
|
+
begin: 'u\'', end: '(^|[^\\\\])\'',
|
67
|
+
relevance: 10
|
68
|
+
},
|
69
|
+
{
|
70
|
+
className: 'string',
|
71
|
+
begin: 'u"', end: '(^|[^\\\\])"',
|
72
|
+
relevance: 10
|
73
|
+
},
|
74
|
+
{
|
75
|
+
className: 'string',
|
76
|
+
begin: 'ur\'', end: '\'',
|
77
|
+
relevance: 10
|
78
|
+
},
|
79
|
+
{
|
80
|
+
className: 'string',
|
81
|
+
begin: 'ur"', end: '"',
|
82
|
+
relevance: 10
|
83
|
+
},
|
84
|
+
{
|
85
|
+
className: 'decorator',
|
86
|
+
begin: '@', end: '$'
|
87
|
+
}
|
88
|
+
]
|
89
|
+
};
|
90
|
+
|
91
|
+
|
92
|
+
/*
|
93
|
+
|
94
|
+
Perl definition (с) Peter Leonov <gojpeg@yandex.ru>
|
95
|
+
|
96
|
+
*/
|
97
|
+
hljs.PERL_DEFAULT_CONTAINS = ['comment', 'string', 'number', 'regexp', 'sub', 'variable', 'operator', 'pod'];
|
98
|
+
hljs.PERL_KEYWORDS = {'getpwent': 1, 'getservent': 1, 'quotemeta': 1, 'msgrcv': 1, 'scalar': 1, 'kill': 1, 'dbmclose': 1, 'undef': 1, 'lc': 1, 'ma': 1, 'syswrite': 1, 'tr': 1, 'send': 1, 'umask': 1, 'sysopen': 1, 'shmwrite': 1, 'vec': 1, 'qx': 1, 'utime': 1, 'local': 1, 'oct': 1, 'semctl': 1, 'localtime': 1, 'readpipe': 1, 'do': 1, 'return': 1, 'format': 1, 'read': 1, 'sprintf': 1, 'dbmopen': 1, 'pop': 1, 'getpgrp': 1, 'not': 1, 'getpwnam': 1, 'rewinddir': 1, 'qq': 1, 'fileno': 1, 'qw': 1, 'endprotoent': 1, 'wait': 1, 'sethostent': 1, 'bless': 1, 's': 1, 'opendir': 1, 'continue': 1, 'each': 1, 'sleep': 1, 'endgrent': 1, 'shutdown': 1, 'dump': 1, 'chomp': 1, 'connect': 1, 'getsockname': 1, 'die': 1, 'socketpair': 1, 'close': 1, 'flock': 1, 'exists': 1, 'index': 1, 'shmget': 1, 'sub': 1, 'for': 1, 'endpwent': 1, 'redo': 1, 'lstat': 1, 'msgctl': 1, 'setpgrp': 1, 'abs': 1, 'exit': 1, 'select': 1, 'print': 1, 'ref': 1, 'gethostbyaddr': 1, 'unshift': 1, 'fcntl': 1, 'syscall': 1, 'goto': 1, 'getnetbyaddr': 1, 'join': 1, 'gmtime': 1, 'symlink': 1, 'semget': 1, 'splice': 1, 'x': 1, 'getpeername': 1, 'recv': 1, 'log': 1, 'setsockopt': 1, 'cos': 1, 'last': 1, 'reverse': 1, 'gethostbyname': 1, 'getgrnam': 1, 'study': 1, 'formline': 1, 'endhostent': 1, 'times': 1, 'chop': 1, 'length': 1, 'gethostent': 1, 'getnetent': 1, 'pack': 1, 'getprotoent': 1, 'getservbyname': 1, 'rand': 1, 'mkdir': 1, 'pos': 1, 'chmod': 1, 'y': 1, 'substr': 1, 'endnetent': 1, 'printf': 1, 'next': 1, 'open': 1, 'msgsnd': 1, 'readdir': 1, 'use': 1, 'unlink': 1, 'getsockopt': 1, 'getpriority': 1, 'rindex': 1, 'wantarray': 1, 'hex': 1, 'system': 1, 'getservbyport': 1, 'endservent': 1, 'int': 1, 'chr': 1, 'untie': 1, 'rmdir': 1, 'prototype': 1, 'tell': 1, 'listen': 1, 'fork': 1, 'shmread': 1, 'ucfirst': 1, 'setprotoent': 1, 'else': 1, 'sysseek': 1, 'link': 1, 'getgrgid': 1, 'shmctl': 1, 'waitpid': 1, 'unpack': 1, 'getnetbyname': 1, 'reset': 1, 'chdir': 1, 'grep': 1, 'split': 1, 'require': 1, 'caller': 1, 'lcfirst': 1, 'until': 1, 'warn': 1, 'while': 1, 'values': 1, 'shift': 1, 'telldir': 1, 'getpwuid': 1, 'my': 1, 'getprotobynumber': 1, 'delete': 1, 'and': 1, 'sort': 1, 'uc': 1, 'defined': 1, 'srand': 1, 'accept': 1, 'package': 1, 'seekdir': 1, 'getprotobyname': 1, 'semop': 1, 'our': 1, 'rename': 1, 'seek': 1, 'if': 1, 'q': 1, 'chroot': 1, 'sysread': 1, 'setpwent': 1, 'no': 1, 'crypt': 1, 'getc': 1, 'chown': 1, 'sqrt': 1, 'write': 1, 'setnetent': 1, 'setpriority': 1, 'foreach': 1, 'tie': 1, 'sin': 1, 'msgget': 1, 'map': 1, 'stat': 1, 'getlogin': 1, 'unless': 1, 'elsif': 1, 'truncate': 1, 'exec': 1, 'keys': 1, 'glob': 1, 'tied': 1, 'closedir': 1, 'ioctl': 1, 'socket': 1, 'readlink': 1, 'eval': 1, 'xor': 1, 'readline': 1, 'binmode': 1, 'setservent': 1, 'eof': 1, 'ord': 1, 'bind': 1, 'alarm': 1, 'pipe': 1, 'atan2': 1, 'getgrent': 1, 'exp': 1, 'time': 1, 'push': 1, 'setgrent': 1, 'gt': 1, 'lt': 1, 'or': 1, 'ne': 1, 'm': 1};
|
99
|
+
|
100
|
+
hljs.LANGUAGES.perl = {
|
101
|
+
defaultMode: {
|
102
|
+
lexems: [hljs.IDENT_RE],
|
103
|
+
contains: hljs.PERL_DEFAULT_CONTAINS,
|
104
|
+
keywords: hljs.PERL_KEYWORDS
|
105
|
+
},
|
106
|
+
modes: [
|
107
|
+
|
108
|
+
// variables
|
109
|
+
{
|
110
|
+
className: 'variable',
|
111
|
+
begin: '\\$\\d', end: '^'
|
112
|
+
},
|
113
|
+
{
|
114
|
+
className: 'variable',
|
115
|
+
begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)', end: '^'
|
116
|
+
},
|
117
|
+
|
118
|
+
// numbers and strings
|
119
|
+
{
|
120
|
+
className: 'subst',
|
121
|
+
begin: '[$@]\\{', end: '\}',
|
122
|
+
lexems: [hljs.IDENT_RE],
|
123
|
+
keywords: hljs.PERL_KEYWORDS,
|
124
|
+
contains: hljs.PERL_DEFAULT_CONTAINS,
|
125
|
+
relevance: 10
|
126
|
+
},
|
127
|
+
{
|
128
|
+
className: 'number',
|
129
|
+
begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b', end: '^',
|
130
|
+
relevance: 0
|
131
|
+
},
|
132
|
+
{
|
133
|
+
className: 'string',
|
134
|
+
begin: 'q[qwxr]?\\s*\\(', end: '\\)',
|
135
|
+
contains: ['escape', 'subst', 'variable'],
|
136
|
+
relevance: 5
|
137
|
+
},
|
138
|
+
{
|
139
|
+
className: 'string',
|
140
|
+
begin: 'q[qwxr]?\\s*\\[', end: '\\]',
|
141
|
+
contains: ['escape', 'subst', 'variable'],
|
142
|
+
relevance: 5
|
143
|
+
},
|
144
|
+
{
|
145
|
+
className: 'string',
|
146
|
+
begin: 'q[qwxr]?\\s*\\{', end: '\\}',
|
147
|
+
contains: ['escape', 'subst', 'variable'],
|
148
|
+
relevance: 5
|
149
|
+
},
|
150
|
+
{
|
151
|
+
className: 'string',
|
152
|
+
begin: 'q[qwxr]?\\s*\\|', end: '\\|',
|
153
|
+
contains: ['escape', 'subst', 'variable'],
|
154
|
+
relevance: 5
|
155
|
+
},
|
156
|
+
{
|
157
|
+
className: 'string',
|
158
|
+
begin: 'q[qwxr]?\\s*\\<', end: '\\>',
|
159
|
+
contains: ['escape', 'subst', 'variable'],
|
160
|
+
relevance: 5
|
161
|
+
},
|
162
|
+
{
|
163
|
+
className: 'string',
|
164
|
+
begin: 'qw\\s+q', end: 'q',
|
165
|
+
contains: ['escape', 'subst', 'variable'],
|
166
|
+
relevance: 5
|
167
|
+
},
|
168
|
+
{
|
169
|
+
className: 'string',
|
170
|
+
begin: '\'', end: '\'',
|
171
|
+
contains: ['escape'],
|
172
|
+
relevance: 0
|
173
|
+
},
|
174
|
+
{
|
175
|
+
className: 'string',
|
176
|
+
begin: '"', end: '"',
|
177
|
+
contains: ['escape','subst','variable'],
|
178
|
+
relevance: 0
|
179
|
+
},
|
180
|
+
hljs.BACKSLASH_ESCAPE,
|
181
|
+
{
|
182
|
+
className: 'string',
|
183
|
+
begin: '`', end: '`',
|
184
|
+
contains: ['escape']
|
185
|
+
},
|
186
|
+
|
187
|
+
// regexps
|
188
|
+
{
|
189
|
+
className: 'regexp',
|
190
|
+
begin: '(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*', end: '^',
|
191
|
+
relevance: 10
|
192
|
+
},
|
193
|
+
{
|
194
|
+
className: 'regexp',
|
195
|
+
begin: '(m|qr)?/', end: '/[a-z]*',
|
196
|
+
contains: ['escape'],
|
197
|
+
relevance: 0 // allows empty "//" which is a common comment delimiter in other languages
|
198
|
+
},
|
199
|
+
|
200
|
+
// bareword context
|
201
|
+
{
|
202
|
+
className: 'string',
|
203
|
+
begin: '{\\w+}', end: '^',
|
204
|
+
relevance: 0
|
205
|
+
},
|
206
|
+
{
|
207
|
+
className: 'string',
|
208
|
+
begin: '\-?\\w+\\s*\\=\\>', end: '^',
|
209
|
+
relevance: 0
|
210
|
+
},
|
211
|
+
|
212
|
+
// subroutines
|
213
|
+
{
|
214
|
+
className: 'sub',
|
215
|
+
begin: '\\bsub\\b', end: '(\\s*\\(.*?\\))?[;{]',
|
216
|
+
lexems: [hljs.IDENT_RE],
|
217
|
+
keywords: {'sub':1},
|
218
|
+
relevance: 5
|
219
|
+
},
|
220
|
+
|
221
|
+
// operators
|
222
|
+
{
|
223
|
+
className: 'operator',
|
224
|
+
begin: '-\\w\\b', end: '^',
|
225
|
+
relevance: 0
|
226
|
+
},
|
227
|
+
|
228
|
+
// comments
|
229
|
+
hljs.HASH_COMMENT_MODE,
|
230
|
+
{
|
231
|
+
className: 'comment',
|
232
|
+
begin: '^(__END__|__DATA__)', end: '\\n$',
|
233
|
+
relevance: 5
|
234
|
+
},
|
235
|
+
// pod
|
236
|
+
{
|
237
|
+
className: 'pod',
|
238
|
+
begin: '\\=\\w', end: '\\=cut'
|
239
|
+
}
|
240
|
+
|
241
|
+
]
|
242
|
+
};
|
243
|
+
|
244
|
+
/*
|
245
|
+
|
246
|
+
PHP5 definition (с) Victor Karamzin <Victor.Karamzin@enterra-inc.com>
|
247
|
+
|
248
|
+
*/
|
249
|
+
hljs.PHP5_KEYWORDS = {'and': 1, 'include_once': 1, 'list': 1, 'abstract': 1, 'global': 1, 'private': 1, 'echo': 1, 'interface': 1, 'as': 1, 'static': 1, 'endswitch': 1, 'array': 1, 'null': 1, 'if': 1, 'endwhile': 1, 'or': 1, 'const': 1, 'for': 1, 'endforeach': 1, 'self': 1, 'var': 1, 'while': 1, 'isset': 1, 'public': 1, 'protected': 1, 'exit': 1, 'foreach': 1, 'throw': 1, 'elseif': 1, 'extends': 1, 'include': 1, '__FILE__': 1, 'empty': 1, 'require_once': 1, 'function': 1, 'do': 1, 'xor': 1, 'return': 1, 'implements': 1, 'parent': 1, 'clone': 1, 'use': 1, '__CLASS__': 1, '__LINE__': 1, 'else': 1, 'break': 1, 'print': 1, 'eval': 1, 'new': 1, 'catch': 1, '__METHOD__': 1, 'class': 1, 'case': 1, 'exception': 1, 'php_user_filter': 1, 'default': 1, 'die': 1, 'require': 1, '__FUNCTION__': 1, 'enddeclare': 1, 'final': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'endfor': 1, 'endif': 1, 'declare': 1, 'unset': 1};
|
250
|
+
|
251
|
+
hljs.PHP_IDENTIFIER_RE = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
|
252
|
+
|
253
|
+
hljs.LANGUAGES.php = {
|
254
|
+
defaultMode: {
|
255
|
+
lexems: [hljs.IDENT_RE],
|
256
|
+
contains: ['comment', 'number', 'string', 'variable', 'preprocessor'],
|
257
|
+
keywords: hljs.PHP5_KEYWORDS
|
258
|
+
},
|
259
|
+
case_insensitive: true,
|
260
|
+
modes: [
|
261
|
+
hljs.C_LINE_COMMENT_MODE,
|
262
|
+
hljs.HASH_COMMENT_MODE,
|
263
|
+
{
|
264
|
+
className: 'comment',
|
265
|
+
begin: '/\\*', end: '\\*/',
|
266
|
+
contains: ['phpdoc']
|
267
|
+
},
|
268
|
+
{
|
269
|
+
className: 'phpdoc',
|
270
|
+
begin: '\\s@[A-Za-z]+', end: '^',
|
271
|
+
relevance: 10
|
272
|
+
},
|
273
|
+
hljs.C_NUMBER_MODE,
|
274
|
+
{
|
275
|
+
className: 'string',
|
276
|
+
begin: '\'', end: '\'',
|
277
|
+
contains: ['escape'],
|
278
|
+
relevance: 0
|
279
|
+
},
|
280
|
+
{
|
281
|
+
className: 'string',
|
282
|
+
begin: '"', end: '"',
|
283
|
+
contains: ['escape'],
|
284
|
+
relevance: 0
|
285
|
+
},
|
286
|
+
hljs.BACKSLASH_ESCAPE,
|
287
|
+
{
|
288
|
+
className: 'variable',
|
289
|
+
begin: '\\$' + hljs.PHP_IDENTIFIER_RE, end: '^'
|
290
|
+
},
|
291
|
+
{
|
292
|
+
className: 'preprocessor',
|
293
|
+
begin: '<\\?php', end: '^',
|
294
|
+
relevance: 10
|
295
|
+
},
|
296
|
+
{
|
297
|
+
className: 'preprocessor',
|
298
|
+
begin: '\\?>', end: '^'
|
299
|
+
}
|
300
|
+
]
|
301
|
+
};
|
302
|
+
|
303
|
+
/*
|
304
|
+
|
305
|
+
Ruby definition (с) Anton Kovalyov <anton@kovalyov.net>, Peter Leonov <gojpeg@yandex.ru>
|
306
|
+
|
307
|
+
*/
|
308
|
+
hljs.RUBY_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?';
|
309
|
+
hljs.RUBY_DEFAULT_CONTAINS = ['comment', 'string', 'char', 'class', 'function', 'symbol', 'number', 'variable', 'regexp']
|
310
|
+
hljs.RUBY_KEYWORDS = {
|
311
|
+
'keyword': {'and': 1, 'false': 1, 'then': 1, 'defined': 1, 'module': 1, 'in': 1, 'return': 1, 'redo': 1, 'if': 1, 'BEGIN': 1, 'retry': 1, 'end': 1, 'for': 1, 'true': 1, 'self': 1, 'when': 1, 'next': 1, 'until': 1, 'do': 1, 'begin': 1, 'unless': 1, 'END': 1, 'rescue': 1, 'nil': 1, 'else': 1, 'break': 1, 'undef': 1, 'not': 1, 'super': 1, 'class': 1, 'case': 1, 'require': 1, 'yield': 1, 'alias': 1, 'while': 1, 'ensure': 1, 'elsif': 1, 'or': 1, 'def': 1},
|
312
|
+
'keymethods': {'__id__': 1, '__send__': 1, 'abort': 1, 'abs': 1, 'all?': 1, 'allocate': 1, 'ancestors': 1, 'any?': 1, 'arity': 1, 'assoc': 1, 'at': 1, 'at_exit': 1, 'autoload': 1, 'autoload?': 1, 'between?': 1, 'binding': 1, 'binmode': 1, 'block_given?': 1, 'call': 1, 'callcc': 1, 'caller': 1, 'capitalize': 1, 'capitalize!': 1, 'casecmp': 1, 'catch': 1, 'ceil': 1, 'center': 1, 'chomp': 1, 'chomp!': 1, 'chop': 1, 'chop!': 1, 'chr': 1, 'class': 1, 'class_eval': 1, 'class_variable_defined?': 1, 'class_variables': 1, 'clear': 1, 'clone': 1, 'close': 1, 'close_read': 1, 'close_write': 1, 'closed?': 1, 'coerce': 1, 'collect': 1, 'collect!': 1, 'compact': 1, 'compact!': 1, 'concat': 1, 'const_defined?': 1, 'const_get': 1, 'const_missing': 1, 'const_set': 1, 'constants': 1, 'count': 1, 'crypt': 1, 'default': 1, 'default_proc': 1, 'delete': 1, 'delete!': 1, 'delete_at': 1, 'delete_if': 1, 'detect': 1, 'display': 1, 'div': 1, 'divmod': 1, 'downcase': 1, 'downcase!': 1, 'downto': 1, 'dump': 1, 'dup': 1, 'each': 1, 'each_byte': 1, 'each_index': 1, 'each_key': 1, 'each_line': 1, 'each_pair': 1, 'each_value': 1, 'each_with_index': 1, 'empty?': 1, 'entries': 1, 'eof': 1, 'eof?': 1, 'eql?': 1, 'equal?': 1, 'eval': 1, 'exec': 1, 'exit': 1, 'exit!': 1, 'extend': 1, 'fail': 1, 'fcntl': 1, 'fetch': 1, 'fileno': 1, 'fill': 1, 'find': 1, 'find_all': 1, 'first': 1, 'flatten': 1, 'flatten!': 1, 'floor': 1, 'flush': 1, 'for_fd': 1, 'foreach': 1, 'fork': 1, 'format': 1, 'freeze': 1, 'frozen?': 1, 'fsync': 1, 'getc': 1, 'gets': 1, 'global_variables': 1, 'grep': 1, 'gsub': 1, 'gsub!': 1, 'has_key?': 1, 'has_value?': 1, 'hash': 1, 'hex': 1, 'id': 1, 'include?': 1, 'included_modules': 1, 'index': 1, 'indexes': 1, 'indices': 1, 'induced_from': 1, 'inject': 1, 'insert': 1, 'inspect': 1, 'instance_eval': 1, 'instance_method': 1, 'instance_methods': 1, 'instance_of?': 1, 'instance_variable_defined?': 1, 'instance_variable_get': 1, 'instance_variable_set': 1, 'instance_variables': 1, 'integer?': 1, 'intern': 1, 'invert': 1, 'ioctl': 1, 'is_a?': 1, 'isatty': 1, 'iterator?': 1, 'join': 1, 'key?': 1, 'keys': 1, 'kind_of?': 1, 'lambda': 1, 'last': 1, 'length': 1, 'lineno': 1, 'ljust': 1, 'load': 1, 'local_variables': 1, 'loop': 1, 'lstrip': 1, 'lstrip!': 1, 'map': 1, 'map!': 1, 'match': 1, 'max': 1, 'member?': 1, 'merge': 1, 'merge!': 1, 'method': 1, 'method_defined?': 1, 'method_missing': 1, 'methods': 1, 'min': 1, 'module_eval': 1, 'modulo': 1, 'name': 1, 'nesting': 1, 'new': 1, 'next': 1, 'next!': 1, 'nil?': 1, 'nitems': 1, 'nonzero?': 1, 'object_id': 1, 'oct': 1, 'open': 1, 'pack': 1, 'partition': 1, 'pid': 1, 'pipe': 1, 'pop': 1, 'popen': 1, 'pos': 1, 'prec': 1, 'prec_f': 1, 'prec_i': 1, 'print': 1, 'printf': 1, 'private_class_method': 1, 'private_instance_methods': 1, 'private_method_defined?': 1, 'private_methods': 1, 'proc': 1, 'protected_instance_methods': 1, 'protected_method_defined?': 1, 'protected_methods': 1, 'public_class_method': 1, 'public_instance_methods': 1, 'public_method_defined?': 1, 'public_methods': 1, 'push': 1, 'putc': 1, 'puts': 1, 'quo': 1, 'raise': 1, 'rand': 1, 'rassoc': 1, 'read': 1, 'read_nonblock': 1, 'readchar': 1, 'readline': 1, 'readlines': 1, 'readpartial': 1, 'rehash': 1, 'reject': 1, 'reject!': 1, 'remainder': 1, 'reopen': 1, 'replace': 1, 'require': 1, 'respond_to?': 1, 'reverse': 1, 'reverse!': 1, 'reverse_each': 1, 'rewind': 1, 'rindex': 1, 'rjust': 1, 'round': 1, 'rstrip': 1, 'rstrip!': 1, 'scan': 1, 'seek': 1, 'select': 1, 'send': 1, 'set_trace_func': 1, 'shift': 1, 'singleton_method_added': 1, 'singleton_methods': 1, 'size': 1, 'sleep': 1, 'slice': 1, 'slice!': 1, 'sort': 1, 'sort!': 1, 'sort_by': 1, 'split': 1, 'sprintf': 1, 'squeeze': 1, 'squeeze!': 1, 'srand': 1, 'stat': 1, 'step': 1, 'store': 1, 'strip': 1, 'strip!': 1, 'sub': 1, 'sub!': 1, 'succ': 1, 'succ!': 1, 'sum': 1, 'superclass': 1, 'swapcase': 1, 'swapcase!': 1, 'sync': 1, 'syscall': 1, 'sysopen': 1, 'sysread': 1, 'sysseek': 1, 'system': 1, 'syswrite': 1, 'taint': 1, 'tainted?': 1, 'tell': 1, 'test': 1, 'throw': 1, 'times': 1, 'to_a': 1, 'to_ary': 1, 'to_f': 1, 'to_hash': 1, 'to_i': 1, 'to_int': 1, 'to_io': 1, 'to_proc': 1, 'to_s': 1, 'to_str': 1, 'to_sym': 1, 'tr': 1, 'tr!': 1, 'tr_s': 1, 'tr_s!': 1, 'trace_var': 1, 'transpose': 1, 'trap': 1, 'truncate': 1, 'tty?': 1, 'type': 1, 'ungetc': 1, 'uniq': 1, 'uniq!': 1, 'unpack': 1, 'unshift': 1, 'untaint': 1, 'untrace_var': 1, 'upcase': 1, 'upcase!': 1, 'update': 1, 'upto': 1, 'value?': 1, 'values': 1, 'values_at': 1, 'warn': 1, 'write': 1, 'write_nonblock': 1, 'zero?': 1, 'zip': 1}
|
313
|
+
}
|
314
|
+
|
315
|
+
hljs.LANGUAGES.ruby = {
|
316
|
+
defaultMode: {
|
317
|
+
lexems: [hljs.RUBY_IDENT_RE],
|
318
|
+
contains: hljs.RUBY_DEFAULT_CONTAINS,
|
319
|
+
keywords: hljs.RUBY_KEYWORDS
|
320
|
+
},
|
321
|
+
modes: [
|
322
|
+
hljs.HASH_COMMENT_MODE,
|
323
|
+
{
|
324
|
+
className: 'comment',
|
325
|
+
begin: '^\\=begin', end: '^\\=end',
|
326
|
+
relevance: 10
|
327
|
+
},
|
328
|
+
{
|
329
|
+
className: 'comment',
|
330
|
+
begin: '^__END__', end: '\\n$'
|
331
|
+
},
|
332
|
+
{
|
333
|
+
className: 'params',
|
334
|
+
begin: '\\(', end: '\\)',
|
335
|
+
lexems: [hljs.RUBY_IDENT_RE],
|
336
|
+
keywords: hljs.RUBY_KEYWORDS,
|
337
|
+
contains: hljs.RUBY_DEFAULT_CONTAINS
|
338
|
+
},
|
339
|
+
{
|
340
|
+
className: 'function',
|
341
|
+
begin: '\\bdef\\b', end: '$|;',
|
342
|
+
lexems: [hljs.RUBY_IDENT_RE],
|
343
|
+
keywords: hljs.RUBY_KEYWORDS,
|
344
|
+
contains: ['title', 'params', 'comment']
|
345
|
+
},
|
346
|
+
{
|
347
|
+
className: 'class',
|
348
|
+
begin: '\\b(class|module)\\b', end: '$',
|
349
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
350
|
+
keywords: hljs.RUBY_KEYWORDS,
|
351
|
+
contains: ['title', 'inheritance', 'comment'],
|
352
|
+
keywords: {'class': 1, 'module': 1}
|
353
|
+
},
|
354
|
+
{
|
355
|
+
className: 'title',
|
356
|
+
begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?', end: '^',
|
357
|
+
relevance: 0
|
358
|
+
},
|
359
|
+
{
|
360
|
+
className: 'inheritance',
|
361
|
+
begin: '<\\s*', end: '^',
|
362
|
+
contains: ['parent']
|
363
|
+
},
|
364
|
+
{
|
365
|
+
className: 'parent',
|
366
|
+
begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE, end: '^'
|
367
|
+
},
|
368
|
+
{
|
369
|
+
className: 'number',
|
370
|
+
begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b', end: '^',
|
371
|
+
relevance: 0
|
372
|
+
},
|
373
|
+
{
|
374
|
+
className: 'number',
|
375
|
+
begin: '\\?\\w', end: '^'
|
376
|
+
},
|
377
|
+
{
|
378
|
+
className: 'string',
|
379
|
+
begin: '\'', end: '\'',
|
380
|
+
contains: ['escape', 'subst'],
|
381
|
+
relevance: 0
|
382
|
+
},
|
383
|
+
{
|
384
|
+
className: 'string',
|
385
|
+
begin: '"', end: '"',
|
386
|
+
contains: ['escape', 'subst'],
|
387
|
+
relevance: 0
|
388
|
+
},
|
389
|
+
{
|
390
|
+
className: 'string',
|
391
|
+
begin: '%[qw]?\\(', end: '\\)',
|
392
|
+
contains: ['escape', 'subst'],
|
393
|
+
relevance: 10
|
394
|
+
},
|
395
|
+
{
|
396
|
+
className: 'string',
|
397
|
+
begin: '%[qw]?\\[', end: '\\]',
|
398
|
+
contains: ['escape', 'subst'],
|
399
|
+
relevance: 10
|
400
|
+
},
|
401
|
+
{
|
402
|
+
className: 'string',
|
403
|
+
begin: '%[qw]?{', end: '}',
|
404
|
+
contains: ['escape', 'subst'],
|
405
|
+
relevance: 10
|
406
|
+
},
|
407
|
+
{
|
408
|
+
className: 'string',
|
409
|
+
begin: '%[qw]?<', end: '>',
|
410
|
+
contains: ['escape', 'subst'],
|
411
|
+
relevance: 10
|
412
|
+
},
|
413
|
+
{
|
414
|
+
className: 'string',
|
415
|
+
begin: '%[qw]?/', end: '/',
|
416
|
+
contains: ['escape', 'subst'],
|
417
|
+
relevance: 10
|
418
|
+
},
|
419
|
+
{
|
420
|
+
className: 'string',
|
421
|
+
begin: '%[qw]?%', end: '%',
|
422
|
+
contains: ['escape', 'subst'],
|
423
|
+
relevance: 10
|
424
|
+
},
|
425
|
+
{
|
426
|
+
className: 'string',
|
427
|
+
begin: '%[qw]?-', end: '-',
|
428
|
+
contains: ['escape', 'subst'],
|
429
|
+
relevance: 10
|
430
|
+
},
|
431
|
+
{
|
432
|
+
className: 'string',
|
433
|
+
begin: '%[qw]?\\|', end: '\\|',
|
434
|
+
contains: ['escape', 'subst'],
|
435
|
+
relevance: 10
|
436
|
+
},
|
437
|
+
{
|
438
|
+
className: 'symbol',
|
439
|
+
begin: ':' + hljs.RUBY_IDENT_RE, end: '^'
|
440
|
+
},
|
441
|
+
hljs.BACKSLASH_ESCAPE,
|
442
|
+
{
|
443
|
+
className: 'subst',
|
444
|
+
begin: '#\\{', end: '}',
|
445
|
+
lexems: [hljs.RUBY_IDENT_RE],
|
446
|
+
keywords: hljs.RUBY_KEYWORDS,
|
447
|
+
contains: hljs.RUBY_DEFAULT_CONTAINS
|
448
|
+
},
|
449
|
+
{
|
450
|
+
className: 'regexp',
|
451
|
+
begin: '/', end: '/[a-z]*',
|
452
|
+
contains: ['escape'],
|
453
|
+
relevance: 0
|
454
|
+
},
|
455
|
+
{
|
456
|
+
className: 'variable',
|
457
|
+
begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))', end: '^'
|
458
|
+
}
|
459
|
+
]
|
460
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
hljs.LANGUAGES.ini =
|
2
|
+
{
|
3
|
+
case_insensitive: true,
|
4
|
+
defaultMode: {
|
5
|
+
contains: ['comment', 'title', 'setting'],
|
6
|
+
illegal: '[^\\s]'
|
7
|
+
},
|
8
|
+
modes: [
|
9
|
+
{
|
10
|
+
className: 'comment',
|
11
|
+
begin: ';', end: '$'
|
12
|
+
},
|
13
|
+
{
|
14
|
+
className: 'title',
|
15
|
+
begin: '\\[', end: '\\]'
|
16
|
+
},
|
17
|
+
{
|
18
|
+
className: 'setting',
|
19
|
+
begin: '^[a-z]+[ \\t]*=[ \\t]*', end: '$',
|
20
|
+
contains: ['value']
|
21
|
+
},
|
22
|
+
{
|
23
|
+
className: 'value',
|
24
|
+
begin: '^', endsWithParent: true,
|
25
|
+
contains: ['string', 'number'],
|
26
|
+
lexems: [hljs.IDENT_RE],
|
27
|
+
keywords: {'on': 1, 'off': 1, 'true': 1, 'false': 1, 'yes': 1, 'no': 1}
|
28
|
+
},
|
29
|
+
hljs.QUOTE_STRING_MODE,
|
30
|
+
hljs.BACKSLASH_ESCAPE,
|
31
|
+
{
|
32
|
+
className: 'number',
|
33
|
+
begin: '\\d+', end: '^'
|
34
|
+
}
|
35
|
+
]
|
36
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
hljs.LANGUAGES.javascript = {
|
2
|
+
defaultMode: {
|
3
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
4
|
+
contains: ['string', 'comment', 'number', 'regexp', 'function'],
|
5
|
+
keywords: {
|
6
|
+
'keyword': {'in': 1, 'if': 1, 'for': 1, 'while': 1, 'finally': 1, 'var': 1, 'new': 1, 'function': 1, 'do': 1, 'return': 1, 'void': 1, 'else': 1, 'break': 1, 'catch': 1, 'instanceof': 1, 'with': 1, 'throw': 1, 'case': 1, 'default': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'typeof': 1, 'delete': 1},
|
7
|
+
'literal': {'true': 1, 'false': 1, 'null': 1}
|
8
|
+
}
|
9
|
+
},
|
10
|
+
modes: [
|
11
|
+
hljs.C_LINE_COMMENT_MODE,
|
12
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
13
|
+
hljs.C_NUMBER_MODE,
|
14
|
+
hljs.APOS_STRING_MODE,
|
15
|
+
hljs.QUOTE_STRING_MODE,
|
16
|
+
hljs.BACKSLASH_ESCAPE,
|
17
|
+
{
|
18
|
+
className: 'regexp',
|
19
|
+
begin: '/.*?[^\\\\/]/[gim]*', end: '^'
|
20
|
+
},
|
21
|
+
{
|
22
|
+
className: 'function',
|
23
|
+
begin: 'function\\b', end: '{',
|
24
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
25
|
+
keywords: {'function': 1},
|
26
|
+
contains: ['title', 'params']
|
27
|
+
},
|
28
|
+
{
|
29
|
+
className: 'title',
|
30
|
+
begin: '[A-Za-z$_][0-9A-Za-z$_]*', end: '^'
|
31
|
+
},
|
32
|
+
{
|
33
|
+
className: 'params',
|
34
|
+
begin: '\\(', end: '\\)',
|
35
|
+
contains: ['string', 'comment']
|
36
|
+
}
|
37
|
+
]
|
38
|
+
};
|
@@ -0,0 +1,86 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Generic lisp definition (c) Vasily Polovnyov <vast@whiteants.net>
|
4
|
+
|
5
|
+
*/
|
6
|
+
hljs.LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*'
|
7
|
+
hljs.LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?'
|
8
|
+
hljs.LANGUAGES.lisp = {
|
9
|
+
case_insensitive: true,
|
10
|
+
defaultMode: {
|
11
|
+
lexems: [hljs.LISP_IDENT_RE],
|
12
|
+
contains: ['literal', 'number', 'string', 'comment', 'quoted', 'list'],
|
13
|
+
illegal: '[^\\s]'
|
14
|
+
},
|
15
|
+
modes: [
|
16
|
+
hljs.QUOTE_STRING_MODE,
|
17
|
+
{
|
18
|
+
className: 'number',
|
19
|
+
begin: hljs.LISP_SIMPLE_NUMBER_RE, end: '^'
|
20
|
+
},
|
21
|
+
{
|
22
|
+
className: 'number',
|
23
|
+
begin: '#b[0-1]+(/[0-1]+)?', end: '^'
|
24
|
+
},
|
25
|
+
{
|
26
|
+
className: 'number',
|
27
|
+
begin: '#o[0-7]+(/[0-7]+)?', end: '^'
|
28
|
+
},
|
29
|
+
{
|
30
|
+
className: 'number',
|
31
|
+
begin: '#x[0-9a-f]+(/[0-9a-f]+)?', end: '^'
|
32
|
+
},
|
33
|
+
{
|
34
|
+
className: 'number',
|
35
|
+
begin: '#c\\(' + hljs.LISP_SIMPLE_NUMBER_RE + ' +' + hljs.LISP_SIMPLE_NUMBER_RE, end: '\\)'
|
36
|
+
},
|
37
|
+
{
|
38
|
+
className: 'comment',
|
39
|
+
begin: ';', end: '$'
|
40
|
+
},
|
41
|
+
{
|
42
|
+
className: 'quoted',
|
43
|
+
begin: '\\\'\\(', end: '\\)',
|
44
|
+
contains: ['number', 'string', 'variable', 'keyword', 'quoted_list']
|
45
|
+
},
|
46
|
+
{
|
47
|
+
className: 'quoted',
|
48
|
+
begin: '\\(quote ', end: '\\)',
|
49
|
+
contains: ['number', 'string', 'variable', 'keyword', 'quoted_list'],
|
50
|
+
lexems: [hljs.LISP_IDENT_RE],
|
51
|
+
keywords: {'title': {'quote': 1}}
|
52
|
+
},
|
53
|
+
{
|
54
|
+
className: 'quoted_list',
|
55
|
+
begin: '\\(', end: '\\)',
|
56
|
+
contains: ['quoted_list', 'literal', 'number', 'string']
|
57
|
+
},
|
58
|
+
{
|
59
|
+
className: 'list',
|
60
|
+
begin: '\\(', end: '\\)',
|
61
|
+
contains: ['title','body']
|
62
|
+
},
|
63
|
+
{
|
64
|
+
className: 'title',
|
65
|
+
begin: hljs.LISP_IDENT_RE, end: '^',
|
66
|
+
endsWithParent: true
|
67
|
+
},
|
68
|
+
{
|
69
|
+
className: 'body',
|
70
|
+
begin: '^', endsWithParent: true, excludeEnd: true,
|
71
|
+
contains: ['quoted', 'list', 'literal', 'number', 'string', 'comment', 'variable', 'keyword']
|
72
|
+
},
|
73
|
+
{
|
74
|
+
className: 'keyword',
|
75
|
+
begin: '[:&]' + hljs.LISP_IDENT_RE, end: '^'
|
76
|
+
},
|
77
|
+
{
|
78
|
+
className: 'variable',
|
79
|
+
begin: '\\*', end: '\\*'
|
80
|
+
},
|
81
|
+
{
|
82
|
+
className: 'literal',
|
83
|
+
begin: '\\b(t{1}|nil)\\b', end: '^'
|
84
|
+
}
|
85
|
+
]
|
86
|
+
}
|