swagr 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/Rakefile +20 -0
  2. data/bin/swagr +37 -9
  3. data/examples/examples01/app.rb +5 -1
  4. data/examples/examples01/views/edit.slim +31 -0
  5. data/examples/examples01/views/footer.slim +1 -1
  6. data/examples/examples01/views/layout.slim +23 -5
  7. data/examples/examples01/views/navbar.slim +17 -16
  8. data/lib/swagr/version.rb +3 -1
  9. data/templates/app.rb +5 -1
  10. data/templates/static/js/codemirror/keymap/vim.js +279 -66
  11. data/templates/static/js/codemirror/lib/codemirror.css +10 -9
  12. data/templates/static/js/codemirror/lib/codemirror.js +385 -152
  13. data/templates/static/js/codemirror/mode/apl/apl.js +160 -0
  14. data/templates/static/js/codemirror/mode/apl/index.html +61 -0
  15. data/templates/static/js/codemirror/mode/asterisk/asterisk.js +183 -0
  16. data/templates/static/js/codemirror/mode/asterisk/index.html +142 -0
  17. data/templates/static/js/codemirror/mode/clike/clike.js +2 -0
  18. data/templates/static/js/codemirror/mode/clike/index.html +1 -1
  19. data/templates/static/js/codemirror/mode/clike/scala.html +1 -1
  20. data/templates/static/js/codemirror/mode/clojure/clojure.js +3 -3
  21. data/templates/static/js/codemirror/mode/css/css.js +2 -2
  22. data/templates/static/js/codemirror/mode/css/test.js +76 -471
  23. data/templates/static/js/codemirror/mode/d/d.js +205 -0
  24. data/templates/static/js/codemirror/mode/d/index.html +262 -0
  25. data/templates/static/js/codemirror/mode/erlang/index.html +1 -1
  26. data/templates/static/js/codemirror/mode/gfm/gfm.js +2 -1
  27. data/templates/static/js/codemirror/mode/gfm/index.html +1 -2
  28. data/templates/static/js/codemirror/mode/gfm/test.js +84 -225
  29. data/templates/static/js/codemirror/mode/go/index.html +1 -1
  30. data/templates/static/js/codemirror/mode/groovy/index.html +1 -1
  31. data/templates/static/js/codemirror/mode/haskell/index.html +1 -1
  32. data/templates/static/js/codemirror/mode/javascript/index.html +2 -2
  33. data/templates/static/js/codemirror/mode/javascript/javascript.js +13 -2
  34. data/templates/static/js/codemirror/mode/less/index.html +1 -1
  35. data/templates/static/js/codemirror/mode/lua/index.html +1 -1
  36. data/templates/static/js/codemirror/mode/markdown/index.html +1 -1
  37. data/templates/static/js/codemirror/mode/markdown/markdown.js +8 -7
  38. data/templates/static/js/codemirror/mode/markdown/test.js +579 -1266
  39. data/templates/static/js/codemirror/mode/meta.js +71 -0
  40. data/templates/static/js/codemirror/mode/mysql/index.html +2 -0
  41. data/templates/static/js/codemirror/mode/ocaml/index.html +1 -1
  42. data/templates/static/js/codemirror/mode/php/index.html +1 -1
  43. data/templates/static/js/codemirror/mode/plsql/index.html +2 -0
  44. data/templates/static/js/codemirror/mode/python/index.html +1 -1
  45. data/templates/static/js/codemirror/mode/ruby/index.html +1 -1
  46. data/templates/static/js/codemirror/mode/sass/index.html +54 -0
  47. data/templates/static/js/codemirror/mode/sass/sass.js +349 -0
  48. data/templates/static/js/codemirror/mode/shell/index.html +1 -1
  49. data/templates/static/js/codemirror/mode/sieve/LICENSE +0 -4
  50. data/templates/static/js/codemirror/mode/sieve/sieve.js +37 -10
  51. data/templates/static/js/codemirror/mode/smalltalk/index.html +1 -1
  52. data/templates/static/js/codemirror/mode/sparql/index.html +1 -1
  53. data/templates/static/js/codemirror/mode/sql/index.html +68 -0
  54. data/templates/static/js/codemirror/mode/sql/sql.js +268 -0
  55. data/templates/static/js/codemirror/mode/stex/test.js +104 -343
  56. data/templates/static/js/codemirror/mode/tiddlywiki/index.html +1 -1
  57. data/templates/static/js/codemirror/mode/vb/index.html +1 -1
  58. data/templates/static/js/codemirror/mode/xquery/test.js +54 -67
  59. data/templates/static/js/codemirror/mode/xquery/xquery.js +8 -8
  60. data/templates/static/js/crossfilter.min.js +1 -0
  61. data/templates/views/edit.slim +31 -0
  62. data/templates/views/footer.slim +1 -1
  63. data/templates/views/layout.slim +23 -5
  64. data/templates/views/navbar.slim +17 -16
  65. metadata +16 -30
  66. data/examples/examples01/static/css/codemirror.css +0 -1247
  67. data/examples/examples01/static/js/codemirror-compressed-3-0.js +0 -5
  68. data/examples/examples01/views/about.slim +0 -15
  69. data/examples/examples01/views/application.slim +0 -0
  70. data/examples/examples01/views/layout_cm.slim +0 -17
  71. data/templates/static/js/codemirror/lib/util/closetag.js +0 -85
  72. data/templates/static/js/codemirror/lib/util/colorize.js +0 -29
  73. data/templates/static/js/codemirror/lib/util/continuecomment.js +0 -36
  74. data/templates/static/js/codemirror/lib/util/continuelist.js +0 -28
  75. data/templates/static/js/codemirror/lib/util/dialog.css +0 -32
  76. data/templates/static/js/codemirror/lib/util/dialog.js +0 -75
  77. data/templates/static/js/codemirror/lib/util/foldcode.js +0 -182
  78. data/templates/static/js/codemirror/lib/util/formatting.js +0 -108
  79. data/templates/static/js/codemirror/lib/util/javascript-hint.js +0 -137
  80. data/templates/static/js/codemirror/lib/util/loadmode.js +0 -51
  81. data/templates/static/js/codemirror/lib/util/match-highlighter.js +0 -46
  82. data/templates/static/js/codemirror/lib/util/matchbrackets.js +0 -63
  83. data/templates/static/js/codemirror/lib/util/multiplex.js +0 -95
  84. data/templates/static/js/codemirror/lib/util/overlay.js +0 -59
  85. data/templates/static/js/codemirror/lib/util/pig-hint.js +0 -117
  86. data/templates/static/js/codemirror/lib/util/runmode-standalone.js +0 -90
  87. data/templates/static/js/codemirror/lib/util/runmode.js +0 -52
  88. data/templates/static/js/codemirror/lib/util/search.js +0 -119
  89. data/templates/static/js/codemirror/lib/util/searchcursor.js +0 -119
  90. data/templates/static/js/codemirror/lib/util/simple-hint.css +0 -16
  91. data/templates/static/js/codemirror/lib/util/simple-hint.js +0 -102
  92. data/templates/static/js/codemirror/lib/util/xml-hint.js +0 -131
  93. data/templates/views/about.slim +0 -15
@@ -1,343 +1,104 @@
1
- var MT = ModeTest;
2
- MT.modeName = 'stex';
3
- MT.modeOptions = {};
4
-
5
- MT.testMode(
6
- 'word',
7
- 'foo',
8
- [
9
- null, 'foo'
10
- ]
11
- );
12
-
13
- MT.testMode(
14
- 'twoWords',
15
- 'foo bar',
16
- [
17
- null, 'foo bar'
18
- ]
19
- );
20
-
21
- MT.testMode(
22
- 'beginEndDocument',
23
- '\\begin{document}\n\\end{document}',
24
- [
25
- 'tag', '\\begin',
26
- 'bracket', '{',
27
- 'atom', 'document',
28
- 'bracket', '}',
29
- 'tag', '\\end',
30
- 'bracket', '{',
31
- 'atom', 'document',
32
- 'bracket', '}'
33
- ]
34
- );
35
-
36
- MT.testMode(
37
- 'beginEndEquation',
38
- '\\begin{equation}\n E=mc^2\n\\end{equation}',
39
- [
40
- 'tag', '\\begin',
41
- 'bracket', '{',
42
- 'atom', 'equation',
43
- 'bracket', '}',
44
- null, ' E=mc^2',
45
- 'tag', '\\end',
46
- 'bracket', '{',
47
- 'atom', 'equation',
48
- 'bracket', '}'
49
- ]
50
- );
51
-
52
- MT.testMode(
53
- 'beginModule',
54
- '\\begin{module}[]',
55
- [
56
- 'tag', '\\begin',
57
- 'bracket', '{',
58
- 'atom', 'module',
59
- 'bracket', '}[]'
60
- ]
61
- );
62
-
63
- MT.testMode(
64
- 'beginModuleId',
65
- '\\begin{module}[id=bbt-size]',
66
- [
67
- 'tag', '\\begin',
68
- 'bracket', '{',
69
- 'atom', 'module',
70
- 'bracket', '}[',
71
- null, 'id=bbt-size',
72
- 'bracket', ']'
73
- ]
74
- );
75
-
76
- MT.testMode(
77
- 'importModule',
78
- '\\importmodule[b-b-t]{b-b-t}',
79
- [
80
- 'tag', '\\importmodule',
81
- 'bracket', '[',
82
- 'string', 'b-b-t',
83
- 'bracket', ']{',
84
- 'builtin', 'b-b-t',
85
- 'bracket', '}'
86
- ]
87
- );
88
-
89
- MT.testMode(
90
- 'importModulePath',
91
- '\\importmodule[\\KWARCslides{dmath/en/cardinality}]{card}',
92
- [
93
- 'tag', '\\importmodule',
94
- 'bracket', '[',
95
- 'tag', '\\KWARCslides',
96
- 'bracket', '{',
97
- 'string', 'dmath/en/cardinality',
98
- 'bracket', '}]{',
99
- 'builtin', 'card',
100
- 'bracket', '}'
101
- ]
102
- );
103
-
104
- MT.testMode(
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="../../lib/util/matchbrackets.js"></script>
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">