jekyll-theme-anc 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +1 -0
  4. data/_includes/disqus.html +42 -0
  5. data/_includes/facebook_share_btn.html +1 -0
  6. data/_includes/footer.html +79 -0
  7. data/_includes/go2top.html +22 -0
  8. data/_includes/google-analytics.html +11 -0
  9. data/_includes/head.html +50 -0
  10. data/_includes/header.html +13 -0
  11. data/_includes/jspdf.html +41 -0
  12. data/_includes/nav.html +25 -0
  13. data/_includes/pageloginpoper.html +59 -0
  14. data/_includes/post-categories.html +8 -0
  15. data/_includes/post_seo.html +59 -0
  16. data/_includes/youtube_video.html +11 -0
  17. data/_layouts/blog.html +33 -0
  18. data/_layouts/default.html +151 -0
  19. data/_layouts/home.html +26 -0
  20. data/_layouts/page.html +5 -0
  21. data/_layouts/post.html +83 -0
  22. data/_sass/anc.scss +9 -0
  23. data/_sass/anc/_base.scss +144 -0
  24. data/_sass/anc/_layout.scss +0 -0
  25. data/_sass/anc/_materialize.scss +38 -0
  26. data/_sass/anc/_syntax-highlighting.scss +78 -0
  27. data/_sass/anc/components/_variables.scss +343 -0
  28. data/_sass/materialize-css/components/_badges.scss +47 -0
  29. data/_sass/materialize-css/components/_buttons.scss +291 -0
  30. data/_sass/materialize-css/components/_cards.scss +196 -0
  31. data/_sass/materialize-css/components/_carousel.scss +90 -0
  32. data/_sass/materialize-css/components/_chips.scss +89 -0
  33. data/_sass/materialize-css/components/_collapsible.scss +84 -0
  34. data/_sass/materialize-css/components/_color.scss +412 -0
  35. data/_sass/materialize-css/components/_dropdown.scss +68 -0
  36. data/_sass/materialize-css/components/_global.scss +734 -0
  37. data/_sass/materialize-css/components/_grid.scss +156 -0
  38. data/_sass/materialize-css/components/_icons-material-design.scss +5 -0
  39. data/_sass/materialize-css/components/_materialbox.scss +43 -0
  40. data/_sass/materialize-css/components/_modal.scss +90 -0
  41. data/_sass/materialize-css/components/_navbar.scss +208 -0
  42. data/_sass/materialize-css/components/_normalize.scss +424 -0
  43. data/_sass/materialize-css/components/_preloader.scss +334 -0
  44. data/_sass/materialize-css/components/_pulse.scss +34 -0
  45. data/_sass/materialize-css/components/_roboto.scss +39 -0
  46. data/_sass/materialize-css/components/_sideNav.scss +214 -0
  47. data/_sass/materialize-css/components/_slider.scss +92 -0
  48. data/_sass/materialize-css/components/_table_of_contents.scss +33 -0
  49. data/_sass/materialize-css/components/_tabs.scss +93 -0
  50. data/_sass/materialize-css/components/_tapTarget.scss +103 -0
  51. data/_sass/materialize-css/components/_toast.scss +59 -0
  52. data/_sass/materialize-css/components/_tooltip.scss +31 -0
  53. data/_sass/materialize-css/components/_transitions.scss +13 -0
  54. data/_sass/materialize-css/components/_typography.scss +61 -0
  55. data/_sass/materialize-css/components/_variables.scss +343 -0
  56. data/_sass/materialize-css/components/_waves.scss +114 -0
  57. data/_sass/materialize-css/components/date_picker/_default.date.scss +456 -0
  58. data/_sass/materialize-css/components/date_picker/_default.scss +212 -0
  59. data/_sass/materialize-css/components/date_picker/_default.time.scss +267 -0
  60. data/_sass/materialize-css/components/forms/_checkboxes.scss +210 -0
  61. data/_sass/materialize-css/components/forms/_file-input.scss +44 -0
  62. data/_sass/materialize-css/components/forms/_forms.scss +22 -0
  63. data/_sass/materialize-css/components/forms/_input-fields.scss +333 -0
  64. data/_sass/materialize-css/components/forms/_radio-buttons.scss +115 -0
  65. data/_sass/materialize-css/components/forms/_range.scss +160 -0
  66. data/_sass/materialize-css/components/forms/_select.scss +182 -0
  67. data/_sass/materialize-css/components/forms/_switches.scss +89 -0
  68. data/_sass/materialize-css/materialize.scss +42 -0
  69. data/_sass/materialize/components/_badges.scss +47 -0
  70. data/_sass/materialize/components/_buttons.scss +291 -0
  71. data/_sass/materialize/components/_cards.scss +196 -0
  72. data/_sass/materialize/components/_carousel.scss +90 -0
  73. data/_sass/materialize/components/_chips.scss +89 -0
  74. data/_sass/materialize/components/_collapsible.scss +84 -0
  75. data/_sass/materialize/components/_color.scss +412 -0
  76. data/_sass/materialize/components/_dropdown.scss +68 -0
  77. data/_sass/materialize/components/_global.scss +734 -0
  78. data/_sass/materialize/components/_grid.scss +156 -0
  79. data/_sass/materialize/components/_icons-material-design.scss +5 -0
  80. data/_sass/materialize/components/_materialbox.scss +43 -0
  81. data/_sass/materialize/components/_modal.scss +90 -0
  82. data/_sass/materialize/components/_navbar.scss +208 -0
  83. data/_sass/materialize/components/_normalize.scss +424 -0
  84. data/_sass/materialize/components/_preloader.scss +334 -0
  85. data/_sass/materialize/components/_pulse.scss +34 -0
  86. data/_sass/materialize/components/_roboto.scss +39 -0
  87. data/_sass/materialize/components/_sideNav.scss +214 -0
  88. data/_sass/materialize/components/_slider.scss +92 -0
  89. data/_sass/materialize/components/_table_of_contents.scss +33 -0
  90. data/_sass/materialize/components/_tabs.scss +93 -0
  91. data/_sass/materialize/components/_tapTarget.scss +103 -0
  92. data/_sass/materialize/components/_toast.scss +59 -0
  93. data/_sass/materialize/components/_tooltip.scss +31 -0
  94. data/_sass/materialize/components/_transitions.scss +13 -0
  95. data/_sass/materialize/components/_typography.scss +61 -0
  96. data/_sass/materialize/components/_variables.scss +343 -0
  97. data/_sass/materialize/components/_waves.scss +114 -0
  98. data/_sass/materialize/components/date_picker/_default.date.scss +456 -0
  99. data/_sass/materialize/components/date_picker/_default.scss +212 -0
  100. data/_sass/materialize/components/date_picker/_default.time.scss +267 -0
  101. data/_sass/materialize/components/forms/_checkboxes.scss +210 -0
  102. data/_sass/materialize/components/forms/_file-input.scss +44 -0
  103. data/_sass/materialize/components/forms/_forms.scss +22 -0
  104. data/_sass/materialize/components/forms/_input-fields.scss +333 -0
  105. data/_sass/materialize/components/forms/_radio-buttons.scss +115 -0
  106. data/_sass/materialize/components/forms/_range.scss +160 -0
  107. data/_sass/materialize/components/forms/_select.scss +182 -0
  108. data/_sass/materialize/components/forms/_switches.scss +89 -0
  109. data/_sass/materialize/materialize.scss +42 -0
  110. data/assets/fonts/FontAwesome.otf +0 -0
  111. data/assets/fonts/fontawesome-webfont.eot +0 -0
  112. data/assets/fonts/fontawesome-webfont.svg +2671 -0
  113. data/assets/fonts/fontawesome-webfont.ttf +0 -0
  114. data/assets/fonts/fontawesome-webfont.woff +0 -0
  115. data/assets/fonts/fontawesome-webfont.woff2 +0 -0
  116. data/assets/fonts/roboto/Roboto-Bold.woff +0 -0
  117. data/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
  118. data/assets/fonts/roboto/Roboto-Light.woff +0 -0
  119. data/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
  120. data/assets/fonts/roboto/Roboto-Medium.woff +0 -0
  121. data/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
  122. data/assets/fonts/roboto/Roboto-Regular.woff +0 -0
  123. data/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
  124. data/assets/fonts/roboto/Roboto-Thin.woff +0 -0
  125. data/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
  126. data/assets/images/close.png +0 -0
  127. data/assets/images/loader.gif +0 -0
  128. data/assets/img/icons/facebook-square.png +0 -0
  129. data/assets/img/icons/github-square.png +0 -0
  130. data/assets/img/icons/twitter-square.png +0 -0
  131. data/assets/img/icons/youtube-square.png +0 -0
  132. data/assets/img/jubayed11.37-16.jpg +0 -0
  133. data/assets/img/parallax1.jpg +0 -0
  134. data/assets/img/sample-1.jpg +0 -0
  135. data/assets/js/custom_script.js +200 -0
  136. data/assets/js/highlight.pack.js +2 -0
  137. data/assets/js/materialize.min.js +6 -0
  138. data/assets/js/mode/apl/apl.js +174 -0
  139. data/assets/js/mode/asciiarmor/asciiarmor.js +74 -0
  140. data/assets/js/mode/asn.1/asn.1.js +204 -0
  141. data/assets/js/mode/asterisk/asterisk.js +196 -0
  142. data/assets/js/mode/brainfuck/brainfuck.js +85 -0
  143. data/assets/js/mode/clike/clike.js +789 -0
  144. data/assets/js/mode/clojure/clojure.js +306 -0
  145. data/assets/js/mode/cmake/cmake.js +97 -0
  146. data/assets/js/mode/cobol/cobol.js +255 -0
  147. data/assets/js/mode/coffeescript/coffeescript.js +359 -0
  148. data/assets/js/mode/commonlisp/commonlisp.js +124 -0
  149. data/assets/js/mode/crystal/crystal.js +433 -0
  150. data/assets/js/mode/css/css.js +831 -0
  151. data/assets/js/mode/cypher/cypher.js +150 -0
  152. data/assets/js/mode/d/d.js +218 -0
  153. data/assets/js/mode/dart/dart.js +157 -0
  154. data/assets/js/mode/diff/diff.js +47 -0
  155. data/assets/js/mode/django/django.js +356 -0
  156. data/assets/js/mode/dockerfile/dockerfile.js +79 -0
  157. data/assets/js/mode/dtd/dtd.js +142 -0
  158. data/assets/js/mode/dylan/dylan.js +352 -0
  159. data/assets/js/mode/ebnf/ebnf.js +195 -0
  160. data/assets/js/mode/ecl/ecl.js +206 -0
  161. data/assets/js/mode/eiffel/eiffel.js +160 -0
  162. data/assets/js/mode/elm/elm.js +205 -0
  163. data/assets/js/mode/erlang/erlang.js +619 -0
  164. data/assets/js/mode/factor/factor.js +85 -0
  165. data/assets/js/mode/fcl/fcl.js +173 -0
  166. data/assets/js/mode/forth/forth.js +180 -0
  167. data/assets/js/mode/fortran/fortran.js +188 -0
  168. data/assets/js/mode/gas/gas.js +345 -0
  169. data/assets/js/mode/gfm/gfm.js +129 -0
  170. data/assets/js/mode/gherkin/gherkin.js +178 -0
  171. data/assets/js/mode/go/go.js +187 -0
  172. data/assets/js/mode/groovy/groovy.js +230 -0
  173. data/assets/js/mode/haml/haml.js +161 -0
  174. data/assets/js/mode/handlebars/handlebars.js +62 -0
  175. data/assets/js/mode/haskell-literate/haskell-literate.js +43 -0
  176. data/assets/js/mode/haskell/haskell.js +267 -0
  177. data/assets/js/mode/haxe/haxe.js +515 -0
  178. data/assets/js/mode/htmlembedded/htmlembedded.js +28 -0
  179. data/assets/js/mode/htmlmixed/htmlmixed.js +152 -0
  180. data/assets/js/mode/http/http.js +113 -0
  181. data/assets/js/mode/idl/idl.js +290 -0
  182. data/assets/js/mode/javascript/javascript.js +838 -0
  183. data/assets/js/mode/jinja2/jinja2.js +142 -0
  184. data/assets/js/mode/jsx/jsx.js +148 -0
  185. data/assets/js/mode/julia/julia.js +418 -0
  186. data/assets/js/mode/livescript/livescript.js +280 -0
  187. data/assets/js/mode/lua/lua.js +159 -0
  188. data/assets/js/mode/markdown/markdown.js +859 -0
  189. data/assets/js/mode/mathematica/mathematica.js +176 -0
  190. data/assets/js/mode/mbox/mbox.js +129 -0
  191. data/assets/js/mode/meta.js +215 -0
  192. data/assets/js/mode/mirc/mirc.js +193 -0
  193. data/assets/js/mode/mllike/mllike.js +208 -0
  194. data/assets/js/mode/modelica/modelica.js +245 -0
  195. data/assets/js/mode/mscgen/mscgen.js +175 -0
  196. data/assets/js/mode/mumps/mumps.js +148 -0
  197. data/assets/js/mode/nginx/nginx.js +178 -0
  198. data/assets/js/mode/nsis/nsis.js +95 -0
  199. data/assets/js/mode/ntriples/ntriples.js +195 -0
  200. data/assets/js/mode/octave/octave.js +139 -0
  201. data/assets/js/mode/oz/oz.js +252 -0
  202. data/assets/js/mode/pascal/pascal.js +109 -0
  203. data/assets/js/mode/pegjs/pegjs.js +114 -0
  204. data/assets/js/mode/perl/perl.js +837 -0
  205. data/assets/js/mode/php/php.js +234 -0
  206. data/assets/js/mode/pig/pig.js +178 -0
  207. data/assets/js/mode/powershell/powershell.js +398 -0
  208. data/assets/js/mode/properties/properties.js +78 -0
  209. data/assets/js/mode/protobuf/protobuf.js +68 -0
  210. data/assets/js/mode/pug/pug.js +591 -0
  211. data/assets/js/mode/puppet/puppet.js +220 -0
  212. data/assets/js/mode/python/python.js +334 -0
  213. data/assets/js/mode/q/q.js +139 -0
  214. data/assets/js/mode/r/r.js +183 -0
  215. data/assets/js/mode/rpm/changes/index.html +66 -0
  216. data/assets/js/mode/rpm/rpm.js +109 -0
  217. data/assets/js/mode/rst/rst.js +557 -0
  218. data/assets/js/mode/ruby/ruby.js +295 -0
  219. data/assets/js/mode/rust/rust.js +72 -0
  220. data/assets/js/mode/sas/sas.js +303 -0
  221. data/assets/js/mode/sass/sass.js +454 -0
  222. data/assets/js/mode/scheme/scheme.js +249 -0
  223. data/assets/js/mode/shell/shell.js +142 -0
  224. data/assets/js/mode/sieve/sieve.js +193 -0
  225. data/assets/js/mode/slim/slim.js +575 -0
  226. data/assets/js/mode/smalltalk/smalltalk.js +168 -0
  227. data/assets/js/mode/smarty/smarty.js +225 -0
  228. data/assets/js/mode/solr/solr.js +104 -0
  229. data/assets/js/mode/soy/soy.js +342 -0
  230. data/assets/js/mode/sparql/sparql.js +180 -0
  231. data/assets/js/mode/spreadsheet/spreadsheet.js +112 -0
  232. data/assets/js/mode/sql/sql.js +475 -0
  233. data/assets/js/mode/stex/stex.js +251 -0
  234. data/assets/js/mode/stylus/stylus.js +771 -0
  235. data/assets/js/mode/swift/swift.js +210 -0
  236. data/assets/js/mode/tcl/tcl.js +139 -0
  237. data/assets/js/mode/textile/textile.js +469 -0
  238. data/assets/js/mode/tiddlywiki/tiddlywiki.css +14 -0
  239. data/assets/js/mode/tiddlywiki/tiddlywiki.js +308 -0
  240. data/assets/js/mode/tiki/tiki.css +26 -0
  241. data/assets/js/mode/tiki/tiki.js +312 -0
  242. data/assets/js/mode/toml/toml.js +88 -0
  243. data/assets/js/mode/tornado/tornado.js +68 -0
  244. data/assets/js/mode/troff/troff.js +84 -0
  245. data/assets/js/mode/ttcn-cfg/ttcn-cfg.js +214 -0
  246. data/assets/js/mode/ttcn/ttcn.js +283 -0
  247. data/assets/js/mode/turtle/turtle.js +162 -0
  248. data/assets/js/mode/twig/twig.js +141 -0
  249. data/assets/js/mode/vb/vb.js +275 -0
  250. data/assets/js/mode/vbscript/vbscript.js +350 -0
  251. data/assets/js/mode/velocity/velocity.js +201 -0
  252. data/assets/js/mode/verilog/verilog.js +675 -0
  253. data/assets/js/mode/vhdl/vhdl.js +189 -0
  254. data/assets/js/mode/vue/vue.js +70 -0
  255. data/assets/js/mode/webidl/webidl.js +195 -0
  256. data/assets/js/mode/xml/xml.js +394 -0
  257. data/assets/js/mode/xquery/xquery.js +448 -0
  258. data/assets/js/mode/yacas/yacas.js +204 -0
  259. data/assets/js/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
  260. data/assets/js/mode/yaml/yaml.js +118 -0
  261. data/assets/js/mode/z80/z80.js +116 -0
  262. data/assets/main.scss +5 -0
  263. metadata +347 -0
@@ -0,0 +1,142 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("jinja2", function() {
15
+ var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif",
16
+ "extends", "filter", "endfilter", "firstof", "for",
17
+ "endfor", "if", "endif", "ifchanged", "endifchanged",
18
+ "ifequal", "endifequal", "ifnotequal",
19
+ "endifnotequal", "in", "include", "load", "not", "now", "or",
20
+ "parsed", "regroup", "reversed", "spaceless",
21
+ "endspaceless", "ssi", "templatetag", "openblock",
22
+ "closeblock", "openvariable", "closevariable",
23
+ "openbrace", "closebrace", "opencomment",
24
+ "closecomment", "widthratio", "url", "with", "endwith",
25
+ "get_current_language", "trans", "endtrans", "noop", "blocktrans",
26
+ "endblocktrans", "get_available_languages",
27
+ "get_current_language_bidi", "plural"],
28
+ operator = /^[+\-*&%=<>!?|~^]/,
29
+ sign = /^[:\[\(\{]/,
30
+ atom = ["true", "false"],
31
+ number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
32
+
33
+ keywords = new RegExp("((" + keywords.join(")|(") + "))\\b");
34
+ atom = new RegExp("((" + atom.join(")|(") + "))\\b");
35
+
36
+ function tokenBase (stream, state) {
37
+ var ch = stream.peek();
38
+
39
+ //Comment
40
+ if (state.incomment) {
41
+ if(!stream.skipTo("#}")) {
42
+ stream.skipToEnd();
43
+ } else {
44
+ stream.eatWhile(/\#|}/);
45
+ state.incomment = false;
46
+ }
47
+ return "comment";
48
+ //Tag
49
+ } else if (state.intag) {
50
+ //After operator
51
+ if(state.operator) {
52
+ state.operator = false;
53
+ if(stream.match(atom)) {
54
+ return "atom";
55
+ }
56
+ if(stream.match(number)) {
57
+ return "number";
58
+ }
59
+ }
60
+ //After sign
61
+ if(state.sign) {
62
+ state.sign = false;
63
+ if(stream.match(atom)) {
64
+ return "atom";
65
+ }
66
+ if(stream.match(number)) {
67
+ return "number";
68
+ }
69
+ }
70
+
71
+ if(state.instring) {
72
+ if(ch == state.instring) {
73
+ state.instring = false;
74
+ }
75
+ stream.next();
76
+ return "string";
77
+ } else if(ch == "'" || ch == '"') {
78
+ state.instring = ch;
79
+ stream.next();
80
+ return "string";
81
+ } else if(stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
82
+ state.intag = false;
83
+ return "tag";
84
+ } else if(stream.match(operator)) {
85
+ state.operator = true;
86
+ return "operator";
87
+ } else if(stream.match(sign)) {
88
+ state.sign = true;
89
+ } else {
90
+ if(stream.eat(" ") || stream.sol()) {
91
+ if(stream.match(keywords)) {
92
+ return "keyword";
93
+ }
94
+ if(stream.match(atom)) {
95
+ return "atom";
96
+ }
97
+ if(stream.match(number)) {
98
+ return "number";
99
+ }
100
+ if(stream.sol()) {
101
+ stream.next();
102
+ }
103
+ } else {
104
+ stream.next();
105
+ }
106
+
107
+ }
108
+ return "variable";
109
+ } else if (stream.eat("{")) {
110
+ if (stream.eat("#")) {
111
+ state.incomment = true;
112
+ if(!stream.skipTo("#}")) {
113
+ stream.skipToEnd();
114
+ } else {
115
+ stream.eatWhile(/\#|}/);
116
+ state.incomment = false;
117
+ }
118
+ return "comment";
119
+ //Open tag
120
+ } else if (ch = stream.eat(/\{|%/)) {
121
+ //Cache close tag
122
+ state.intag = ch;
123
+ if(ch == "{") {
124
+ state.intag = "}";
125
+ }
126
+ stream.eat("-");
127
+ return "tag";
128
+ }
129
+ }
130
+ stream.next();
131
+ };
132
+
133
+ return {
134
+ startState: function () {
135
+ return {tokenize: tokenBase};
136
+ },
137
+ token: function (stream, state) {
138
+ return state.tokenize(stream, state);
139
+ }
140
+ };
141
+ });
142
+ });
@@ -0,0 +1,148 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"))
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript"], mod)
9
+ else // Plain browser env
10
+ mod(CodeMirror)
11
+ })(function(CodeMirror) {
12
+ "use strict"
13
+
14
+ // Depth means the amount of open braces in JS context, in XML
15
+ // context 0 means not in tag, 1 means in tag, and 2 means in tag
16
+ // and js block comment.
17
+ function Context(state, mode, depth, prev) {
18
+ this.state = state; this.mode = mode; this.depth = depth; this.prev = prev
19
+ }
20
+
21
+ function copyContext(context) {
22
+ return new Context(CodeMirror.copyState(context.mode, context.state),
23
+ context.mode,
24
+ context.depth,
25
+ context.prev && copyContext(context.prev))
26
+ }
27
+
28
+ CodeMirror.defineMode("jsx", function(config, modeConfig) {
29
+ var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false})
30
+ var jsMode = CodeMirror.getMode(config, modeConfig && modeConfig.base || "javascript")
31
+
32
+ function flatXMLIndent(state) {
33
+ var tagName = state.tagName
34
+ state.tagName = null
35
+ var result = xmlMode.indent(state, "")
36
+ state.tagName = tagName
37
+ return result
38
+ }
39
+
40
+ function token(stream, state) {
41
+ if (state.context.mode == xmlMode)
42
+ return xmlToken(stream, state, state.context)
43
+ else
44
+ return jsToken(stream, state, state.context)
45
+ }
46
+
47
+ function xmlToken(stream, state, cx) {
48
+ if (cx.depth == 2) { // Inside a JS /* */ comment
49
+ if (stream.match(/^.*?\*\//)) cx.depth = 1
50
+ else stream.skipToEnd()
51
+ return "comment"
52
+ }
53
+
54
+ if (stream.peek() == "{") {
55
+ xmlMode.skipAttribute(cx.state)
56
+
57
+ var indent = flatXMLIndent(cx.state), xmlContext = cx.state.context
58
+ // If JS starts on same line as tag
59
+ if (xmlContext && stream.match(/^[^>]*>\s*$/, false)) {
60
+ while (xmlContext.prev && !xmlContext.startOfLine)
61
+ xmlContext = xmlContext.prev
62
+ // If tag starts the line, use XML indentation level
63
+ if (xmlContext.startOfLine) indent -= config.indentUnit
64
+ // Else use JS indentation level
65
+ else if (cx.prev.state.lexical) indent = cx.prev.state.lexical.indented
66
+ // Else if inside of tag
67
+ } else if (cx.depth == 1) {
68
+ indent += config.indentUnit
69
+ }
70
+
71
+ state.context = new Context(CodeMirror.startState(jsMode, indent),
72
+ jsMode, 0, state.context)
73
+ return null
74
+ }
75
+
76
+ if (cx.depth == 1) { // Inside of tag
77
+ if (stream.peek() == "<") { // Tag inside of tag
78
+ xmlMode.skipAttribute(cx.state)
79
+ state.context = new Context(CodeMirror.startState(xmlMode, flatXMLIndent(cx.state)),
80
+ xmlMode, 0, state.context)
81
+ return null
82
+ } else if (stream.match("//")) {
83
+ stream.skipToEnd()
84
+ return "comment"
85
+ } else if (stream.match("/*")) {
86
+ cx.depth = 2
87
+ return token(stream, state)
88
+ }
89
+ }
90
+
91
+ var style = xmlMode.token(stream, cx.state), cur = stream.current(), stop
92
+ if (/\btag\b/.test(style)) {
93
+ if (/>$/.test(cur)) {
94
+ if (cx.state.context) cx.depth = 0
95
+ else state.context = state.context.prev
96
+ } else if (/^</.test(cur)) {
97
+ cx.depth = 1
98
+ }
99
+ } else if (!style && (stop = cur.indexOf("{")) > -1) {
100
+ stream.backUp(cur.length - stop)
101
+ }
102
+ return style
103
+ }
104
+
105
+ function jsToken(stream, state, cx) {
106
+ if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) {
107
+ jsMode.skipExpression(cx.state)
108
+ state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")),
109
+ xmlMode, 0, state.context)
110
+ return null
111
+ }
112
+
113
+ var style = jsMode.token(stream, cx.state)
114
+ if (!style && cx.depth != null) {
115
+ var cur = stream.current()
116
+ if (cur == "{") {
117
+ cx.depth++
118
+ } else if (cur == "}") {
119
+ if (--cx.depth == 0) state.context = state.context.prev
120
+ }
121
+ }
122
+ return style
123
+ }
124
+
125
+ return {
126
+ startState: function() {
127
+ return {context: new Context(CodeMirror.startState(jsMode), jsMode)}
128
+ },
129
+
130
+ copyState: function(state) {
131
+ return {context: copyContext(state.context)}
132
+ },
133
+
134
+ token: token,
135
+
136
+ indent: function(state, textAfter, fullLine) {
137
+ return state.context.mode.indent(state.context.state, textAfter, fullLine)
138
+ },
139
+
140
+ innerMode: function(state) {
141
+ return state.context
142
+ }
143
+ }
144
+ }, "xml", "javascript")
145
+
146
+ CodeMirror.defineMIME("text/jsx", "jsx")
147
+ CodeMirror.defineMIME("text/typescript-jsx", {name: "jsx", base: {name: "javascript", typescript: true}})
148
+ });
@@ -0,0 +1,418 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("julia", function(config, parserConf) {
15
+ function wordRegexp(words, end) {
16
+ if (typeof end === "undefined") { end = "\\b"; }
17
+ return new RegExp("^((" + words.join(")|(") + "))" + end);
18
+ }
19
+
20
+ var octChar = "\\\\[0-7]{1,3}";
21
+ var hexChar = "\\\\x[A-Fa-f0-9]{1,2}";
22
+ var sChar = "\\\\[abefnrtv0%?'\"\\\\]";
23
+ var uChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";
24
+
25
+ var operators = parserConf.operators || wordRegexp([
26
+ "[<>]:", "[<>=]=", "<<=?", ">>>?=?", "=>", "->", "\\/\\/",
27
+ "[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?", "\\?", "\\$", "~", ":",
28
+ "\\u00D7", "\\u2208", "\\u2209", "\\u220B", "\\u220C", "\\u2218",
29
+ "\\u221A", "\\u221B", "\\u2229", "\\u222A", "\\u2260", "\\u2264",
30
+ "\\u2265", "\\u2286", "\\u2288", "\\u228A", "\\u22C5",
31
+ "\\b(in|isa)\\b(?!\.?\\()"], "");
32
+ var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
33
+ var identifiers = parserConf.identifiers ||
34
+ /^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/;
35
+
36
+ var chars = wordRegexp([octChar, hexChar, sChar, uChar], "'");
37
+ var openers = wordRegexp(["begin", "function", "type", "struct", "immutable",
38
+ "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try",
39
+ "finally", "catch", "do"]);
40
+ var closers = wordRegexp(["end", "else", "elseif", "catch", "finally"]);
41
+ var keywords = wordRegexp(["if", "else", "elseif", "while", "for", "begin",
42
+ "let", "end", "do", "try", "catch", "finally", "return", "break",
43
+ "continue", "global", "local", "const", "export", "import", "importall",
44
+ "using", "function", "where", "macro", "module", "baremodule", "struct",
45
+ "type", "mutable", "immutable", "quote", "typealias", "abstract",
46
+ "primitive", "bitstype"]);
47
+ var builtins = wordRegexp(["true", "false", "nothing", "NaN", "Inf"]);
48
+
49
+ var macro = /^@[_A-Za-z][\w]*/;
50
+ var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
51
+ var stringPrefixes = /^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;
52
+
53
+ function inArray(state) {
54
+ return inGenerator(state, '[')
55
+ }
56
+
57
+ function inGenerator(state, bracket) {
58
+ var curr = currentScope(state),
59
+ prev = currentScope(state, 1);
60
+ if (typeof(bracket) === "undefined") { bracket = '('; }
61
+ if (curr === bracket || (prev === bracket && curr === "for")) {
62
+ return true;
63
+ }
64
+ return false;
65
+ }
66
+
67
+ function currentScope(state, n) {
68
+ if (typeof(n) === "undefined") { n = 0; }
69
+ if (state.scopes.length <= n) {
70
+ return null;
71
+ }
72
+ return state.scopes[state.scopes.length - (n + 1)];
73
+ }
74
+
75
+ // tokenizers
76
+ function tokenBase(stream, state) {
77
+ // Handle multiline comments
78
+ if (stream.match(/^#=/, false)) {
79
+ state.tokenize = tokenComment;
80
+ return state.tokenize(stream, state);
81
+ }
82
+
83
+ // Handle scope changes
84
+ var leavingExpr = state.leavingExpr;
85
+ if (stream.sol()) {
86
+ leavingExpr = false;
87
+ }
88
+ state.leavingExpr = false;
89
+
90
+ if (leavingExpr) {
91
+ if (stream.match(/^'+/)) {
92
+ return "operator";
93
+ }
94
+ }
95
+
96
+ if (stream.match(/\.{4,}/)) {
97
+ return "error";
98
+ } else if (stream.match(/\.{1,3}/)) {
99
+ return "operator";
100
+ }
101
+
102
+ if (stream.eatSpace()) {
103
+ return null;
104
+ }
105
+
106
+ var ch = stream.peek();
107
+
108
+ // Handle single line comments
109
+ if (ch === '#') {
110
+ stream.skipToEnd();
111
+ return "comment";
112
+ }
113
+
114
+ if (ch === '[') {
115
+ state.scopes.push('[');
116
+ }
117
+
118
+ if (ch === '(') {
119
+ state.scopes.push('(');
120
+ }
121
+
122
+ var scope = currentScope(state);
123
+
124
+ if (inArray(state) && ch === ']') {
125
+ if (scope === "for") { state.scopes.pop(); }
126
+ state.scopes.pop();
127
+ state.leavingExpr = true;
128
+ }
129
+
130
+ if (inGenerator(state) && ch === ')') {
131
+ if (scope === "for") { state.scopes.pop(); }
132
+ state.scopes.pop();
133
+ state.leavingExpr = true;
134
+ }
135
+
136
+ if (inArray(state)) {
137
+ if (state.lastToken == "end" && stream.match(/^:/)) {
138
+ return "operator";
139
+ }
140
+ if (stream.match(/^end/)) {
141
+ return "number";
142
+ }
143
+ }
144
+
145
+ var match;
146
+ if (match = stream.match(openers, false)) {
147
+ state.scopes.push(match[0]);
148
+ }
149
+
150
+ if (stream.match(closers, false)) {
151
+ state.scopes.pop();
152
+ }
153
+
154
+ // Handle type annotations
155
+ if (stream.match(/^::(?![:\$])/)) {
156
+ state.tokenize = tokenAnnotation;
157
+ return state.tokenize(stream, state);
158
+ }
159
+
160
+ // Handle symbols
161
+ if (!leavingExpr && stream.match(symbol) ||
162
+ stream.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/)) {
163
+ return "builtin";
164
+ }
165
+
166
+ // Handle parametric types
167
+ //if (stream.match(/^{[^}]*}(?=\()/)) {
168
+ // return "builtin";
169
+ //}
170
+
171
+ // Handle operators and Delimiters
172
+ if (stream.match(operators)) {
173
+ return "operator";
174
+ }
175
+
176
+ // Handle Number Literals
177
+ if (stream.match(/^\.?\d/, false)) {
178
+ var imMatcher = RegExp(/^im\b/);
179
+ var numberLiteral = false;
180
+ // Floats
181
+ if (stream.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)) { numberLiteral = true; }
182
+ if (stream.match(/^\d+\.(?!\.)\d*/)) { numberLiteral = true; }
183
+ if (stream.match(/^\.\d+/)) { numberLiteral = true; }
184
+ if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { numberLiteral = true; }
185
+ // Integers
186
+ if (stream.match(/^0x[0-9a-f]+/i)) { numberLiteral = true; } // Hex
187
+ if (stream.match(/^0b[01]+/i)) { numberLiteral = true; } // Binary
188
+ if (stream.match(/^0o[0-7]+/i)) { numberLiteral = true; } // Octal
189
+ if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { numberLiteral = true; } // Decimal
190
+ // Zero by itself with no other piece of number.
191
+ if (stream.match(/^0(?![\dx])/i)) { numberLiteral = true; }
192
+ if (numberLiteral) {
193
+ // Integer literals may be "long"
194
+ stream.match(imMatcher);
195
+ state.leavingExpr = true;
196
+ return "number";
197
+ }
198
+ }
199
+
200
+ // Handle Chars
201
+ if (stream.match(/^'/)) {
202
+ state.tokenize = tokenChar;
203
+ return state.tokenize(stream, state);
204
+ }
205
+
206
+ // Handle Strings
207
+ if (stream.match(stringPrefixes)) {
208
+ state.tokenize = tokenStringFactory(stream.current());
209
+ return state.tokenize(stream, state);
210
+ }
211
+
212
+ if (stream.match(macro)) {
213
+ return "meta";
214
+ }
215
+
216
+ if (stream.match(delimiters)) {
217
+ return null;
218
+ }
219
+
220
+ if (stream.match(keywords)) {
221
+ return "keyword";
222
+ }
223
+
224
+ if (stream.match(builtins)) {
225
+ return "builtin";
226
+ }
227
+
228
+ var isDefinition = state.isDefinition || state.lastToken == "function" ||
229
+ state.lastToken == "macro" || state.lastToken == "type" ||
230
+ state.lastToken == "struct" || state.lastToken == "immutable";
231
+
232
+ if (stream.match(identifiers)) {
233
+ if (isDefinition) {
234
+ if (stream.peek() === '.') {
235
+ state.isDefinition = true;
236
+ return "variable";
237
+ }
238
+ state.isDefinition = false;
239
+ return "def";
240
+ }
241
+ if (stream.match(/^({[^}]*})*\(/, false)) {
242
+ state.tokenize = tokenCallOrDef;
243
+ return state.tokenize(stream, state);
244
+ }
245
+ state.leavingExpr = true;
246
+ return "variable";
247
+ }
248
+
249
+ // Handle non-detected items
250
+ stream.next();
251
+ return "error";
252
+ }
253
+
254
+ function tokenCallOrDef(stream, state) {
255
+ var match = stream.match(/^(\(\s*)/);
256
+ if (match) {
257
+ if (state.firstParenPos < 0)
258
+ state.firstParenPos = state.scopes.length;
259
+ state.scopes.push('(');
260
+ state.charsAdvanced += match[1].length;
261
+ }
262
+ if (currentScope(state) == '(' && stream.match(/^\)/)) {
263
+ state.scopes.pop();
264
+ state.charsAdvanced += 1;
265
+ if (state.scopes.length <= state.firstParenPos) {
266
+ var isDefinition = stream.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/, false);
267
+ stream.backUp(state.charsAdvanced);
268
+ state.firstParenPos = -1;
269
+ state.charsAdvanced = 0;
270
+ state.tokenize = tokenBase;
271
+ if (isDefinition)
272
+ return "def";
273
+ return "builtin";
274
+ }
275
+ }
276
+ // Unfortunately javascript does not support multiline strings, so we have
277
+ // to undo anything done upto here if a function call or definition splits
278
+ // over two or more lines.
279
+ if (stream.match(/^$/g, false)) {
280
+ stream.backUp(state.charsAdvanced);
281
+ while (state.scopes.length > state.firstParenPos)
282
+ state.scopes.pop();
283
+ state.firstParenPos = -1;
284
+ state.charsAdvanced = 0;
285
+ state.tokenize = tokenBase;
286
+ return "builtin";
287
+ }
288
+ state.charsAdvanced += stream.match(/^([^()]*)/)[1].length;
289
+ return state.tokenize(stream, state);
290
+ }
291
+
292
+ function tokenAnnotation(stream, state) {
293
+ stream.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/);
294
+ if (stream.match(/^{/)) {
295
+ state.nestedLevels++;
296
+ } else if (stream.match(/^}/)) {
297
+ state.nestedLevels--;
298
+ }
299
+ if (state.nestedLevels > 0) {
300
+ stream.match(/.*?(?={|})/) || stream.next();
301
+ } else if (state.nestedLevels == 0) {
302
+ state.tokenize = tokenBase;
303
+ }
304
+ return "builtin";
305
+ }
306
+
307
+ function tokenComment(stream, state) {
308
+ if (stream.match(/^#=/)) {
309
+ state.nestedLevels++;
310
+ }
311
+ if (!stream.match(/.*?(?=(#=|=#))/)) {
312
+ stream.skipToEnd();
313
+ }
314
+ if (stream.match(/^=#/)) {
315
+ state.nestedLevels--;
316
+ if (state.nestedLevels == 0)
317
+ state.tokenize = tokenBase;
318
+ }
319
+ return "comment";
320
+ }
321
+
322
+ function tokenChar(stream, state) {
323
+ var isChar = false, match;
324
+ if (stream.match(chars)) {
325
+ isChar = true;
326
+ } else if (match = stream.match(/\\u([a-f0-9]{1,4})(?=')/i)) {
327
+ var value = parseInt(match[1], 16);
328
+ if (value <= 55295 || value >= 57344) { // (U+0,U+D7FF), (U+E000,U+FFFF)
329
+ isChar = true;
330
+ stream.next();
331
+ }
332
+ } else if (match = stream.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)) {
333
+ var value = parseInt(match[1], 16);
334
+ if (value <= 1114111) { // U+10FFFF
335
+ isChar = true;
336
+ stream.next();
337
+ }
338
+ }
339
+ if (isChar) {
340
+ state.leavingExpr = true;
341
+ state.tokenize = tokenBase;
342
+ return "string";
343
+ }
344
+ if (!stream.match(/^[^']+(?=')/)) { stream.skipToEnd(); }
345
+ if (stream.match(/^'/)) { state.tokenize = tokenBase; }
346
+ return "error";
347
+ }
348
+
349
+ function tokenStringFactory(delimiter) {
350
+ if (delimiter.substr(-3) === '"""') {
351
+ delimiter = '"""';
352
+ } else if (delimiter.substr(-1) === '"') {
353
+ delimiter = '"';
354
+ }
355
+ function tokenString(stream, state) {
356
+ if (stream.eat('\\')) {
357
+ stream.next();
358
+ } else if (stream.match(delimiter)) {
359
+ state.tokenize = tokenBase;
360
+ state.leavingExpr = true;
361
+ return "string";
362
+ } else {
363
+ stream.eat(/[`"]/);
364
+ }
365
+ stream.eatWhile(/[^\\`"]/);
366
+ return "string";
367
+ }
368
+ return tokenString;
369
+ }
370
+
371
+ var external = {
372
+ startState: function() {
373
+ return {
374
+ tokenize: tokenBase,
375
+ scopes: [],
376
+ lastToken: null,
377
+ leavingExpr: false,
378
+ isDefinition: false,
379
+ nestedLevels: 0,
380
+ charsAdvanced: 0,
381
+ firstParenPos: -1
382
+ };
383
+ },
384
+
385
+ token: function(stream, state) {
386
+ var style = state.tokenize(stream, state);
387
+ var current = stream.current();
388
+
389
+ if (current && style) {
390
+ state.lastToken = current;
391
+ }
392
+
393
+ return style;
394
+ },
395
+
396
+ indent: function(state, textAfter) {
397
+ var delta = 0;
398
+ if ( textAfter === ']' || textAfter === ')' || textAfter === "end" ||
399
+ textAfter === "else" || textAfter === "catch" || textAfter === "elseif" ||
400
+ textAfter === "finally" ) {
401
+ delta = -1;
402
+ }
403
+ return (state.scopes.length + delta) * config.indentUnit;
404
+ },
405
+
406
+ electricInput: /\b(end|else|catch|finally)\b/,
407
+ blockCommentStart: "#=",
408
+ blockCommentEnd: "=#",
409
+ lineComment: "#",
410
+ fold: "indent"
411
+ };
412
+ return external;
413
+ });
414
+
415
+
416
+ CodeMirror.defineMIME("text/x-julia", "julia");
417
+
418
+ });