Skip to content

Commit a4ba32e

Browse files
committed
Finish Nim scraper
1 parent 09eea66 commit a4ba32e

17 files changed

Lines changed: 155 additions & 139 deletions

File tree

‎assets/images/docs-2.png‎

223 Bytes
Loading

‎assets/images/docs-2@2x.png‎

532 Bytes
Loading

‎assets/javascripts/news.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[
22
[
3+
"2017-09-03",
4+
"New documentation: <a href=\"/nim/\">Nim</a>"
5+
], [
36
"2017-07-23",
47
"New documentation: <a href=\"/godot/\">Godot</a>"
58
], [

‎assets/javascripts/templates/pages/about_tmpl.coffee‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,11 @@ credits = [
423423
'2009-2016 Xiaozhe Wang (chaoslawful)<br>&copy; 2009-2017 Yichun "agentzh" Zhang (章亦春), OpenResty Inc.',
424424
'BSD',
425425
'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'
426431
], [
427432
'Node.js',
428433
'Joyent, Inc. and other Node contributors<br>Node.js is a trademark of Joyent, Inc.',

‎assets/javascripts/vendor/prism.js‎

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */
22
var _self = (typeof window !== 'undefined')
33
? window // if in browser
44
: (
@@ -568,6 +568,9 @@ Prism.languages.markup = {
568568
'entity': /&#?[\da-z]{1,8};/i
569569
};
570570

571+
Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
572+
Prism.languages.markup['entity'];
573+
571574
// Plugin to make entity title show the real entity, idea by Roman Komarov
572575
Prism.hooks.add('wrap', function(env) {
573576

@@ -664,15 +667,15 @@ Prism.languages.clike = {
664667

665668
Prism.languages.javascript = Prism.languages.extend('clike', {
666669
'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/,
668671
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
669672
'function': /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,
670673
'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/
671674
});
672675

673676
Prism.languages.insertBefore('javascript', 'keyword', {
674677
'regex': {
675-
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
678+
pattern: /(^|[^/])\/(?!\/)(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
676679
lookbehind: true,
677680
greedy: true
678681
}
@@ -710,6 +713,7 @@ if (Prism.languages.markup) {
710713
}
711714

712715
Prism.languages.js = Prism.languages.javascript;
716+
713717
Prism.languages.c = Prism.languages.extend('clike', {
714718
'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/,
715719
'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
@@ -1245,6 +1249,39 @@ Prism.languages.nginx = Prism.languages.extend('clike', {
12451249
Prism.languages.insertBefore('nginx', 'keyword', {
12461250
'variable': /\$[a-z_]+/i
12471251
});
1252+
Prism.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+
};
12481285
Prism.languages.perl = {
12491286
'comment': [
12501287
{

‎assets/stylesheets/application-dark.css.scss‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
'pages/meteor',
6868
'pages/modernizr',
6969
'pages/moment',
70-
'pages/nim',
7170
'pages/nginx',
7271
'pages/node',
7372
'pages/npm',

‎assets/stylesheets/application.css.scss‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
'pages/meteor',
6868
'pages/modernizr',
6969
'pages/moment',
70-
'pages/nim',
7170
'pages/nginx',
7271
'pages/node',
7372
'pages/npm',

‎assets/stylesheets/components/_prism.scss‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@
7777
}
7878
}
7979

80-
.token.important {
80+
.token.important,
81+
.token.bold {
8182
font-weight: $boldFontWeight;
8283
}
84+
85+
.token.italic {
86+
font-style: italic;
87+
}

‎assets/stylesheets/global/_icons.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,4 @@
173173
._icon-electron:before { background-position: -2rem -2rem; @extend %doc-icon-2; }
174174
._icon-falcon:before { background-position: -3rem -2rem; @extend %doc-icon-2; }
175175
._icon-godot:before { background-position: -4rem -2rem; @extend %doc-icon-2; }
176+
._icon-nim:before { background-position: -5rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; }

‎assets/stylesheets/pages/_nim.scss‎

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)