Browse Source

New language highlight: markdown

Simon Vieille 2 months ago
parent
commit
f6136404c9
No known key found for this signature in database

+ 1
- 0
app/locales/cn.yml View File

@@ -98,6 +98,7 @@ form:
98 98
             php: 'PHP'
99 99
             sql: 'SQL'
100 100
             yaml: 'YAML'
101
+            markdown: 'MARKDOWN'
101 102
             perl: 'PERL'
102 103
             c: 'C/C++'
103 104
             asp: 'ASP'

+ 1
- 0
app/locales/de.yml View File

@@ -98,6 +98,7 @@ form:
98 98
             php: 'PHP'
99 99
             sql: 'SQL'
100 100
             yaml: 'YAML'
101
+            markdown: 'MARKDOWN'
101 102
             perl: 'PERL'
102 103
             c: 'C/C++'
103 104
             asp: 'ASP'

+ 1
- 0
app/locales/en.yml View File

@@ -99,6 +99,7 @@ form:
99 99
             php: 'PHP'
100 100
             sql: 'SQL'
101 101
             yaml: 'YAML'
102
+            markdown: 'MARKDOWN'
102 103
             perl: 'PERL'
103 104
             c: 'C/C++'
104 105
             asp: 'ASP'

+ 1
- 0
app/locales/es.yml View File

@@ -98,6 +98,7 @@ form:
98 98
             php: 'PHP'
99 99
             sql: 'SQL'
100 100
             yaml: 'YAML'
101
+            markdown: 'MARKDOWN'
101 102
             perl: 'PERL'
102 103
             c: 'C/C++'
103 104
             asp: 'ASP'

+ 1
- 0
app/locales/fr.yml View File

@@ -98,6 +98,7 @@ form:
98 98
             php: 'PHP'
99 99
             sql: 'SQL'
100 100
             yaml: 'YAML'
101
+            markdown: 'MARKDOWN'
101 102
             perl: 'PERL'
102 103
             c: 'C/C++'
103 104
             asp: 'ASP'

+ 1
- 0
app/locales/pl.yml View File

@@ -99,6 +99,7 @@ form:
99 99
             php: 'PHP'
100 100
             sql: 'SQL'
101 101
             yaml: 'YAML'
102
+            markdown: 'MARKDOWN'
102 103
             perl: 'PERL'
103 104
             c: 'C/C++'
104 105
             asp: 'ASP'

+ 1
- 0
src/Gist/Form/CreateGistForm.php View File

@@ -97,6 +97,7 @@ class CreateGistForm extends AbstractForm
97 97
             'sql' => '',
98 98
             'xml' => '',
99 99
             'yaml' => '',
100
+            'markdown' => '',
100 101
             'perl' => '',
101 102
             'c' => '',
102 103
             'asp' => '',

+ 1
- 0
src/Gist/Model/Gist.php View File

@@ -75,6 +75,7 @@ class Gist extends BaseGist
75 75
             'bash' => 'sh',
76 76
             'actionscript3' => 'as',
77 77
             'text' => 'txt',
78
+            'markdown' => 'md',
78 79
         );
79 80
 
80 81
         return str_replace(array_keys($data), array_values($data), $this->getType());

+ 14
- 245
web/app/css/prism.css View File

@@ -1,4 +1,5 @@
1
-/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+actionscript+c+aspnet+bash+cpp+csharp+css-extras+diff+perl+php+php-extras+python+sql+yaml&plugins=line-highlight+line-numbers+autolinker+previewer-base+previewer-color+previewer-gradient+previewer-easing+previewer-time+previewer-angle */
1
+/* PrismJS 1.15.0
2
+https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+actionscript+c+csharp+bash+cpp+aspnet+css-extras+diff+markup-templating+markdown+perl+php+php-extras+sql+python+yaml&plugins=line-highlight+line-numbers+autolinker */
2 3
 /**
3 4
  * prism.js default theme for JavaScript, CSS and HTML
4 5
  * Based on dabblet (http://dabblet.com)
@@ -105,7 +106,7 @@ pre[class*="language-"] {
105 106
 .token.url,
106 107
 .language-css .token.string,
107 108
 .style .token.string {
108
-	color: #a67f59;
109
+	color: #9a6e3a;
109 110
 	background: hsla(0, 0%, 100%, .5);
110 111
 }
111 112
 
@@ -115,7 +116,8 @@ pre[class*="language-"] {
115 116
 	color: #07a;
116 117
 }
117 118
 
118
-.token.function {
119
+.token.function,
120
+.token.class-name {
119 121
 	color: #DD4A68;
120 122
 }
121 123
 
@@ -182,15 +184,20 @@ pre[data-line] {
182 184
 		bottom: .4em;
183 185
 	}
184 186
 
185
-pre.line-numbers {
187
+.line-numbers .line-highlight:before,
188
+.line-numbers .line-highlight:after {
189
+	content: none;
190
+}
191
+
192
+pre[class*="language-"].line-numbers {
186 193
 	position: relative;
187 194
 	padding-left: 3.8em;
188 195
 	counter-reset: linenumber;
189 196
 }
190 197
 
191
-pre.line-numbers > code {
198
+pre[class*="language-"].line-numbers > code {
192 199
 	position: relative;
193
-    white-space: inherit;
200
+	white-space: inherit;
194 201
 }
195 202
 
196 203
 .line-numbers .line-numbers-rows {
@@ -223,245 +230,7 @@ pre.line-numbers > code {
223 230
 			padding-right: 0.8em;
224 231
 			text-align: right;
225 232
 		}
233
+
226 234
 .token a {
227 235
 	color: inherit;
228 236
 }
229
-.prism-previewer,
230
-.prism-previewer:before,
231
-.prism-previewer:after {
232
-	position: absolute;
233
-	pointer-events: none;
234
-}
235
-.prism-previewer,
236
-.prism-previewer:after {
237
-	left: 50%;
238
-}
239
-.prism-previewer {
240
-	margin-top: -48px;
241
-	width: 32px;
242
-	height: 32px;
243
-	margin-left: -16px;
244
-
245
-	opacity: 0;
246
-	-webkit-transition: opacity .25s;
247
-	-o-transition: opacity .25s;
248
-	transition: opacity .25s;
249
-}
250
-.prism-previewer.flipped {
251
-	margin-top: 0;
252
-	margin-bottom: -48px;
253
-}
254
-.prism-previewer:before,
255
-.prism-previewer:after {
256
-	content: '';
257
-	position: absolute;
258
-	pointer-events: none;
259
-}
260
-.prism-previewer:before {
261
-	top: -5px;
262
-	right: -5px;
263
-	left: -5px;
264
-	bottom: -5px;
265
-	border-radius: 10px;
266
-	border: 5px solid #fff;
267
-	box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75);
268
-}
269
-
270
-.prism-previewer:after {
271
-	top: 100%;
272
-	width: 0;
273
-	height: 0;
274
-	margin: 5px 0 0 -7px;
275
-	border: 7px solid transparent;
276
-	border-color: rgba(255, 0, 0, 0);
277
-	border-top-color: #fff;
278
-}
279
-.prism-previewer.flipped:after {
280
-	top: auto;
281
-	bottom: 100%;
282
-	margin-top: 0;
283
-	margin-bottom: 5px;
284
-	border-top-color: rgba(255, 0, 0, 0);
285
-	border-bottom-color: #fff;
286
-}
287
-.prism-previewer.active {
288
-	opacity: 1;
289
-}
290
-.prism-previewer-color {
291
-	background-image: linear-gradient(45deg, #bbb 25%, transparent 25%, transparent 75%, #bbb 75%, #bbb), linear-gradient(45deg, #bbb 25%, #eee 25%, #eee 75%, #bbb 75%, #bbb);
292
-	background-size: 10px 10px;
293
-	background-position: 0 0, 5px 5px;
294
-}
295
-.prism-previewer-color:before {
296
-	background-color: inherit;
297
-	background-clip: padding-box;
298
-}
299
-
300
-.prism-previewer-gradient {
301
-	background-image: linear-gradient(45deg, #bbb 25%, transparent 25%, transparent 75%, #bbb 75%, #bbb), linear-gradient(45deg, #bbb 25%, #eee 25%, #eee 75%, #bbb 75%, #bbb);
302
-	background-size: 10px 10px;
303
-	background-position: 0 0, 5px 5px;
304
-
305
-	width: 64px;
306
-	margin-left: -32px;
307
-}
308
-.prism-previewer-gradient:before {
309
-	content: none;
310
-}
311
-.prism-previewer-gradient div {
312
-	position: absolute;
313
-	top: -5px;
314
-	left: -5px;
315
-	right: -5px;
316
-	bottom: -5px;
317
-	border-radius: 10px;
318
-	border: 5px solid #fff;
319
-	box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75);
320
-}
321
-.prism-previewer-easing {
322
-	margin-top: -76px;
323
-	margin-left: -30px;
324
-	width: 60px;
325
-	height: 60px;
326
-	background: #333;
327
-}
328
-.prism-previewer-easing.flipped {
329
-	margin-bottom: -116px;
330
-}
331
-.prism-previewer-easing svg {
332
-	width: 60px;
333
-	height: 60px;
334
-}
335
-.prism-previewer-easing circle {
336
-	fill: hsl(200, 10%, 20%);
337
-	stroke: white;
338
-}
339
-.prism-previewer-easing path {
340
-	fill: none;
341
-	stroke: white;
342
-	stroke-linecap: round;
343
-	stroke-width: 4;
344
-}
345
-.prism-previewer-easing line {
346
-	stroke: white;
347
-	stroke-opacity: 0.5;
348
-	stroke-width: 2;
349
-}
350
-@-webkit-keyframes prism-previewer-time {
351
-	0% {
352
-		stroke-dasharray: 0, 500;
353
-		stroke-dashoffset: 0;
354
-	}
355
-	50% {
356
-		stroke-dasharray: 100, 500;
357
-		stroke-dashoffset: 0;
358
-	}
359
-	100% {
360
-		stroke-dasharray: 0, 500;
361
-		stroke-dashoffset: -100;
362
-	}
363
-}
364
-
365
-@-o-keyframes prism-previewer-time {
366
-	0% {
367
-		stroke-dasharray: 0, 500;
368
-		stroke-dashoffset: 0;
369
-	}
370
-	50% {
371
-		stroke-dasharray: 100, 500;
372
-		stroke-dashoffset: 0;
373
-	}
374
-	100% {
375
-		stroke-dasharray: 0, 500;
376
-		stroke-dashoffset: -100;
377
-	}
378
-}
379
-
380
-@-moz-keyframes prism-previewer-time {
381
-	0% {
382
-		stroke-dasharray: 0, 500;
383
-		stroke-dashoffset: 0;
384
-	}
385
-	50% {
386
-		stroke-dasharray: 100, 500;
387
-		stroke-dashoffset: 0;
388
-	}
389
-	100% {
390
-		stroke-dasharray: 0, 500;
391
-		stroke-dashoffset: -100;
392
-	}
393
-}
394
-
395
-@keyframes prism-previewer-time {
396
-	0% {
397
-		stroke-dasharray: 0, 500;
398
-		stroke-dashoffset: 0;
399
-	}
400
-	50% {
401
-		stroke-dasharray: 100, 500;
402
-		stroke-dashoffset: 0;
403
-	}
404
-	100% {
405
-		stroke-dasharray: 0, 500;
406
-		stroke-dashoffset: -100;
407
-	}
408
-}
409
-
410
-.prism-previewer-time:before {
411
-	border-radius: 50%;
412
-	background: #fff;
413
-}
414
-.prism-previewer-time:after {
415
-	margin-top: 4px;
416
-}
417
-.prism-previewer-time svg {
418
-	width: 32px;
419
-	height: 32px;
420
-	-webkit-transform: rotate(-90deg);
421
-	-moz-transform: rotate(-90deg);
422
-	-ms-transform: rotate(-90deg);
423
-	-o-transform: rotate(-90deg);
424
-	transform: rotate(-90deg);
425
-}
426
-.prism-previewer-time circle {
427
-	fill: transparent;
428
-	stroke: hsl(200, 10%, 20%);
429
-	stroke-opacity: 0.9;
430
-	stroke-width: 32;
431
-	stroke-dasharray: 0, 500;
432
-	stroke-dashoffset: 0;
433
-	-webkit-animation: prism-previewer-time linear infinite 3s;
434
-	-moz-animation: prism-previewer-time linear infinite 3s;
435
-	-o-animation: prism-previewer-time linear infinite 3s;
436
-	animation: prism-previewer-time linear infinite 3s;
437
-}
438
-.prism-previewer-angle:before {
439
-	border-radius: 50%;
440
-	background: #fff;
441
-}
442
-.prism-previewer-angle:after {
443
-	margin-top: 4px;
444
-}
445
-.prism-previewer-angle svg {
446
-	width: 32px;
447
-	height: 32px;
448
-	-webkit-transform: rotate(-90deg);
449
-	-moz-transform: rotate(-90deg);
450
-	-ms-transform: rotate(-90deg);
451
-	-o-transform: rotate(-90deg);
452
-	transform: rotate(-90deg);
453
-}
454
-.prism-previewer-angle[data-negative] svg {
455
-	-webkit-transform: scaleX(-1) rotate(-90deg);
456
-	-moz-transform: scaleX(-1) rotate(-90deg);
457
-	-ms-transform: scaleX(-1) rotate(-90deg);
458
-	-o-transform: scaleX(-1) rotate(-90deg);
459
-	transform: scaleX(-1) rotate(-90deg);
460
-}
461
-.prism-previewer-angle circle {
462
-	fill: transparent;
463
-	stroke: hsl(200, 10%, 20%);
464
-	stroke-opacity: 0.9;
465
-	stroke-width: 32;
466
-	stroke-dasharray: 0, 500;
467
-}

+ 3
- 2
web/app/js/prism.js
File diff suppressed because it is too large
View File