gump 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +71 -0
- data/Rakefile +2 -0
- data/bin/gump +37 -0
- data/gump.gemspec +17 -0
- data/lib/gump.rb +50 -0
- data/lib/version.rb +3 -0
- data/server/assets/css/style.css +6949 -0
- data/server/assets/images/arrow.png +0 -0
- data/server/assets/images/logo.png +0 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap-theme.css +347 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap-theme.css.map +1 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap-theme.min.css +7 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap.css +5785 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap.css.map +1 -0
- data/server/assets/js/bootstrap/dist/css/bootstrap.min.css +7 -0
- data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/server/assets/js/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- data/server/assets/js/bootstrap/dist/js/bootstrap.js +1951 -0
- data/server/assets/js/bootstrap/dist/js/bootstrap.min.js +6 -0
- data/server/assets/js/jquery.codemirror/.gitattributes +8 -0
- data/server/assets/js/jquery.codemirror/.gitignore +6 -0
- data/server/assets/js/jquery.codemirror/.travis.yml +3 -0
- data/server/assets/js/jquery.codemirror/AUTHORS +255 -0
- data/server/assets/js/jquery.codemirror/CONTRIBUTING.md +72 -0
- data/server/assets/js/jquery.codemirror/LICENSE +19 -0
- data/server/assets/js/jquery.codemirror/README.md +11 -0
- data/server/assets/js/jquery.codemirror/addon/comment/comment.js +145 -0
- data/server/assets/js/jquery.codemirror/addon/comment/continuecomment.js +54 -0
- data/server/assets/js/jquery.codemirror/addon/dialog/dialog.css +32 -0
- data/server/assets/js/jquery.codemirror/addon/dialog/dialog.js +121 -0
- data/server/assets/js/jquery.codemirror/addon/display/fullscreen.css +6 -0
- data/server/assets/js/jquery.codemirror/addon/display/fullscreen.js +31 -0
- data/server/assets/js/jquery.codemirror/addon/display/placeholder.js +48 -0
- data/server/assets/js/jquery.codemirror/addon/edit/closebrackets.js +82 -0
- data/server/assets/js/jquery.codemirror/addon/edit/closetag.js +89 -0
- data/server/assets/js/jquery.codemirror/addon/edit/continuelist.js +25 -0
- data/server/assets/js/jquery.codemirror/addon/edit/matchbrackets.js +87 -0
- data/server/assets/js/jquery.codemirror/addon/edit/matchtags.js +56 -0
- data/server/assets/js/jquery.codemirror/addon/edit/trailingspace.js +15 -0
- data/server/assets/js/jquery.codemirror/addon/fold/brace-fold.js +93 -0
- data/server/assets/js/jquery.codemirror/addon/fold/comment-fold.js +40 -0
- data/server/assets/js/jquery.codemirror/addon/fold/foldcode.js +75 -0
- data/server/assets/js/jquery.codemirror/addon/fold/foldgutter.css +21 -0
- data/server/assets/js/jquery.codemirror/addon/fold/foldgutter.js +124 -0
- data/server/assets/js/jquery.codemirror/addon/fold/indent-fold.js +30 -0
- data/server/assets/js/jquery.codemirror/addon/fold/xml-fold.js +167 -0
- data/server/assets/js/jquery.codemirror/addon/hint/anyword-hint.js +34 -0
- data/server/assets/js/jquery.codemirror/addon/hint/css-hint.js +50 -0
- data/server/assets/js/jquery.codemirror/addon/hint/html-hint.js +337 -0
- data/server/assets/js/jquery.codemirror/addon/hint/javascript-hint.js +131 -0
- data/server/assets/js/jquery.codemirror/addon/hint/pig-hint.js +121 -0
- data/server/assets/js/jquery.codemirror/addon/hint/python-hint.js +95 -0
- data/server/assets/js/jquery.codemirror/addon/hint/show-hint.css +38 -0
- data/server/assets/js/jquery.codemirror/addon/hint/show-hint.js +286 -0
- data/server/assets/js/jquery.codemirror/addon/hint/sql-hint.js +105 -0
- data/server/assets/js/jquery.codemirror/addon/hint/xml-hint.js +69 -0
- data/server/assets/js/jquery.codemirror/addon/lint/coffeescript-lint.js +27 -0
- data/server/assets/js/jquery.codemirror/addon/lint/css-lint.js +19 -0
- data/server/assets/js/jquery.codemirror/addon/lint/javascript-lint.js +126 -0
- data/server/assets/js/jquery.codemirror/addon/lint/json-lint.js +17 -0
- data/server/assets/js/jquery.codemirror/addon/lint/lint.css +73 -0
- data/server/assets/js/jquery.codemirror/addon/lint/lint.js +203 -0
- data/server/assets/js/jquery.codemirror/addon/merge/dep/diff_match_patch.js +50 -0
- data/server/assets/js/jquery.codemirror/addon/merge/merge.css +92 -0
- data/server/assets/js/jquery.codemirror/addon/merge/merge.js +474 -0
- data/server/assets/js/jquery.codemirror/addon/mode/loadmode.js +51 -0
- data/server/assets/js/jquery.codemirror/addon/mode/multiplex.js +101 -0
- data/server/assets/js/jquery.codemirror/addon/mode/multiplex_test.js +30 -0
- data/server/assets/js/jquery.codemirror/addon/mode/overlay.js +59 -0
- data/server/assets/js/jquery.codemirror/addon/runmode/colorize.js +29 -0
- data/server/assets/js/jquery.codemirror/addon/runmode/runmode-standalone.js +136 -0
- data/server/assets/js/jquery.codemirror/addon/runmode/runmode.js +56 -0
- data/server/assets/js/jquery.codemirror/addon/runmode/runmode.node.js +103 -0
- data/server/assets/js/jquery.codemirror/addon/scroll/scrollpastend.js +34 -0
- data/server/assets/js/jquery.codemirror/addon/search/match-highlighter.js +91 -0
- data/server/assets/js/jquery.codemirror/addon/search/search.js +133 -0
- data/server/assets/js/jquery.codemirror/addon/search/searchcursor.js +143 -0
- data/server/assets/js/jquery.codemirror/addon/selection/active-line.js +39 -0
- data/server/assets/js/jquery.codemirror/addon/selection/mark-selection.js +108 -0
- data/server/assets/js/jquery.codemirror/addon/tern/tern.css +85 -0
- data/server/assets/js/jquery.codemirror/addon/tern/tern.js +632 -0
- data/server/assets/js/jquery.codemirror/addon/tern/worker.js +41 -0
- data/server/assets/js/jquery.codemirror/addon/wrap/hardwrap.js +99 -0
- data/server/assets/js/jquery.codemirror/bin/authors.sh +6 -0
- data/server/assets/js/jquery.codemirror/bin/compress +92 -0
- data/server/assets/js/jquery.codemirror/bin/lint +16 -0
- data/server/assets/js/jquery.codemirror/bin/source-highlight +61 -0
- data/server/assets/js/jquery.codemirror/bower.json +15 -0
- data/server/assets/js/jquery.codemirror/demo/activeline.html +78 -0
- data/server/assets/js/jquery.codemirror/demo/anywordhint.html +79 -0
- data/server/assets/js/jquery.codemirror/demo/bidi.html +74 -0
- data/server/assets/js/jquery.codemirror/demo/btree.html +86 -0
- data/server/assets/js/jquery.codemirror/demo/buffers.html +109 -0
- data/server/assets/js/jquery.codemirror/demo/changemode.html +59 -0
- data/server/assets/js/jquery.codemirror/demo/closebrackets.html +63 -0
- data/server/assets/js/jquery.codemirror/demo/closetag.html +40 -0
- data/server/assets/js/jquery.codemirror/demo/complete.html +80 -0
- data/server/assets/js/jquery.codemirror/demo/emacs.html +75 -0
- data/server/assets/js/jquery.codemirror/demo/folding.html +75 -0
- data/server/assets/js/jquery.codemirror/demo/fullscreen.html +130 -0
- data/server/assets/js/jquery.codemirror/demo/hardwrap.html +69 -0
- data/server/assets/js/jquery.codemirror/demo/html5complete.html +54 -0
- data/server/assets/js/jquery.codemirror/demo/indentwrap.html +58 -0
- data/server/assets/js/jquery.codemirror/demo/lint.html +171 -0
- data/server/assets/js/jquery.codemirror/demo/loadmode.html +49 -0
- data/server/assets/js/jquery.codemirror/demo/marker.html +52 -0
- data/server/assets/js/jquery.codemirror/demo/markselection.html +45 -0
- data/server/assets/js/jquery.codemirror/demo/matchhighlighter.html +47 -0
- data/server/assets/js/jquery.codemirror/demo/matchtags.html +49 -0
- data/server/assets/js/jquery.codemirror/demo/merge.html +82 -0
- data/server/assets/js/jquery.codemirror/demo/multiplex.html +75 -0
- data/server/assets/js/jquery.codemirror/demo/mustache.html +68 -0
- data/server/assets/js/jquery.codemirror/demo/placeholder.html +45 -0
- data/server/assets/js/jquery.codemirror/demo/preview.html +88 -0
- data/server/assets/js/jquery.codemirror/demo/resize.html +58 -0
- data/server/assets/js/jquery.codemirror/demo/runmode.html +62 -0
- data/server/assets/js/jquery.codemirror/demo/search.html +94 -0
- data/server/assets/js/jquery.codemirror/demo/spanaffectswrapping_shim.html +85 -0
- data/server/assets/js/jquery.codemirror/demo/tern.html +129 -0
- data/server/assets/js/jquery.codemirror/demo/theme.html +121 -0
- data/server/assets/js/jquery.codemirror/demo/trailingspace.html +48 -0
- data/server/assets/js/jquery.codemirror/demo/variableheight.html +67 -0
- data/server/assets/js/jquery.codemirror/demo/vim.html +74 -0
- data/server/assets/js/jquery.codemirror/demo/visibletabs.html +62 -0
- data/server/assets/js/jquery.codemirror/demo/widget.html +85 -0
- data/server/assets/js/jquery.codemirror/demo/xmlcomplete.html +116 -0
- data/server/assets/js/jquery.codemirror/index.html +192 -0
- data/server/assets/js/jquery.codemirror/keymap/emacs.js +387 -0
- data/server/assets/js/jquery.codemirror/keymap/extra.js +43 -0
- data/server/assets/js/jquery.codemirror/keymap/vim.js +3703 -0
- data/server/assets/js/jquery.codemirror/lib/codemirror.css +263 -0
- data/server/assets/js/jquery.codemirror/lib/codemirror.js +5944 -0
- data/server/assets/js/jquery.codemirror/mode/apl/apl.js +160 -0
- data/server/assets/js/jquery.codemirror/mode/apl/index.html +72 -0
- data/server/assets/js/jquery.codemirror/mode/asterisk/asterisk.js +183 -0
- data/server/assets/js/jquery.codemirror/mode/asterisk/index.html +154 -0
- data/server/assets/js/jquery.codemirror/mode/clike/clike.js +362 -0
- data/server/assets/js/jquery.codemirror/mode/clike/index.html +195 -0
- data/server/assets/js/jquery.codemirror/mode/clike/scala.html +767 -0
- data/server/assets/js/jquery.codemirror/mode/clojure/clojure.js +224 -0
- data/server/assets/js/jquery.codemirror/mode/clojure/index.html +88 -0
- data/server/assets/js/jquery.codemirror/mode/cobol/cobol.js +240 -0
- data/server/assets/js/jquery.codemirror/mode/cobol/index.html +210 -0
- data/server/assets/js/jquery.codemirror/mode/coffeescript/coffeescript.js +354 -0
- data/server/assets/js/jquery.codemirror/mode/coffeescript/index.html +740 -0
- data/server/assets/js/jquery.codemirror/mode/commonlisp/commonlisp.js +105 -0
- data/server/assets/js/jquery.codemirror/mode/commonlisp/index.html +177 -0
- data/server/assets/js/jquery.codemirror/mode/css/css.js +639 -0
- data/server/assets/js/jquery.codemirror/mode/css/index.html +70 -0
- data/server/assets/js/jquery.codemirror/mode/css/scss.html +157 -0
- data/server/assets/js/jquery.codemirror/mode/css/scss_test.js +93 -0
- data/server/assets/js/jquery.codemirror/mode/css/test.js +142 -0
- data/server/assets/js/jquery.codemirror/mode/d/d.js +205 -0
- data/server/assets/js/jquery.codemirror/mode/d/index.html +273 -0
- data/server/assets/js/jquery.codemirror/mode/diff/diff.js +32 -0
- data/server/assets/js/jquery.codemirror/mode/diff/index.html +117 -0
- data/server/assets/js/jquery.codemirror/mode/dtd/dtd.js +127 -0
- data/server/assets/js/jquery.codemirror/mode/dtd/index.html +89 -0
- data/server/assets/js/jquery.codemirror/mode/ecl/ecl.js +192 -0
- data/server/assets/js/jquery.codemirror/mode/ecl/index.html +52 -0
- data/server/assets/js/jquery.codemirror/mode/eiffel/eiffel.js +147 -0
- data/server/assets/js/jquery.codemirror/mode/eiffel/index.html +430 -0
- data/server/assets/js/jquery.codemirror/mode/erlang/erlang.js +484 -0
- data/server/assets/js/jquery.codemirror/mode/erlang/index.html +75 -0
- data/server/assets/js/jquery.codemirror/mode/fortran/fortran.js +173 -0
- data/server/assets/js/jquery.codemirror/mode/fortran/index.html +81 -0
- data/server/assets/js/jquery.codemirror/mode/gas/gas.js +330 -0
- data/server/assets/js/jquery.codemirror/mode/gas/index.html +68 -0
- data/server/assets/js/jquery.codemirror/mode/gfm/gfm.js +97 -0
- data/server/assets/js/jquery.codemirror/mode/gfm/index.html +82 -0
- data/server/assets/js/jquery.codemirror/mode/gfm/test.js +112 -0
- data/server/assets/js/jquery.codemirror/mode/gherkin/gherkin.js +168 -0
- data/server/assets/js/jquery.codemirror/mode/gherkin/index.html +48 -0
- data/server/assets/js/jquery.codemirror/mode/go/go.js +168 -0
- data/server/assets/js/jquery.codemirror/mode/go/index.html +85 -0
- data/server/assets/js/jquery.codemirror/mode/groovy/groovy.js +211 -0
- data/server/assets/js/jquery.codemirror/mode/groovy/index.html +84 -0
- data/server/assets/js/jquery.codemirror/mode/haml/haml.js +153 -0
- data/server/assets/js/jquery.codemirror/mode/haml/index.html +79 -0
- data/server/assets/js/jquery.codemirror/mode/haml/test.js +94 -0
- data/server/assets/js/jquery.codemirror/mode/haskell/haskell.js +250 -0
- data/server/assets/js/jquery.codemirror/mode/haskell/index.html +73 -0
- data/server/assets/js/jquery.codemirror/mode/haxe/haxe.js +429 -0
- data/server/assets/js/jquery.codemirror/mode/haxe/index.html +103 -0
- data/server/assets/js/jquery.codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/server/assets/js/jquery.codemirror/mode/htmlembedded/index.html +60 -0
- data/server/assets/js/jquery.codemirror/mode/htmlmixed/htmlmixed.js +104 -0
- data/server/assets/js/jquery.codemirror/mode/htmlmixed/index.html +85 -0
- data/server/assets/js/jquery.codemirror/mode/http/http.js +98 -0
- data/server/assets/js/jquery.codemirror/mode/http/index.html +45 -0
- data/server/assets/js/jquery.codemirror/mode/index.html +114 -0
- data/server/assets/js/jquery.codemirror/mode/jade/index.html +66 -0
- data/server/assets/js/jquery.codemirror/mode/jade/jade.js +90 -0
- data/server/assets/js/jquery.codemirror/mode/javascript/index.html +107 -0
- data/server/assets/js/jquery.codemirror/mode/javascript/javascript.js +617 -0
- data/server/assets/js/jquery.codemirror/mode/javascript/test.js +72 -0
- data/server/assets/js/jquery.codemirror/mode/javascript/typescript.html +61 -0
- data/server/assets/js/jquery.codemirror/mode/jinja2/index.html +50 -0
- data/server/assets/js/jquery.codemirror/mode/jinja2/jinja2.js +42 -0
- data/server/assets/js/jquery.codemirror/mode/julia/index.html +187 -0
- data/server/assets/js/jquery.codemirror/mode/julia/julia.js +262 -0
- data/server/assets/js/jquery.codemirror/mode/less/index.html +753 -0
- data/server/assets/js/jquery.codemirror/mode/less/less.js +346 -0
- data/server/assets/js/jquery.codemirror/mode/livescript/index.html +459 -0
- data/server/assets/js/jquery.codemirror/mode/livescript/livescript.js +267 -0
- data/server/assets/js/jquery.codemirror/mode/livescript/livescript.ls +266 -0
- data/server/assets/js/jquery.codemirror/mode/lua/index.html +86 -0
- data/server/assets/js/jquery.codemirror/mode/lua/lua.js +144 -0
- data/server/assets/js/jquery.codemirror/mode/markdown/index.html +359 -0
- data/server/assets/js/jquery.codemirror/mode/markdown/markdown.js +560 -0
- data/server/assets/js/jquery.codemirror/mode/markdown/test.js +664 -0
- data/server/assets/js/jquery.codemirror/mode/meta.js +91 -0
- data/server/assets/js/jquery.codemirror/mode/mirc/index.html +161 -0
- data/server/assets/js/jquery.codemirror/mode/mirc/mirc.js +177 -0
- data/server/assets/js/jquery.codemirror/mode/nginx/index.html +181 -0
- data/server/assets/js/jquery.codemirror/mode/nginx/nginx.js +163 -0
- data/server/assets/js/jquery.codemirror/mode/ntriples/index.html +45 -0
- data/server/assets/js/jquery.codemirror/mode/ntriples/ntriples.js +170 -0
- data/server/assets/js/jquery.codemirror/mode/ocaml/index.html +146 -0
- data/server/assets/js/jquery.codemirror/mode/ocaml/ocaml.js +116 -0
- data/server/assets/js/jquery.codemirror/mode/octave/index.html +95 -0
- data/server/assets/js/jquery.codemirror/mode/octave/octave.js +118 -0
- data/server/assets/js/jquery.codemirror/mode/pascal/index.html +61 -0
- data/server/assets/js/jquery.codemirror/mode/pascal/pascal.js +94 -0
- data/server/assets/js/jquery.codemirror/mode/pegjs/index.html +66 -0
- data/server/assets/js/jquery.codemirror/mode/pegjs/pegjs.js +103 -0
- data/server/assets/js/jquery.codemirror/mode/perl/index.html +75 -0
- data/server/assets/js/jquery.codemirror/mode/perl/perl.js +816 -0
- data/server/assets/js/jquery.codemirror/mode/php/index.html +62 -0
- data/server/assets/js/jquery.codemirror/mode/php/php.js +132 -0
- data/server/assets/js/jquery.codemirror/mode/pig/index.html +55 -0
- data/server/assets/js/jquery.codemirror/mode/pig/pig.js +171 -0
- data/server/assets/js/jquery.codemirror/mode/properties/index.html +53 -0
- data/server/assets/js/jquery.codemirror/mode/properties/properties.js +63 -0
- data/server/assets/js/jquery.codemirror/mode/python/index.html +187 -0
- data/server/assets/js/jquery.codemirror/mode/python/python.js +368 -0
- data/server/assets/js/jquery.codemirror/mode/q/index.html +144 -0
- data/server/assets/js/jquery.codemirror/mode/q/q.js +124 -0
- data/server/assets/js/jquery.codemirror/mode/r/index.html +86 -0
- data/server/assets/js/jquery.codemirror/mode/r/r.js +141 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/changes/changes.js +19 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/changes/index.html +67 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/spec/index.html +114 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/spec/spec.css +5 -0
- data/server/assets/js/jquery.codemirror/mode/rpm/spec/spec.js +66 -0
- data/server/assets/js/jquery.codemirror/mode/rst/index.html +534 -0
- data/server/assets/js/jquery.codemirror/mode/rst/rst.js +560 -0
- data/server/assets/js/jquery.codemirror/mode/ruby/index.html +185 -0
- data/server/assets/js/jquery.codemirror/mode/ruby/ruby.js +247 -0
- data/server/assets/js/jquery.codemirror/mode/rust/index.html +61 -0
- data/server/assets/js/jquery.codemirror/mode/rust/rust.js +436 -0
- data/server/assets/js/jquery.codemirror/mode/sass/index.html +66 -0
- data/server/assets/js/jquery.codemirror/mode/sass/sass.js +330 -0
- data/server/assets/js/jquery.codemirror/mode/scheme/index.html +77 -0
- data/server/assets/js/jquery.codemirror/mode/scheme/scheme.js +232 -0
- data/server/assets/js/jquery.codemirror/mode/shell/index.html +66 -0
- data/server/assets/js/jquery.codemirror/mode/shell/shell.js +118 -0
- data/server/assets/js/jquery.codemirror/mode/sieve/index.html +93 -0
- data/server/assets/js/jquery.codemirror/mode/sieve/sieve.js +183 -0
- data/server/assets/js/jquery.codemirror/mode/smalltalk/index.html +68 -0
- data/server/assets/js/jquery.codemirror/mode/smalltalk/smalltalk.js +151 -0
- data/server/assets/js/jquery.codemirror/mode/smarty/index.html +136 -0
- data/server/assets/js/jquery.codemirror/mode/smarty/smarty.js +205 -0
- data/server/assets/js/jquery.codemirror/mode/smartymixed/index.html +114 -0
- data/server/assets/js/jquery.codemirror/mode/smartymixed/smartymixed.js +175 -0
- data/server/assets/js/jquery.codemirror/mode/sparql/index.html +54 -0
- data/server/assets/js/jquery.codemirror/mode/sparql/sparql.js +145 -0
- data/server/assets/js/jquery.codemirror/mode/sql/index.html +75 -0
- data/server/assets/js/jquery.codemirror/mode/sql/sql.js +365 -0
- data/server/assets/js/jquery.codemirror/mode/stex/index.html +110 -0
- data/server/assets/js/jquery.codemirror/mode/stex/stex.js +246 -0
- data/server/assets/js/jquery.codemirror/mode/stex/test.js +120 -0
- data/server/assets/js/jquery.codemirror/mode/tcl/index.html +143 -0
- data/server/assets/js/jquery.codemirror/mode/tcl/tcl.js +131 -0
- data/server/assets/js/jquery.codemirror/mode/tiddlywiki/index.html +155 -0
- data/server/assets/js/jquery.codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/server/assets/js/jquery.codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/server/assets/js/jquery.codemirror/mode/tiki/index.html +95 -0
- data/server/assets/js/jquery.codemirror/mode/tiki/tiki.css +26 -0
- data/server/assets/js/jquery.codemirror/mode/tiki/tiki.js +308 -0
- data/server/assets/js/jquery.codemirror/mode/toml/index.html +73 -0
- data/server/assets/js/jquery.codemirror/mode/toml/toml.js +71 -0
- data/server/assets/js/jquery.codemirror/mode/turtle/index.html +51 -0
- data/server/assets/js/jquery.codemirror/mode/turtle/turtle.js +145 -0
- data/server/assets/js/jquery.codemirror/mode/vb/index.html +103 -0
- data/server/assets/js/jquery.codemirror/mode/vb/vb.js +259 -0
- data/server/assets/js/jquery.codemirror/mode/vbscript/index.html +55 -0
- data/server/assets/js/jquery.codemirror/mode/vbscript/vbscript.js +334 -0
- data/server/assets/js/jquery.codemirror/mode/velocity/index.html +119 -0
- data/server/assets/js/jquery.codemirror/mode/velocity/velocity.js +186 -0
- data/server/assets/js/jquery.codemirror/mode/verilog/index.html +132 -0
- data/server/assets/js/jquery.codemirror/mode/verilog/verilog.js +182 -0
- data/server/assets/js/jquery.codemirror/mode/xml/index.html +57 -0
- data/server/assets/js/jquery.codemirror/mode/xml/xml.js +345 -0
- data/server/assets/js/jquery.codemirror/mode/xquery/index.html +210 -0
- data/server/assets/js/jquery.codemirror/mode/xquery/test.js +64 -0
- data/server/assets/js/jquery.codemirror/mode/xquery/xquery.js +432 -0
- data/server/assets/js/jquery.codemirror/mode/yaml/index.html +80 -0
- data/server/assets/js/jquery.codemirror/mode/yaml/yaml.js +97 -0
- data/server/assets/js/jquery.codemirror/mode/z80/index.html +52 -0
- data/server/assets/js/jquery.codemirror/mode/z80/z80.js +85 -0
- data/server/assets/js/jquery.codemirror/package.json +19 -0
- data/server/assets/js/jquery.codemirror/test/comment_test.js +51 -0
- data/server/assets/js/jquery.codemirror/test/doc_test.js +329 -0
- data/server/assets/js/jquery.codemirror/test/driver.js +139 -0
- data/server/assets/js/jquery.codemirror/test/emacs_test.js +135 -0
- data/server/assets/js/jquery.codemirror/test/index.html +209 -0
- data/server/assets/js/jquery.codemirror/test/lint/acorn.js +1593 -0
- data/server/assets/js/jquery.codemirror/test/lint/lint.js +139 -0
- data/server/assets/js/jquery.codemirror/test/lint/walk.js +216 -0
- data/server/assets/js/jquery.codemirror/test/mode_test.css +10 -0
- data/server/assets/js/jquery.codemirror/test/mode_test.js +200 -0
- data/server/assets/js/jquery.codemirror/test/phantom_driver.js +31 -0
- data/server/assets/js/jquery.codemirror/test/run.js +34 -0
- data/server/assets/js/jquery.codemirror/test/test.js +1562 -0
- data/server/assets/js/jquery.codemirror/test/vim_test.js +2391 -0
- data/server/assets/js/jquery.codemirror/theme/3024-day.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/3024-night.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/ambiance-mobile.css +5 -0
- data/server/assets/js/jquery.codemirror/theme/ambiance.css +70 -0
- data/server/assets/js/jquery.codemirror/theme/base16-dark.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/base16-light.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/blackboard.css +28 -0
- data/server/assets/js/jquery.codemirror/theme/cobalt.css +21 -0
- data/server/assets/js/jquery.codemirror/theme/eclipse.css +23 -0
- data/server/assets/js/jquery.codemirror/theme/elegant.css +13 -0
- data/server/assets/js/jquery.codemirror/theme/erlang-dark.css +30 -0
- data/server/assets/js/jquery.codemirror/theme/lesser-dark.css +47 -0
- data/server/assets/js/jquery.codemirror/theme/mbo.css +37 -0
- data/server/assets/js/jquery.codemirror/theme/midnight.css +43 -0
- data/server/assets/js/jquery.codemirror/theme/monokai.css +29 -0
- data/server/assets/js/jquery.codemirror/theme/neat.css +12 -0
- data/server/assets/js/jquery.codemirror/theme/night.css +24 -0
- data/server/assets/js/jquery.codemirror/theme/paraiso-dark.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/paraiso-light.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/rubyblue.css +23 -0
- data/server/assets/js/jquery.codemirror/theme/solarized.css +180 -0
- data/server/assets/js/jquery.codemirror/theme/the-matrix.css +26 -0
- data/server/assets/js/jquery.codemirror/theme/tomorrow-night-eighties.css +34 -0
- data/server/assets/js/jquery.codemirror/theme/twilight.css +28 -0
- data/server/assets/js/jquery.codemirror/theme/vibrant-ink.css +30 -0
- data/server/assets/js/jquery.codemirror/theme/xq-dark.css +49 -0
- data/server/assets/js/jquery.codemirror/theme/xq-light.css +43 -0
- data/server/assets/js/jquery.js +4 -0
- data/server/assets/js/jquery.nanoscroller/jquery.nanoscroller.js +2 -0
- data/server/assets/js/jquery.nanoscroller/nanoscroller.css +49 -0
- data/server/assets/js/tester.js +161 -0
- data/server/config.ru +2 -0
- data/server/server.rb +41 -0
- data/server/views/_content.erb +65 -0
- data/server/views/_sidebar.erb +32 -0
- data/server/views/index.erb +40 -0
- metadata +402 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara
|
|
2
|
+
CodeMirror.defineMode("tcl", function() {
|
|
3
|
+
function parseWords(str) {
|
|
4
|
+
var obj = {}, words = str.split(" ");
|
|
5
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
|
6
|
+
return obj;
|
|
7
|
+
}
|
|
8
|
+
var keywords = parseWords("Tcl safe after append array auto_execok auto_import auto_load " +
|
|
9
|
+
"auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror " +
|
|
10
|
+
"binary break catch cd close concat continue dde eof encoding error " +
|
|
11
|
+
"eval exec exit expr fblocked fconfigure fcopy file fileevent filename " +
|
|
12
|
+
"filename flush for foreach format gets glob global history http if " +
|
|
13
|
+
"incr info interp join lappend lindex linsert list llength load lrange " +
|
|
14
|
+
"lreplace lsearch lset lsort memory msgcat namespace open package parray " +
|
|
15
|
+
"pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp " +
|
|
16
|
+
"registry regsub rename resource return scan seek set socket source split " +
|
|
17
|
+
"string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord " +
|
|
18
|
+
"tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest " +
|
|
19
|
+
"tclvars tell time trace unknown unset update uplevel upvar variable " +
|
|
20
|
+
"vwait");
|
|
21
|
+
var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch");
|
|
22
|
+
var isOperatorChar = /[+\-*&%=<>!?^\/\|]/;
|
|
23
|
+
function chain(stream, state, f) {
|
|
24
|
+
state.tokenize = f;
|
|
25
|
+
return f(stream, state);
|
|
26
|
+
}
|
|
27
|
+
function tokenBase(stream, state) {
|
|
28
|
+
var beforeParams = state.beforeParams;
|
|
29
|
+
state.beforeParams = false;
|
|
30
|
+
var ch = stream.next();
|
|
31
|
+
if ((ch == '"' || ch == "'") && state.inParams)
|
|
32
|
+
return chain(stream, state, tokenString(ch));
|
|
33
|
+
else if (/[\[\]{}\(\),;\.]/.test(ch)) {
|
|
34
|
+
if (ch == "(" && beforeParams) state.inParams = true;
|
|
35
|
+
else if (ch == ")") state.inParams = false;
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
else if (/\d/.test(ch)) {
|
|
39
|
+
stream.eatWhile(/[\w\.]/);
|
|
40
|
+
return "number";
|
|
41
|
+
}
|
|
42
|
+
else if (ch == "#" && stream.eat("*")) {
|
|
43
|
+
return chain(stream, state, tokenComment);
|
|
44
|
+
}
|
|
45
|
+
else if (ch == "#" && stream.match(/ *\[ *\[/)) {
|
|
46
|
+
return chain(stream, state, tokenUnparsed);
|
|
47
|
+
}
|
|
48
|
+
else if (ch == "#" && stream.eat("#")) {
|
|
49
|
+
stream.skipToEnd();
|
|
50
|
+
return "comment";
|
|
51
|
+
}
|
|
52
|
+
else if (ch == '"') {
|
|
53
|
+
stream.skipTo(/"/);
|
|
54
|
+
return "comment";
|
|
55
|
+
}
|
|
56
|
+
else if (ch == "$") {
|
|
57
|
+
stream.eatWhile(/[$_a-z0-9A-Z\.{:]/);
|
|
58
|
+
stream.eatWhile(/}/);
|
|
59
|
+
state.beforeParams = true;
|
|
60
|
+
return "builtin";
|
|
61
|
+
}
|
|
62
|
+
else if (isOperatorChar.test(ch)) {
|
|
63
|
+
stream.eatWhile(isOperatorChar);
|
|
64
|
+
return "comment";
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
stream.eatWhile(/[\w\$_{}]/);
|
|
68
|
+
var word = stream.current().toLowerCase();
|
|
69
|
+
if (keywords && keywords.propertyIsEnumerable(word))
|
|
70
|
+
return "keyword";
|
|
71
|
+
if (functions && functions.propertyIsEnumerable(word)) {
|
|
72
|
+
state.beforeParams = true;
|
|
73
|
+
return "keyword";
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function tokenString(quote) {
|
|
79
|
+
return function(stream, state) {
|
|
80
|
+
var escaped = false, next, end = false;
|
|
81
|
+
while ((next = stream.next()) != null) {
|
|
82
|
+
if (next == quote && !escaped) {
|
|
83
|
+
end = true;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
escaped = !escaped && next == "\\";
|
|
87
|
+
}
|
|
88
|
+
if (end) state.tokenize = tokenBase;
|
|
89
|
+
return "string";
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function tokenComment(stream, state) {
|
|
93
|
+
var maybeEnd = false, ch;
|
|
94
|
+
while (ch = stream.next()) {
|
|
95
|
+
if (ch == "#" && maybeEnd) {
|
|
96
|
+
state.tokenize = tokenBase;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
maybeEnd = (ch == "*");
|
|
100
|
+
}
|
|
101
|
+
return "comment";
|
|
102
|
+
}
|
|
103
|
+
function tokenUnparsed(stream, state) {
|
|
104
|
+
var maybeEnd = 0, ch;
|
|
105
|
+
while (ch = stream.next()) {
|
|
106
|
+
if (ch == "#" && maybeEnd == 2) {
|
|
107
|
+
state.tokenize = tokenBase;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (ch == "]")
|
|
111
|
+
maybeEnd++;
|
|
112
|
+
else if (ch != " ")
|
|
113
|
+
maybeEnd = 0;
|
|
114
|
+
}
|
|
115
|
+
return "meta";
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
startState: function() {
|
|
119
|
+
return {
|
|
120
|
+
tokenize: tokenBase,
|
|
121
|
+
beforeParams: false,
|
|
122
|
+
inParams: false
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
token: function(stream, state) {
|
|
126
|
+
if (stream.eatSpace()) return null;
|
|
127
|
+
return state.tokenize(stream, state);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
CodeMirror.defineMIME("text/x-tcl", "tcl");
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
|
|
3
|
+
<title>CodeMirror: TiddlyWiki mode</title>
|
|
4
|
+
<meta charset="utf-8"/>
|
|
5
|
+
<link rel=stylesheet href="../../doc/docs.css">
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
|
8
|
+
<link rel="stylesheet" href="tiddlywiki.css">
|
|
9
|
+
<script src="../../lib/codemirror.js"></script>
|
|
10
|
+
<script src="../../addon/edit/matchbrackets.js"></script>
|
|
11
|
+
<script src="tiddlywiki.js"></script>
|
|
12
|
+
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
|
13
|
+
<div id=nav>
|
|
14
|
+
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
|
15
|
+
|
|
16
|
+
<ul>
|
|
17
|
+
<li><a href="../../index.html">Home</a>
|
|
18
|
+
<li><a href="../../doc/manual.html">Manual</a>
|
|
19
|
+
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
|
20
|
+
</ul>
|
|
21
|
+
<ul>
|
|
22
|
+
<li><a href="../index.html">Language modes</a>
|
|
23
|
+
<li><a class=active href="#">TiddlyWiki</a>
|
|
24
|
+
</ul>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<article>
|
|
28
|
+
<h2>TiddlyWiki mode</h2>
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<div><textarea id="code" name="code">
|
|
32
|
+
!TiddlyWiki Formatting
|
|
33
|
+
* Rendered versions can be found at: http://www.tiddlywiki.com/#Reference
|
|
34
|
+
|
|
35
|
+
|!Option | !Syntax |
|
|
36
|
+
|bold font | ''bold'' |
|
|
37
|
+
|italic type | //italic// |
|
|
38
|
+
|underlined text | __underlined__ |
|
|
39
|
+
|strikethrough text | --strikethrough-- |
|
|
40
|
+
|superscript text | super^^script^^ |
|
|
41
|
+
|subscript text | sub~~script~~ |
|
|
42
|
+
|highlighted text | @@highlighted@@ |
|
|
43
|
+
|preformatted text | {{{preformatted}}} |
|
|
44
|
+
|
|
45
|
+
!Block Elements
|
|
46
|
+
<<<
|
|
47
|
+
!Heading 1
|
|
48
|
+
|
|
49
|
+
!!Heading 2
|
|
50
|
+
|
|
51
|
+
!!!Heading 3
|
|
52
|
+
|
|
53
|
+
!!!!Heading 4
|
|
54
|
+
|
|
55
|
+
!!!!!Heading 5
|
|
56
|
+
<<<
|
|
57
|
+
|
|
58
|
+
!!Lists
|
|
59
|
+
<<<
|
|
60
|
+
* unordered list, level 1
|
|
61
|
+
** unordered list, level 2
|
|
62
|
+
*** unordered list, level 3
|
|
63
|
+
|
|
64
|
+
# ordered list, level 1
|
|
65
|
+
## ordered list, level 2
|
|
66
|
+
### unordered list, level 3
|
|
67
|
+
|
|
68
|
+
; definition list, term
|
|
69
|
+
: definition list, description
|
|
70
|
+
<<<
|
|
71
|
+
|
|
72
|
+
!!Blockquotes
|
|
73
|
+
<<<
|
|
74
|
+
> blockquote, level 1
|
|
75
|
+
>> blockquote, level 2
|
|
76
|
+
>>> blockquote, level 3
|
|
77
|
+
|
|
78
|
+
> blockquote
|
|
79
|
+
<<<
|
|
80
|
+
|
|
81
|
+
!!Preformatted Text
|
|
82
|
+
<<<
|
|
83
|
+
{{{
|
|
84
|
+
preformatted (e.g. code)
|
|
85
|
+
}}}
|
|
86
|
+
<<<
|
|
87
|
+
|
|
88
|
+
!!Code Sections
|
|
89
|
+
<<<
|
|
90
|
+
{{{
|
|
91
|
+
Text style code
|
|
92
|
+
}}}
|
|
93
|
+
|
|
94
|
+
//{{{
|
|
95
|
+
JS styled code. TiddlyWiki mixed mode should support highlighter switching in the future.
|
|
96
|
+
//}}}
|
|
97
|
+
|
|
98
|
+
<!--{{{-->
|
|
99
|
+
XML styled code. TiddlyWiki mixed mode should support highlighter switching in the future.
|
|
100
|
+
<!--}}}-->
|
|
101
|
+
<<<
|
|
102
|
+
|
|
103
|
+
!!Tables
|
|
104
|
+
<<<
|
|
105
|
+
|CssClass|k
|
|
106
|
+
|!heading column 1|!heading column 2|
|
|
107
|
+
|row 1, column 1|row 1, column 2|
|
|
108
|
+
|row 2, column 1|row 2, column 2|
|
|
109
|
+
|>|COLSPAN|
|
|
110
|
+
|ROWSPAN| ... |
|
|
111
|
+
|~| ... |
|
|
112
|
+
|CssProperty:value;...| ... |
|
|
113
|
+
|caption|c
|
|
114
|
+
|
|
115
|
+
''Annotation:''
|
|
116
|
+
* The {{{>}}} marker creates a "colspan", causing the current cell to merge with the one to the right.
|
|
117
|
+
* The {{{~}}} marker creates a "rowspan", causing the current cell to merge with the one above.
|
|
118
|
+
<<<
|
|
119
|
+
!!Images /% TODO %/
|
|
120
|
+
cf. [[TiddlyWiki.com|http://www.tiddlywiki.com/#EmbeddedImages]]
|
|
121
|
+
|
|
122
|
+
!Hyperlinks
|
|
123
|
+
* [[WikiWords|WikiWord]] are automatically transformed to hyperlinks to the respective tiddler
|
|
124
|
+
** the automatic transformation can be suppressed by preceding the respective WikiWord with a tilde ({{{~}}}): {{{~WikiWord}}}
|
|
125
|
+
* [[PrettyLinks]] are enclosed in square brackets and contain the desired tiddler name: {{{[[tiddler name]]}}}
|
|
126
|
+
** optionally, a custom title or description can be added, separated by a pipe character ({{{|}}}): {{{[[title|target]]}}}<br>'''N.B.:''' In this case, the target can also be any website (i.e. URL).
|
|
127
|
+
|
|
128
|
+
!Custom Styling
|
|
129
|
+
* {{{@@CssProperty:value;CssProperty:value;...@@}}}<br>''N.B.:'' CSS color definitions should use lowercase letters to prevent the inadvertent creation of WikiWords.
|
|
130
|
+
* <html><code>{{customCssClass{...}}}</code></html>
|
|
131
|
+
* raw HTML can be inserted by enclosing the respective code in HTML tags: {{{<html> ... </html>}}}
|
|
132
|
+
|
|
133
|
+
!Special Markers
|
|
134
|
+
* {{{<br>}}} forces a manual line break
|
|
135
|
+
* {{{----}}} creates a horizontal ruler
|
|
136
|
+
* [[HTML entities|http://www.tiddlywiki.com/#HtmlEntities]]
|
|
137
|
+
* [[HTML entities local|HtmlEntities]]
|
|
138
|
+
* {{{<<macroName>>}}} calls the respective [[macro|Macros]]
|
|
139
|
+
* To hide text within a tiddler so that it is not displayed, it can be wrapped in {{{/%}}} and {{{%/}}}.<br/>This can be a useful trick for hiding drafts or annotating complex markup.
|
|
140
|
+
* To prevent wiki markup from taking effect for a particular section, that section can be enclosed in three double quotes: e.g. {{{"""WikiWord"""}}}.
|
|
141
|
+
</textarea></div>
|
|
142
|
+
|
|
143
|
+
<script>
|
|
144
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
|
145
|
+
mode: 'tiddlywiki',
|
|
146
|
+
lineNumbers: true,
|
|
147
|
+
enterMode: 'keep',
|
|
148
|
+
matchBrackets: true
|
|
149
|
+
});
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<p>TiddlyWiki mode supports a single configuration.</p>
|
|
153
|
+
|
|
154
|
+
<p><strong>MIME types defined:</strong> <code>text/x-tiddlywiki</code>.</p>
|
|
155
|
+
</article>
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/***
|
|
2
|
+
|''Name''|tiddlywiki.js|
|
|
3
|
+
|''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror|
|
|
4
|
+
|''Author''|PMario|
|
|
5
|
+
|''Version''|0.1.7|
|
|
6
|
+
|''Status''|''stable''|
|
|
7
|
+
|''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]|
|
|
8
|
+
|''Documentation''|http://codemirror.tiddlyspace.com/|
|
|
9
|
+
|''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]|
|
|
10
|
+
|''CoreVersion''|2.5.0|
|
|
11
|
+
|''Requires''|codemirror.js|
|
|
12
|
+
|''Keywords''|syntax highlighting color code mirror codemirror|
|
|
13
|
+
! Info
|
|
14
|
+
CoreVersion parameter is needed for TiddlyWiki only!
|
|
15
|
+
***/
|
|
16
|
+
//{{{
|
|
17
|
+
CodeMirror.defineMode("tiddlywiki", function () {
|
|
18
|
+
// Tokenizer
|
|
19
|
+
var textwords = {};
|
|
20
|
+
|
|
21
|
+
var keywords = function () {
|
|
22
|
+
function kw(type) {
|
|
23
|
+
return { type: type, style: "macro"};
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
"allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'),
|
|
27
|
+
"newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'),
|
|
28
|
+
"permaview": kw('permaview'), "saveChanges": kw('saveChanges'),
|
|
29
|
+
"search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'),
|
|
30
|
+
"tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'),
|
|
31
|
+
"tiddler": kw('tiddler'), "timeline": kw('timeline'),
|
|
32
|
+
"today": kw('today'), "version": kw('version'), "option": kw('option'),
|
|
33
|
+
|
|
34
|
+
"with": kw('with'),
|
|
35
|
+
"filter": kw('filter')
|
|
36
|
+
};
|
|
37
|
+
}();
|
|
38
|
+
|
|
39
|
+
var isSpaceName = /[\w_\-]/i,
|
|
40
|
+
reHR = /^\-\-\-\-+$/, // <hr>
|
|
41
|
+
reWikiCommentStart = /^\/\*\*\*$/, // /***
|
|
42
|
+
reWikiCommentStop = /^\*\*\*\/$/, // ***/
|
|
43
|
+
reBlockQuote = /^<<<$/,
|
|
44
|
+
|
|
45
|
+
reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start
|
|
46
|
+
reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop
|
|
47
|
+
reXmlCodeStart = /^<!--\{\{\{-->$/, // xml block start
|
|
48
|
+
reXmlCodeStop = /^<!--\}\}\}-->$/, // xml stop
|
|
49
|
+
|
|
50
|
+
reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start
|
|
51
|
+
reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop
|
|
52
|
+
|
|
53
|
+
reUntilCodeStop = /.*?\}\}\}/;
|
|
54
|
+
|
|
55
|
+
function chain(stream, state, f) {
|
|
56
|
+
state.tokenize = f;
|
|
57
|
+
return f(stream, state);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Used as scratch variables to communicate multiple values without
|
|
61
|
+
// consing up tons of objects.
|
|
62
|
+
var type, content;
|
|
63
|
+
|
|
64
|
+
function ret(tp, style, cont) {
|
|
65
|
+
type = tp;
|
|
66
|
+
content = cont;
|
|
67
|
+
return style;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function jsTokenBase(stream, state) {
|
|
71
|
+
var sol = stream.sol(), ch;
|
|
72
|
+
|
|
73
|
+
state.block = false; // indicates the start of a code block.
|
|
74
|
+
|
|
75
|
+
ch = stream.peek(); // don't eat, to make matching simpler
|
|
76
|
+
|
|
77
|
+
// check start of blocks
|
|
78
|
+
if (sol && /[<\/\*{}\-]/.test(ch)) {
|
|
79
|
+
if (stream.match(reCodeBlockStart)) {
|
|
80
|
+
state.block = true;
|
|
81
|
+
return chain(stream, state, twTokenCode);
|
|
82
|
+
}
|
|
83
|
+
if (stream.match(reBlockQuote)) {
|
|
84
|
+
return ret('quote', 'quote');
|
|
85
|
+
}
|
|
86
|
+
if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) {
|
|
87
|
+
return ret('code', 'comment');
|
|
88
|
+
}
|
|
89
|
+
if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) {
|
|
90
|
+
return ret('code', 'comment');
|
|
91
|
+
}
|
|
92
|
+
if (stream.match(reHR)) {
|
|
93
|
+
return ret('hr', 'hr');
|
|
94
|
+
}
|
|
95
|
+
} // sol
|
|
96
|
+
ch = stream.next();
|
|
97
|
+
|
|
98
|
+
if (sol && /[\/\*!#;:>|]/.test(ch)) {
|
|
99
|
+
if (ch == "!") { // tw header
|
|
100
|
+
stream.skipToEnd();
|
|
101
|
+
return ret("header", "header");
|
|
102
|
+
}
|
|
103
|
+
if (ch == "*") { // tw list
|
|
104
|
+
stream.eatWhile('*');
|
|
105
|
+
return ret("list", "comment");
|
|
106
|
+
}
|
|
107
|
+
if (ch == "#") { // tw numbered list
|
|
108
|
+
stream.eatWhile('#');
|
|
109
|
+
return ret("list", "comment");
|
|
110
|
+
}
|
|
111
|
+
if (ch == ";") { // definition list, term
|
|
112
|
+
stream.eatWhile(';');
|
|
113
|
+
return ret("list", "comment");
|
|
114
|
+
}
|
|
115
|
+
if (ch == ":") { // definition list, description
|
|
116
|
+
stream.eatWhile(':');
|
|
117
|
+
return ret("list", "comment");
|
|
118
|
+
}
|
|
119
|
+
if (ch == ">") { // single line quote
|
|
120
|
+
stream.eatWhile(">");
|
|
121
|
+
return ret("quote", "quote");
|
|
122
|
+
}
|
|
123
|
+
if (ch == '|') {
|
|
124
|
+
return ret('table', 'header');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (ch == '{' && stream.match(/\{\{/)) {
|
|
129
|
+
return chain(stream, state, twTokenCode);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// rudimentary html:// file:// link matching. TW knows much more ...
|
|
133
|
+
if (/[hf]/i.test(ch)) {
|
|
134
|
+
if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) {
|
|
135
|
+
return ret("link", "link");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// just a little string indicator, don't want to have the whole string covered
|
|
139
|
+
if (ch == '"') {
|
|
140
|
+
return ret('string', 'string');
|
|
141
|
+
}
|
|
142
|
+
if (ch == '~') { // _no_ CamelCase indicator should be bold
|
|
143
|
+
return ret('text', 'brace');
|
|
144
|
+
}
|
|
145
|
+
if (/[\[\]]/.test(ch)) { // check for [[..]]
|
|
146
|
+
if (stream.peek() == ch) {
|
|
147
|
+
stream.next();
|
|
148
|
+
return ret('brace', 'brace');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting
|
|
152
|
+
stream.eatWhile(isSpaceName);
|
|
153
|
+
return ret("link", "link");
|
|
154
|
+
}
|
|
155
|
+
if (/\d/.test(ch)) { // numbers
|
|
156
|
+
stream.eatWhile(/\d/);
|
|
157
|
+
return ret("number", "number");
|
|
158
|
+
}
|
|
159
|
+
if (ch == "/") { // tw invisible comment
|
|
160
|
+
if (stream.eat("%")) {
|
|
161
|
+
return chain(stream, state, twTokenComment);
|
|
162
|
+
}
|
|
163
|
+
else if (stream.eat("/")) { //
|
|
164
|
+
return chain(stream, state, twTokenEm);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (ch == "_") { // tw underline
|
|
168
|
+
if (stream.eat("_")) {
|
|
169
|
+
return chain(stream, state, twTokenUnderline);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// strikethrough and mdash handling
|
|
173
|
+
if (ch == "-") {
|
|
174
|
+
if (stream.eat("-")) {
|
|
175
|
+
// if strikethrough looks ugly, change CSS.
|
|
176
|
+
if (stream.peek() != ' ')
|
|
177
|
+
return chain(stream, state, twTokenStrike);
|
|
178
|
+
// mdash
|
|
179
|
+
if (stream.peek() == ' ')
|
|
180
|
+
return ret('text', 'brace');
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (ch == "'") { // tw bold
|
|
184
|
+
if (stream.eat("'")) {
|
|
185
|
+
return chain(stream, state, twTokenStrong);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (ch == "<") { // tw macro
|
|
189
|
+
if (stream.eat("<")) {
|
|
190
|
+
return chain(stream, state, twTokenMacro);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
return ret(ch);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// core macro handling
|
|
198
|
+
stream.eatWhile(/[\w\$_]/);
|
|
199
|
+
var word = stream.current(),
|
|
200
|
+
known = textwords.propertyIsEnumerable(word) && textwords[word];
|
|
201
|
+
|
|
202
|
+
return known ? ret(known.type, known.style, word) : ret("text", null, word);
|
|
203
|
+
|
|
204
|
+
} // jsTokenBase()
|
|
205
|
+
|
|
206
|
+
// tw invisible comment
|
|
207
|
+
function twTokenComment(stream, state) {
|
|
208
|
+
var maybeEnd = false,
|
|
209
|
+
ch;
|
|
210
|
+
while (ch = stream.next()) {
|
|
211
|
+
if (ch == "/" && maybeEnd) {
|
|
212
|
+
state.tokenize = jsTokenBase;
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
maybeEnd = (ch == "%");
|
|
216
|
+
}
|
|
217
|
+
return ret("comment", "comment");
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// tw strong / bold
|
|
221
|
+
function twTokenStrong(stream, state) {
|
|
222
|
+
var maybeEnd = false,
|
|
223
|
+
ch;
|
|
224
|
+
while (ch = stream.next()) {
|
|
225
|
+
if (ch == "'" && maybeEnd) {
|
|
226
|
+
state.tokenize = jsTokenBase;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
maybeEnd = (ch == "'");
|
|
230
|
+
}
|
|
231
|
+
return ret("text", "strong");
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// tw code
|
|
235
|
+
function twTokenCode(stream, state) {
|
|
236
|
+
var ch, sb = state.block;
|
|
237
|
+
|
|
238
|
+
if (sb && stream.current()) {
|
|
239
|
+
return ret("code", "comment");
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (!sb && stream.match(reUntilCodeStop)) {
|
|
243
|
+
state.tokenize = jsTokenBase;
|
|
244
|
+
return ret("code", "comment");
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (sb && stream.sol() && stream.match(reCodeBlockStop)) {
|
|
248
|
+
state.tokenize = jsTokenBase;
|
|
249
|
+
return ret("code", "comment");
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
ch = stream.next();
|
|
253
|
+
return (sb) ? ret("code", "comment") : ret("code", "comment");
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// tw em / italic
|
|
257
|
+
function twTokenEm(stream, state) {
|
|
258
|
+
var maybeEnd = false,
|
|
259
|
+
ch;
|
|
260
|
+
while (ch = stream.next()) {
|
|
261
|
+
if (ch == "/" && maybeEnd) {
|
|
262
|
+
state.tokenize = jsTokenBase;
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
maybeEnd = (ch == "/");
|
|
266
|
+
}
|
|
267
|
+
return ret("text", "em");
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// tw underlined text
|
|
271
|
+
function twTokenUnderline(stream, state) {
|
|
272
|
+
var maybeEnd = false,
|
|
273
|
+
ch;
|
|
274
|
+
while (ch = stream.next()) {
|
|
275
|
+
if (ch == "_" && maybeEnd) {
|
|
276
|
+
state.tokenize = jsTokenBase;
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
maybeEnd = (ch == "_");
|
|
280
|
+
}
|
|
281
|
+
return ret("text", "underlined");
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// tw strike through text looks ugly
|
|
285
|
+
// change CSS if needed
|
|
286
|
+
function twTokenStrike(stream, state) {
|
|
287
|
+
var maybeEnd = false, ch;
|
|
288
|
+
|
|
289
|
+
while (ch = stream.next()) {
|
|
290
|
+
if (ch == "-" && maybeEnd) {
|
|
291
|
+
state.tokenize = jsTokenBase;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
maybeEnd = (ch == "-");
|
|
295
|
+
}
|
|
296
|
+
return ret("text", "strikethrough");
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// macro
|
|
300
|
+
function twTokenMacro(stream, state) {
|
|
301
|
+
var ch, word, known;
|
|
302
|
+
|
|
303
|
+
if (stream.current() == '<<') {
|
|
304
|
+
return ret('brace', 'macro');
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
ch = stream.next();
|
|
308
|
+
if (!ch) {
|
|
309
|
+
state.tokenize = jsTokenBase;
|
|
310
|
+
return ret(ch);
|
|
311
|
+
}
|
|
312
|
+
if (ch == ">") {
|
|
313
|
+
if (stream.peek() == '>') {
|
|
314
|
+
stream.next();
|
|
315
|
+
state.tokenize = jsTokenBase;
|
|
316
|
+
return ret("brace", "macro");
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
stream.eatWhile(/[\w\$_]/);
|
|
321
|
+
word = stream.current();
|
|
322
|
+
known = keywords.propertyIsEnumerable(word) && keywords[word];
|
|
323
|
+
|
|
324
|
+
if (known) {
|
|
325
|
+
return ret(known.type, known.style, word);
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
return ret("macro", null, word);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Interface
|
|
333
|
+
return {
|
|
334
|
+
startState: function () {
|
|
335
|
+
return {
|
|
336
|
+
tokenize: jsTokenBase,
|
|
337
|
+
indented: 0,
|
|
338
|
+
level: 0
|
|
339
|
+
};
|
|
340
|
+
},
|
|
341
|
+
|
|
342
|
+
token: function (stream, state) {
|
|
343
|
+
if (stream.eatSpace()) return null;
|
|
344
|
+
var style = state.tokenize(stream, state);
|
|
345
|
+
return style;
|
|
346
|
+
},
|
|
347
|
+
|
|
348
|
+
electricChars: ""
|
|
349
|
+
};
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki");
|
|
353
|
+
//}}}
|