History

Finish Nim scraper

Thibaut Courouble committed 9 years ago

Commit a4ba32e1 parent 09eea6617 files · +151 −135Browse files

Showing the changes to assets/javascripts (3 of 17 files). Show all

Unified · Split

3 files
  1. assets/javascripts/news.json +3 −0
  2. assets/javascripts/templates/pages/about_tmpl.coffee +5 −0
  3. assets/javascripts/vendor/prism.js +40 −3
assets/javascripts/news.json+3−0
@@ -1,5 +1,8 @@
1[1[
2 [2 [
3 "2017-09-03",
4 "New documentation: <a href=\"/nim/\">Nim</a>"
5 ], [
3 "2017-07-23",6 "2017-07-23",
4 "New documentation: <a href=\"/godot/\">Godot</a>"7 "New documentation: <a href=\"/godot/\">Godot</a>"
5 ], [8 ], [
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -423,6 +423,11 @@ credits = [ · 422 unmodified lines
423 '2009-2016 Xiaozhe Wang (chaoslawful)<br>&copy; 2009-2017 Yichun "agentzh" Zhang (章亦春), OpenResty Inc.',423 '2009-2016 Xiaozhe Wang (chaoslawful)<br>&copy; 2009-2017 Yichun "agentzh" Zhang (章亦春), OpenResty Inc.',
424 'BSD',424 'BSD',
425 'https://github.com/openresty/lua-nginx-module#copyright-and-license'425 'https://github.com/openresty/lua-nginx-module#copyright-and-license'
426 ], [
427 'Nim',
428 '2006-2017 Andreas Rumpf',
429 'MIT',
430 'https://github.com/nim-lang/Nim#license'
426 ], [431 ], [
427 'Node.js',432 'Node.js',
428 'Joyent, Inc. and other Node contributors<br>Node.js is a trademark of Joyent, Inc.',433 'Joyent, Inc. and other Node contributors<br>Node.js is a trademark of Joyent, Inc.',
assets/javascripts/vendor/prism.js+40−3
@@ -1,4 +1,4 @@
1/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+c+cpp+coffeescript+ruby+elixir+erlang+go+java+json+kotlin+lua+nginx+perl+php+python+crystal+rust+scss+sql+typescript */1/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+c+cpp+coffeescript+ruby+elixir+erlang+go+java+json+kotlin+lua+nginx+nim+perl+php+python+crystal+rust+scss+sql+typescript */
2var _self = (typeof window !== 'undefined')2var _self = (typeof window !== 'undefined')
3 ? window // if in browser3 ? window // if in browser
4 : (4 : (
@@ -568,6 +568,9 @@ Prism.languages.markup = { · 563 unmodified lines
568 'entity': /&#?[\da-z]{1,8};/i568 'entity': /&#?[\da-z]{1,8};/i
569};569};
570 570
571Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
572 Prism.languages.markup['entity'];
573
571// Plugin to make entity title show the real entity, idea by Roman Komarov574// Plugin to make entity title show the real entity, idea by Roman Komarov
572Prism.hooks.add('wrap', function(env) {575Prism.hooks.add('wrap', function(env) {
573 576
@@ -664,7 +667,7 @@ Prism.languages.clike = { · 90 unmodified lines
664 667
665Prism.languages.javascript = Prism.languages.extend('clike', {668Prism.languages.javascript = Prism.languages.extend('clike', {
666 'keyword': /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,669 'keyword': /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,
667 'number': /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,670 'number': /\b-?(0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,
668 // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)671 // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
669 'function': /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,672 'function': /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,
670 'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/673 'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/
@@ -672,7 +675,7 @@ Prism.languages.javascript = Prism.languages.extend('clike', { · 1 unmodified line
672 675
673Prism.languages.insertBefore('javascript', 'keyword', {676Prism.languages.insertBefore('javascript', 'keyword', {
674 'regex': {677 'regex': {
675 pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,678 pattern: /(^|[^/])\/(?!\/)(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
676 lookbehind: true,679 lookbehind: true,
677 greedy: true680 greedy: true
678 }681 }
@@ -710,6 +713,7 @@ if (Prism.languages.markup) { · 31 unmodified lines
710}713}
711 714
712Prism.languages.js = Prism.languages.javascript;715Prism.languages.js = Prism.languages.javascript;
716
713Prism.languages.c = Prism.languages.extend('clike', {717Prism.languages.c = Prism.languages.extend('clike', {
714 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,718 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
715 'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,719 'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
@@ -1245,6 +1249,39 @@ Prism.languages.nginx = Prism.languages.extend('clike', { · 529 unmodified lines
1245Prism.languages.insertBefore('nginx', 'keyword', {1249Prism.languages.insertBefore('nginx', 'keyword', {
1246 'variable': /\$[a-z_]+/i1250 'variable': /\$[a-z_]+/i
1247});1251});
1252Prism.languages.nim = {
1253 'comment': /#.*/,
1254 // Double-quoted strings can be prefixed by an identifier (Generalized raw string literals)
1255 // Character literals are handled specifically to prevent issues with numeric type suffixes
1256 'string': {
1257 pattern: /(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,
1258 greedy: true
1259 },
1260 // The negative look ahead prevents wrong highlighting of the .. operator
1261 'number': /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,
1262 'keyword': /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,
1263 'function': {
1264 pattern: /(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,
1265 inside: {
1266 'operator': /\*$/
1267 }
1268 },
1269 // We don't want to highlight operators inside backticks
1270 'ignore': {
1271 pattern: /`[^`\r\n]+`/,
1272 inside: {
1273 'punctuation': /`/
1274 }
1275 },
1276 'operator': {
1277 // Look behind and look ahead prevent wrong highlighting of punctuations [. .] {. .} (. .)
1278 // but allow the slice operator .. to take precedence over them
1279 // One can define his own operators in Nim so all combination of operators might be an operator.
1280 pattern: /(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m,
1281 lookbehind: true
1282 },
1283 'punctuation': /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/
1284};
1248Prism.languages.perl = {1285Prism.languages.perl = {
1249 'comment': [1286 'comment': [
1250 {1287 {