swagr 0.0.8 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +20 -0
- data/bin/swagr +37 -9
- data/examples/examples01/app.rb +5 -1
- data/examples/examples01/views/edit.slim +31 -0
- data/examples/examples01/views/footer.slim +1 -1
- data/examples/examples01/views/layout.slim +23 -5
- data/examples/examples01/views/navbar.slim +17 -16
- data/lib/swagr/version.rb +3 -1
- data/templates/app.rb +5 -1
- data/templates/static/js/codemirror/keymap/vim.js +279 -66
- data/templates/static/js/codemirror/lib/codemirror.css +10 -9
- data/templates/static/js/codemirror/lib/codemirror.js +385 -152
- data/templates/static/js/codemirror/mode/apl/apl.js +160 -0
- data/templates/static/js/codemirror/mode/apl/index.html +61 -0
- data/templates/static/js/codemirror/mode/asterisk/asterisk.js +183 -0
- data/templates/static/js/codemirror/mode/asterisk/index.html +142 -0
- data/templates/static/js/codemirror/mode/clike/clike.js +2 -0
- data/templates/static/js/codemirror/mode/clike/index.html +1 -1
- data/templates/static/js/codemirror/mode/clike/scala.html +1 -1
- data/templates/static/js/codemirror/mode/clojure/clojure.js +3 -3
- data/templates/static/js/codemirror/mode/css/css.js +2 -2
- data/templates/static/js/codemirror/mode/css/test.js +76 -471
- data/templates/static/js/codemirror/mode/d/d.js +205 -0
- data/templates/static/js/codemirror/mode/d/index.html +262 -0
- data/templates/static/js/codemirror/mode/erlang/index.html +1 -1
- data/templates/static/js/codemirror/mode/gfm/gfm.js +2 -1
- data/templates/static/js/codemirror/mode/gfm/index.html +1 -2
- data/templates/static/js/codemirror/mode/gfm/test.js +84 -225
- data/templates/static/js/codemirror/mode/go/index.html +1 -1
- data/templates/static/js/codemirror/mode/groovy/index.html +1 -1
- data/templates/static/js/codemirror/mode/haskell/index.html +1 -1
- data/templates/static/js/codemirror/mode/javascript/index.html +2 -2
- data/templates/static/js/codemirror/mode/javascript/javascript.js +13 -2
- data/templates/static/js/codemirror/mode/less/index.html +1 -1
- data/templates/static/js/codemirror/mode/lua/index.html +1 -1
- data/templates/static/js/codemirror/mode/markdown/index.html +1 -1
- data/templates/static/js/codemirror/mode/markdown/markdown.js +8 -7
- data/templates/static/js/codemirror/mode/markdown/test.js +579 -1266
- data/templates/static/js/codemirror/mode/meta.js +71 -0
- data/templates/static/js/codemirror/mode/mysql/index.html +2 -0
- data/templates/static/js/codemirror/mode/ocaml/index.html +1 -1
- data/templates/static/js/codemirror/mode/php/index.html +1 -1
- data/templates/static/js/codemirror/mode/plsql/index.html +2 -0
- data/templates/static/js/codemirror/mode/python/index.html +1 -1
- data/templates/static/js/codemirror/mode/ruby/index.html +1 -1
- data/templates/static/js/codemirror/mode/sass/index.html +54 -0
- data/templates/static/js/codemirror/mode/sass/sass.js +349 -0
- data/templates/static/js/codemirror/mode/shell/index.html +1 -1
- data/templates/static/js/codemirror/mode/sieve/LICENSE +0 -4
- data/templates/static/js/codemirror/mode/sieve/sieve.js +37 -10
- data/templates/static/js/codemirror/mode/smalltalk/index.html +1 -1
- data/templates/static/js/codemirror/mode/sparql/index.html +1 -1
- data/templates/static/js/codemirror/mode/sql/index.html +68 -0
- data/templates/static/js/codemirror/mode/sql/sql.js +268 -0
- data/templates/static/js/codemirror/mode/stex/test.js +104 -343
- data/templates/static/js/codemirror/mode/tiddlywiki/index.html +1 -1
- data/templates/static/js/codemirror/mode/vb/index.html +1 -1
- data/templates/static/js/codemirror/mode/xquery/test.js +54 -67
- data/templates/static/js/codemirror/mode/xquery/xquery.js +8 -8
- data/templates/static/js/crossfilter.min.js +1 -0
- data/templates/views/edit.slim +31 -0
- data/templates/views/footer.slim +1 -1
- data/templates/views/layout.slim +23 -5
- data/templates/views/navbar.slim +17 -16
- metadata +16 -30
- data/examples/examples01/static/css/codemirror.css +0 -1247
- data/examples/examples01/static/js/codemirror-compressed-3-0.js +0 -5
- data/examples/examples01/views/about.slim +0 -15
- data/examples/examples01/views/application.slim +0 -0
- data/examples/examples01/views/layout_cm.slim +0 -17
- data/templates/static/js/codemirror/lib/util/closetag.js +0 -85
- data/templates/static/js/codemirror/lib/util/colorize.js +0 -29
- data/templates/static/js/codemirror/lib/util/continuecomment.js +0 -36
- data/templates/static/js/codemirror/lib/util/continuelist.js +0 -28
- data/templates/static/js/codemirror/lib/util/dialog.css +0 -32
- data/templates/static/js/codemirror/lib/util/dialog.js +0 -75
- data/templates/static/js/codemirror/lib/util/foldcode.js +0 -182
- data/templates/static/js/codemirror/lib/util/formatting.js +0 -108
- data/templates/static/js/codemirror/lib/util/javascript-hint.js +0 -137
- data/templates/static/js/codemirror/lib/util/loadmode.js +0 -51
- data/templates/static/js/codemirror/lib/util/match-highlighter.js +0 -46
- data/templates/static/js/codemirror/lib/util/matchbrackets.js +0 -63
- data/templates/static/js/codemirror/lib/util/multiplex.js +0 -95
- data/templates/static/js/codemirror/lib/util/overlay.js +0 -59
- data/templates/static/js/codemirror/lib/util/pig-hint.js +0 -117
- data/templates/static/js/codemirror/lib/util/runmode-standalone.js +0 -90
- data/templates/static/js/codemirror/lib/util/runmode.js +0 -52
- data/templates/static/js/codemirror/lib/util/search.js +0 -119
- data/templates/static/js/codemirror/lib/util/searchcursor.js +0 -119
- data/templates/static/js/codemirror/lib/util/simple-hint.css +0 -16
- data/templates/static/js/codemirror/lib/util/simple-hint.js +0 -102
- data/templates/static/js/codemirror/lib/util/xml-hint.js +0 -131
- data/templates/views/about.slim +0 -15
@@ -1,343 +1,104 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
MT.
|
4
|
-
|
5
|
-
MT
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
);
|
62
|
-
|
63
|
-
MT
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
'psForPDF',
|
106
|
-
'\\PSforPDF[1]{#1}', // could treat #1 specially
|
107
|
-
[
|
108
|
-
'tag', '\\PSforPDF',
|
109
|
-
'bracket', '[',
|
110
|
-
'atom', '1',
|
111
|
-
'bracket', ']{',
|
112
|
-
null, '#1',
|
113
|
-
'bracket', '}'
|
114
|
-
]
|
115
|
-
);
|
116
|
-
|
117
|
-
MT.testMode(
|
118
|
-
'comment',
|
119
|
-
'% foo',
|
120
|
-
[
|
121
|
-
'comment', '% foo'
|
122
|
-
]
|
123
|
-
);
|
124
|
-
|
125
|
-
MT.testMode(
|
126
|
-
'tagComment',
|
127
|
-
'\\item% bar',
|
128
|
-
[
|
129
|
-
'tag', '\\item',
|
130
|
-
'comment', '% bar'
|
131
|
-
]
|
132
|
-
);
|
133
|
-
|
134
|
-
MT.testMode(
|
135
|
-
'commentTag',
|
136
|
-
' % \\item',
|
137
|
-
[
|
138
|
-
null, ' ',
|
139
|
-
'comment', '% \\item'
|
140
|
-
]
|
141
|
-
);
|
142
|
-
|
143
|
-
MT.testMode(
|
144
|
-
'commentLineBreak',
|
145
|
-
'%\nfoo',
|
146
|
-
[
|
147
|
-
'comment', '%',
|
148
|
-
null, 'foo'
|
149
|
-
]
|
150
|
-
);
|
151
|
-
|
152
|
-
MT.testMode(
|
153
|
-
'tagErrorCurly',
|
154
|
-
'\\begin}{',
|
155
|
-
[
|
156
|
-
'tag', '\\begin',
|
157
|
-
'error', '}',
|
158
|
-
'bracket', '{'
|
159
|
-
]
|
160
|
-
);
|
161
|
-
|
162
|
-
MT.testMode(
|
163
|
-
'tagErrorSquare',
|
164
|
-
'\\item]{',
|
165
|
-
[
|
166
|
-
'tag', '\\item',
|
167
|
-
'error', ']',
|
168
|
-
'bracket', '{'
|
169
|
-
]
|
170
|
-
);
|
171
|
-
|
172
|
-
MT.testMode(
|
173
|
-
'commentCurly',
|
174
|
-
'% }',
|
175
|
-
[
|
176
|
-
'comment', '% }'
|
177
|
-
]
|
178
|
-
);
|
179
|
-
|
180
|
-
MT.testMode(
|
181
|
-
'tagHash',
|
182
|
-
'the \\# key',
|
183
|
-
[
|
184
|
-
null, 'the ',
|
185
|
-
'tag', '\\#',
|
186
|
-
null, ' key'
|
187
|
-
]
|
188
|
-
);
|
189
|
-
|
190
|
-
MT.testMode(
|
191
|
-
'tagNumber',
|
192
|
-
'a \\$5 stetson',
|
193
|
-
[
|
194
|
-
null, 'a ',
|
195
|
-
'tag', '\\$',
|
196
|
-
'atom', 5,
|
197
|
-
null, ' stetson'
|
198
|
-
]
|
199
|
-
);
|
200
|
-
|
201
|
-
MT.testMode(
|
202
|
-
'tagPercent',
|
203
|
-
'100\\% beef',
|
204
|
-
[
|
205
|
-
'atom', '100',
|
206
|
-
'tag', '\\%',
|
207
|
-
null, ' beef'
|
208
|
-
]
|
209
|
-
);
|
210
|
-
|
211
|
-
MT.testMode(
|
212
|
-
'tagAmpersand',
|
213
|
-
'L \\& N',
|
214
|
-
[
|
215
|
-
null, 'L ',
|
216
|
-
'tag', '\\&',
|
217
|
-
null, ' N'
|
218
|
-
]
|
219
|
-
);
|
220
|
-
|
221
|
-
MT.testMode(
|
222
|
-
'tagUnderscore',
|
223
|
-
'foo\\_bar',
|
224
|
-
[
|
225
|
-
null, 'foo',
|
226
|
-
'tag', '\\_',
|
227
|
-
null, 'bar'
|
228
|
-
]
|
229
|
-
);
|
230
|
-
|
231
|
-
MT.testMode(
|
232
|
-
'tagBracketOpen',
|
233
|
-
'\\emph{\\{}',
|
234
|
-
[
|
235
|
-
'tag', '\\emph',
|
236
|
-
'bracket', '{',
|
237
|
-
'tag', '\\{',
|
238
|
-
'bracket', '}'
|
239
|
-
]
|
240
|
-
);
|
241
|
-
|
242
|
-
MT.testMode(
|
243
|
-
'tagBracketClose',
|
244
|
-
'\\emph{\\}}',
|
245
|
-
[
|
246
|
-
'tag', '\\emph',
|
247
|
-
'bracket', '{',
|
248
|
-
'tag', '\\}',
|
249
|
-
'bracket', '}'
|
250
|
-
]
|
251
|
-
);
|
252
|
-
|
253
|
-
MT.testMode(
|
254
|
-
'tagLetterNumber',
|
255
|
-
'section \\S1',
|
256
|
-
[
|
257
|
-
null, 'section ',
|
258
|
-
'tag', '\\S',
|
259
|
-
'atom', '1'
|
260
|
-
]
|
261
|
-
);
|
262
|
-
|
263
|
-
MT.testMode(
|
264
|
-
'textTagNumber',
|
265
|
-
'para \\P2',
|
266
|
-
[
|
267
|
-
null, 'para ',
|
268
|
-
'tag', '\\P',
|
269
|
-
'atom', '2'
|
270
|
-
]
|
271
|
-
);
|
272
|
-
|
273
|
-
MT.testMode(
|
274
|
-
'thinspace',
|
275
|
-
'x\\,y', // thinspace
|
276
|
-
[
|
277
|
-
null, 'x',
|
278
|
-
'tag', '\\,',
|
279
|
-
null, 'y'
|
280
|
-
]
|
281
|
-
);
|
282
|
-
|
283
|
-
MT.testMode(
|
284
|
-
'thickspace',
|
285
|
-
'x\\;y', // thickspace
|
286
|
-
[
|
287
|
-
null, 'x',
|
288
|
-
'tag', '\\;',
|
289
|
-
null, 'y'
|
290
|
-
]
|
291
|
-
);
|
292
|
-
|
293
|
-
MT.testMode(
|
294
|
-
'negativeThinspace',
|
295
|
-
'x\\!y', // negative thinspace
|
296
|
-
[
|
297
|
-
null, 'x',
|
298
|
-
'tag', '\\!',
|
299
|
-
null, 'y'
|
300
|
-
]
|
301
|
-
);
|
302
|
-
|
303
|
-
MT.testMode(
|
304
|
-
'periodNotSentence',
|
305
|
-
'J.\\ L.\\ is', // period not ending a sentence
|
306
|
-
[
|
307
|
-
null, 'J.\\ L.\\ is'
|
308
|
-
]
|
309
|
-
); // maybe could be better
|
310
|
-
|
311
|
-
MT.testMode(
|
312
|
-
'periodSentence',
|
313
|
-
'X\\@. The', // period ending a sentence
|
314
|
-
[
|
315
|
-
null, 'X',
|
316
|
-
'tag', '\\@',
|
317
|
-
null, '. The'
|
318
|
-
]
|
319
|
-
);
|
320
|
-
|
321
|
-
MT.testMode(
|
322
|
-
'italicCorrection',
|
323
|
-
'{\\em If\\/} I', // italic correction
|
324
|
-
[
|
325
|
-
'bracket', '{',
|
326
|
-
'tag', '\\em',
|
327
|
-
null, ' If',
|
328
|
-
'tag', '\\/',
|
329
|
-
'bracket', '}',
|
330
|
-
null, ' I'
|
331
|
-
]
|
332
|
-
);
|
333
|
-
|
334
|
-
MT.testMode(
|
335
|
-
'tagBracket',
|
336
|
-
'\\newcommand{\\pop}',
|
337
|
-
[
|
338
|
-
'tag', '\\newcommand',
|
339
|
-
'bracket', '{',
|
340
|
-
'tag', '\\pop',
|
341
|
-
'bracket', '}'
|
342
|
-
]
|
343
|
-
);
|
1
|
+
(function() {
|
2
|
+
var mode = CodeMirror.getMode({tabSize: 4}, "stex");
|
3
|
+
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
|
4
|
+
|
5
|
+
MT("word",
|
6
|
+
"foo");
|
7
|
+
|
8
|
+
MT("twoWords",
|
9
|
+
"foo bar");
|
10
|
+
|
11
|
+
MT("beginEndDocument",
|
12
|
+
"[tag \\begin][bracket {][atom document][bracket }]",
|
13
|
+
"[tag \\end][bracket {][atom document][bracket }]");
|
14
|
+
|
15
|
+
MT("beginEndEquation",
|
16
|
+
"[tag \\begin][bracket {][atom equation][bracket }]",
|
17
|
+
" E=mc^2",
|
18
|
+
"[tag \\end][bracket {][atom equation][bracket }]");
|
19
|
+
|
20
|
+
MT("beginModule",
|
21
|
+
"[tag \\begin][bracket {][atom module][bracket }[[]]]");
|
22
|
+
|
23
|
+
MT("beginModuleId",
|
24
|
+
"[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]");
|
25
|
+
|
26
|
+
MT("importModule",
|
27
|
+
"[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]");
|
28
|
+
|
29
|
+
MT("importModulePath",
|
30
|
+
"[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]");
|
31
|
+
|
32
|
+
MT("psForPDF",
|
33
|
+
"[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]");
|
34
|
+
|
35
|
+
MT("comment",
|
36
|
+
"[comment % foo]");
|
37
|
+
|
38
|
+
MT("tagComment",
|
39
|
+
"[tag \\item][comment % bar]");
|
40
|
+
|
41
|
+
MT("commentTag",
|
42
|
+
" [comment % \\item]");
|
43
|
+
|
44
|
+
MT("commentLineBreak",
|
45
|
+
"[comment %]",
|
46
|
+
"foo");
|
47
|
+
|
48
|
+
MT("tagErrorCurly",
|
49
|
+
"[tag \\begin][error }][bracket {]");
|
50
|
+
|
51
|
+
MT("tagErrorSquare",
|
52
|
+
"[tag \\item][error ]]][bracket {]");
|
53
|
+
|
54
|
+
MT("commentCurly",
|
55
|
+
"[comment % }]");
|
56
|
+
|
57
|
+
MT("tagHash",
|
58
|
+
"the [tag \\#] key");
|
59
|
+
|
60
|
+
MT("tagNumber",
|
61
|
+
"a [tag \\$][atom 5] stetson");
|
62
|
+
|
63
|
+
MT("tagPercent",
|
64
|
+
"[atom 100][tag \\%] beef");
|
65
|
+
|
66
|
+
MT("tagAmpersand",
|
67
|
+
"L [tag \\&] N");
|
68
|
+
|
69
|
+
MT("tagUnderscore",
|
70
|
+
"foo[tag \\_]bar");
|
71
|
+
|
72
|
+
MT("tagBracketOpen",
|
73
|
+
"[tag \\emph][bracket {][tag \\{][bracket }]");
|
74
|
+
|
75
|
+
MT("tagBracketClose",
|
76
|
+
"[tag \\emph][bracket {][tag \\}][bracket }]");
|
77
|
+
|
78
|
+
MT("tagLetterNumber",
|
79
|
+
"section [tag \\S][atom 1]");
|
80
|
+
|
81
|
+
MT("textTagNumber",
|
82
|
+
"para [tag \\P][atom 2]");
|
83
|
+
|
84
|
+
MT("thinspace",
|
85
|
+
"x[tag \\,]y");
|
86
|
+
|
87
|
+
MT("thickspace",
|
88
|
+
"x[tag \\;]y");
|
89
|
+
|
90
|
+
MT("negativeThinspace",
|
91
|
+
"x[tag \\!]y");
|
92
|
+
|
93
|
+
MT("periodNotSentence",
|
94
|
+
"J.\\ L.\\ is");
|
95
|
+
|
96
|
+
MT("periodSentence",
|
97
|
+
"X[tag \\@]. The");
|
98
|
+
|
99
|
+
MT("italicCorrection",
|
100
|
+
"[bracket {][tag \\em] If[tag \\/][bracket }] I");
|
101
|
+
|
102
|
+
MT("tagBracket",
|
103
|
+
"[tag \\newcommand][bracket {][tag \\pop][bracket }]");
|
104
|
+
})();
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<title>CodeMirror: TiddlyWiki mode</title>
|
6
6
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7
7
|
<script src="../../lib/codemirror.js"></script>
|
8
|
-
<script src="../../
|
8
|
+
<script src="../../addon/edit/matchbrackets.js"></script>
|
9
9
|
<script src="tiddlywiki.js"></script>
|
10
10
|
<link rel="stylesheet" href="tiddlywiki.css">
|
11
11
|
<link rel="stylesheet" href="../../doc/docs.css">
|