History

Finish D scraper

Thibaut Courouble committed 9 years ago

Commit 8902d531 parent bc8d94313 files · +192 −57Browse files

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

Unified · Split

3 files
  1. assets/javascripts/news.json +1 −1
  2. assets/javascripts/templates/pages/about_tmpl.coffee +5 −0
  3. assets/javascripts/vendor/prism.js +65 −1
assets/javascripts/news.json+1−1
@@ -1,7 +1,7 @@
11 [
22 [
33 "2017-09-03",
4− "New documentations: <a href=\"/nim/\">Nim</a> and <a href=\"/vulkan/\">Vulkan</a>"
4+ "New documentations: <a href=\"/d/\">D</a>, <a href=\"/nim/\">Nim</a> and <a href=\"/vulkan/\">Vulkan</a>"
55 ], [
66 "2017-07-23",
77 "New documentation: <a href=\"/godot/\">Godot</a>"
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -193,6 +193,11 @@ credits = [ · 192 unmodified lines
193193 '2012-2017 Manas Technology Solutions',
194194 'Apache',
195195 'https://raw.githubusercontent.com/crystal-lang/crystal/master/LICENSE'
196+ ], [
197+ 'D',
198+ '1999-2017 The D Language Foundation',
199+ 'Boost',
200+ 'https://raw.githubusercontent.com/dlang/phobos/master/LICENSE_1_0.txt'
196201 ], [
197202 'D3.js',
198203 '2010-2017 Michael Bostock',
assets/javascripts/vendor/prism.js+65−1
@@ -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+nim+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+d+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 : (
@@ -976,6 +976,70 @@ delete Prism.languages.coffeescript['template-string']; · 971 unmodified lines
976976 }
977977 ];
978978 }(Prism));
979+Prism.languages.d = Prism.languages.extend('clike', {
980+ 'string': [
981+ // r"", x""
982+ /\b[rx]"(\\.|[^\\"])*"[cwd]?/,
983+ // q"[]", q"()", q"<>", q"{}"
984+ /\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/,
985+ // q"IDENT
986+ // ...
987+ // IDENT"
988+ /\bq"([_a-zA-Z][_a-zA-Z\d]*)(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\1"/,
989+ // q"//", q"||", etc.
990+ /\bq"(.)[\s\S]*?\1"/,
991+ // Characters
992+ /'(?:\\'|\\?[^']+)'/,
993+
994+ /(["`])(\\.|(?!\1)[^\\])*\1[cwd]?/
995+ ],
996+
997+ 'number': [
998+ // The lookbehind and the negative look-ahead try to prevent bad highlighting of the .. operator
999+ // Hexadecimal numbers must be handled separately to avoid problems with exponent "e"
1000+ /\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]*/i,
1001+ {
1002+ pattern: /((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]*/i,
1003+ lookbehind: true
1004+ }
1005+ ],
1006+
1007+ // In order: $, keywords and special tokens, globally defined symbols
1008+ 'keyword': /\$|\b(?:abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|real|ref|return|scope|shared|short|static|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|__(?:(?:FILE|MODULE|LINE|FUNCTION|PRETTY_FUNCTION|DATE|EOF|TIME|TIMESTAMP|VENDOR|VERSION)__|gshared|traits|vector|parameters)|string|wstring|dstring|size_t|ptrdiff_t)\b/,
1009+ 'operator': /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/
1010+});
1011+
1012+
1013+Prism.languages.d.comment = [
1014+ // Shebang
1015+ /^\s*#!.+/,
1016+ // /+ +/
1017+ {
1018+ // Allow one level of nesting
1019+ pattern: /(^|[^\\])\/\+(?:\/\+[\s\S]*?\+\/|[\s\S])*?\+\//,
1020+ lookbehind: true
1021+ }
1022+].concat(Prism.languages.d.comment);
1023+
1024+Prism.languages.insertBefore('d', 'comment', {
1025+ 'token-string': {
1026+ // Allow one level of nesting
1027+ pattern: /\bq\{(?:|\{[^}]*\}|[^}])*\}/,
1028+ alias: 'string'
1029+ }
1030+});
1031+
1032+Prism.languages.insertBefore('d', 'keyword', {
1033+ 'property': /\B@\w*/
1034+});
1035+
1036+Prism.languages.insertBefore('d', 'function', {
1037+ 'register': {
1038+ // Iasm registers
1039+ pattern: /\b(?:[ABCD][LHX]|E[ABCD]X|E?(?:BP|SP|DI|SI)|[ECSDGF]S|CR[0234]|DR[012367]|TR[3-7]|X?MM[0-7]|R[ABCD]X|[BS]PL|R[BS]P|[DS]IL|R[DS]I|R(?:[89]|1[0-5])[BWD]?|XMM(?:[89]|1[0-5])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,
1040+ alias: 'variable'
1041+ }
1042+});
9791043 Prism.languages.elixir = {
9801044 // Negative look-ahead is needed for string interpolation
9811045 // Negative look-behind is needed to avoid highlighting markdown headers in

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t