├── site ├── .java-version ├── resources │ └── public │ │ ├── design.html │ │ ├── js │ │ └── lib │ │ │ ├── jsdiff.externs.js │ │ │ ├── parinfer-codemirror.externs.js │ │ │ ├── scrollMonitor.externs.js │ │ │ └── gears.d3.externs.js │ │ ├── img │ │ ├── lego-indent.png │ │ ├── lego-parens.png │ │ ├── xkcd-frost.png │ │ ├── parinfer-org-logo-144x108.png │ │ ├── parinfer-org-logo-dark-144x108.png │ │ └── parinfer-org-logo-light-144x108.png │ │ ├── codemirror │ │ ├── .DS_Store │ │ ├── addon │ │ │ ├── display │ │ │ │ ├── fullscreen.css │ │ │ │ ├── fullscreen.js │ │ │ │ ├── autorefresh.js │ │ │ │ ├── placeholder.js │ │ │ │ └── rulers.js │ │ │ ├── search │ │ │ │ └── matchesonscrollbar.css │ │ │ ├── fold │ │ │ │ ├── foldgutter.css │ │ │ │ ├── indent-fold.js │ │ │ │ ├── markdown-fold.js │ │ │ │ └── comment-fold.js │ │ │ ├── dialog │ │ │ │ └── dialog.css │ │ │ ├── hint │ │ │ │ ├── show-hint.css │ │ │ │ ├── anyword-hint.js │ │ │ │ └── css-hint.js │ │ │ ├── mode │ │ │ │ ├── multiplex_test.js │ │ │ │ └── loadmode.js │ │ │ ├── lint │ │ │ │ ├── yaml-lint.js │ │ │ │ ├── json-lint.js │ │ │ │ ├── css-lint.js │ │ │ │ ├── coffeescript-lint.js │ │ │ │ └── html-lint.js │ │ │ ├── edit │ │ │ │ ├── trailingspace.js │ │ │ │ └── continuelist.js │ │ │ ├── tern │ │ │ │ ├── worker.js │ │ │ │ └── tern.css │ │ │ ├── runmode │ │ │ │ └── colorize.js │ │ │ └── scroll │ │ │ │ ├── simplescrollbars.css │ │ │ │ └── scrollpastend.js │ │ └── mode │ │ │ ├── tiddlywiki │ │ │ └── tiddlywiki.css │ │ │ ├── ruby │ │ │ └── test.js │ │ │ ├── css │ │ │ ├── gss_test.js │ │ │ ├── less_test.js │ │ │ └── index.html │ │ │ ├── tiki │ │ │ ├── tiki.css │ │ │ └── index.html │ │ │ ├── rust │ │ │ ├── test.js │ │ │ └── index.html │ │ │ ├── diff │ │ │ └── diff.js │ │ │ ├── mscgen │ │ │ ├── index_msgenny.html │ │ │ ├── index.html │ │ │ └── index_xu.html │ │ │ ├── asciiarmor │ │ │ └── index.html │ │ │ ├── htmlembedded │ │ │ ├── htmlembedded.js │ │ │ └── index.html │ │ │ ├── ntriples │ │ │ └── index.html │ │ │ ├── twig │ │ │ └── index.html │ │ │ ├── spreadsheet │ │ │ └── index.html │ │ │ ├── http │ │ │ └── index.html │ │ │ ├── clike │ │ │ └── test.js │ │ │ ├── solr │ │ │ └── index.html │ │ │ ├── ecl │ │ │ └── index.html │ │ │ ├── z80 │ │ │ └── index.html │ │ │ ├── oz │ │ │ └── index.html │ │ │ ├── turtle │ │ │ └── index.html │ │ │ ├── pascal │ │ │ └── index.html │ │ │ ├── pig │ │ │ └── index.html │ │ │ ├── vbscript │ │ │ └── index.html │ │ │ ├── gherkin │ │ │ └── index.html │ │ │ ├── properties │ │ │ ├── index.html │ │ │ └── properties.js │ │ │ ├── javascript │ │ │ ├── typescript.html │ │ │ └── json-ld.html │ │ │ ├── sass │ │ │ └── index.html │ │ │ ├── perl │ │ │ └── index.html │ │ │ ├── elm │ │ │ └── index.html │ │ │ ├── idl │ │ │ └── index.html │ │ │ ├── dart │ │ │ ├── index.html │ │ │ └── dart.js │ │ │ ├── handlebars │ │ │ └── handlebars.js │ │ │ ├── xml │ │ │ ├── test.js │ │ │ └── index.html │ │ │ ├── jinja2 │ │ │ └── index.html │ │ │ ├── shell │ │ │ ├── test.js │ │ │ └── index.html │ │ │ ├── sparql │ │ │ └── index.html │ │ │ ├── tornado │ │ │ └── index.html │ │ │ ├── forth │ │ │ └── index.html │ │ │ ├── gas │ │ │ └── index.html │ │ │ ├── toml │ │ │ └── index.html │ │ │ ├── octave │ │ │ └── index.html │ │ │ ├── pegjs │ │ │ └── index.html │ │ │ ├── cypher │ │ │ └── index.html │ │ │ ├── smalltalk │ │ │ └── index.html │ │ │ ├── soy │ │ │ └── index.html │ │ │ ├── php │ │ │ └── index.html │ │ │ ├── modelica │ │ │ └── index.html │ │ │ ├── factor │ │ │ └── index.html │ │ │ ├── vue │ │ │ └── index.html │ │ │ ├── django │ │ │ └── index.html │ │ │ ├── apl │ │ │ └── index.html │ │ │ ├── haml │ │ │ └── index.html │ │ │ ├── lua │ │ │ └── index.html │ │ │ ├── yaml │ │ │ └── index.html │ │ │ ├── rpm │ │ │ └── changes │ │ │ │ └── index.html │ │ │ ├── swift │ │ │ └── index.html │ │ │ ├── erlang │ │ │ └── index.html │ │ │ ├── haskell │ │ │ └── index.html │ │ │ ├── go │ │ │ └── index.html │ │ │ ├── groovy │ │ │ └── index.html │ │ │ ├── brainfuck │ │ │ └── brainfuck.js │ │ │ ├── mathematica │ │ │ └── index.html │ │ │ ├── asn.1 │ │ │ └── index.html │ │ │ └── dockerfile │ │ │ └── dockerfile.js │ │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── serif │ │ │ ├── cmunbi.eot │ │ │ ├── cmunbi.ttf │ │ │ ├── cmunbi.woff │ │ │ ├── cmunbx.eot │ │ │ ├── cmunbx.ttf │ │ │ ├── cmunbx.woff │ │ │ ├── cmunrm.eot │ │ │ ├── cmunrm.ttf │ │ │ ├── cmunrm.woff │ │ │ ├── cmunti.eot │ │ │ ├── cmunti.ttf │ │ │ ├── cmunti.woff │ │ │ ├── README.txt │ │ │ └── cmun-serif.css │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── opensans │ │ │ ├── OpenSans.eot │ │ │ ├── OpenSans.woff │ │ │ ├── OpenSans-Bold.eot │ │ │ ├── OpenSans-Bold.woff │ │ │ ├── OpenSans-Italic.eot │ │ │ ├── OpenSans-Light.eot │ │ │ ├── OpenSans-Light.woff │ │ │ ├── OpenSans-Italic.woff │ │ │ ├── OpenSans-BoldItalic.eot │ │ │ ├── OpenSans-BoldItalic.woff │ │ │ ├── OpenSansLight-Italic.eot │ │ │ └── OpenSansLight-Italic.woff │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ │ ├── demo-v1.html │ │ ├── debug_state.html │ │ └── demo.html ├── .gitignore ├── src │ └── parinfer_site │ │ ├── state.cljs │ │ ├── util.clj │ │ ├── editor_support.cljs │ │ └── parinfer.cljs ├── publish.sh ├── README.md └── 2017-addendum.md ├── .travis.yml ├── README.md ├── .gitignore └── .editorconfig /site/.java-version: -------------------------------------------------------------------------------- 1 | 1.8 2 | -------------------------------------------------------------------------------- /site/resources/public/design.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/.gitignore: -------------------------------------------------------------------------------- 1 | /resources/public/js/compiled/** 2 | /deploy 3 | 4 | -------------------------------------------------------------------------------- /site/resources/public/js/lib/jsdiff.externs.js: -------------------------------------------------------------------------------- 1 | var JsDiff = {}; 2 | JsDiff.diffChars = function(){}; 3 | -------------------------------------------------------------------------------- /site/resources/public/img/lego-indent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/img/lego-indent.png -------------------------------------------------------------------------------- /site/resources/public/img/lego-parens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/img/lego-parens.png -------------------------------------------------------------------------------- /site/resources/public/img/xkcd-frost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/img/xkcd-frost.png -------------------------------------------------------------------------------- /site/resources/public/codemirror/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/codemirror/.DS_Store -------------------------------------------------------------------------------- /site/resources/public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunbi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunbi.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunbi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunbi.ttf -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunbi.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunbi.woff -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunbx.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunbx.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunbx.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunbx.ttf -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunbx.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunbx.woff -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunrm.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunrm.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunrm.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunrm.ttf -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunrm.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunrm.woff -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunti.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunti.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunti.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunti.ttf -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmunti.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/serif/cmunti.woff -------------------------------------------------------------------------------- /site/resources/public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans.woff -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "7.4" 4 | install: 5 | - pushd lib; npm install; popd 6 | script: 7 | - pushd lib && npm test && popd 8 | -------------------------------------------------------------------------------- /site/resources/public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /site/resources/public/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /site/resources/public/demo-v1.html: -------------------------------------------------------------------------------- 1 | 2 | v1 behavior is now integrated into the latest demo page 3 | under the forceBalance option. 4 | -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans-Bold.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans-Bold.woff -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans-Italic.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans-Light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans-Light.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans-Light.woff -------------------------------------------------------------------------------- /site/resources/public/img/parinfer-org-logo-144x108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/img/parinfer-org-logo-144x108.png -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans-Italic.woff -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans-BoldItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans-BoldItalic.eot -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSans-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSans-BoldItalic.woff -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSansLight-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSansLight-Italic.eot -------------------------------------------------------------------------------- /site/resources/public/img/parinfer-org-logo-dark-144x108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/img/parinfer-org-logo-dark-144x108.png -------------------------------------------------------------------------------- /site/resources/public/img/parinfer-org-logo-light-144x108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/img/parinfer-org-logo-light-144x108.png -------------------------------------------------------------------------------- /site/resources/public/fonts/opensans/OpenSansLight-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaunlebron/parinfer/HEAD/site/resources/public/fonts/opensans/OpenSansLight-Italic.woff -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Parinfer 2 | 3 | **PROJECT HAS BEEN MOVED TO .** 4 | 5 | The site code for the original [demo page] is archived and hosted here. 6 | 7 | [demo page]:http://shaunlebron.github.io/parinfer/ 8 | 9 | -------------------------------------------------------------------------------- /site/resources/public/js/lib/parinfer-codemirror.externs.js: -------------------------------------------------------------------------------- 1 | 2 | var parinferCodeMirror = {}; 3 | 4 | parinferCodeMirror.init; 5 | parinferCodeMirror.enable; 6 | parinferCodeMirror.disable; 7 | parinferCodeMirror.setMode; 8 | parinferCodeMirror.setOptions; 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | pom.xml 2 | pom.xml.asc 3 | *jar 4 | classes/ 5 | out/ 6 | target/ 7 | .lein-deps-sum 8 | .lein-repl-history 9 | .lein-failures 10 | .lein-plugins/ 11 | .repl 12 | .nrepl-port 13 | *.swp 14 | figwheel_server.log 15 | 16 | *.diff 17 | todo 18 | 19 | node_modules 20 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/search/matchesonscrollbar.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-search-match { 2 | background: gold; 3 | border-top: 1px solid orange; 4 | border-bottom: 1px solid orange; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | opacity: .5; 8 | } 9 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /site/resources/public/js/lib/scrollMonitor.externs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @constructor 3 | */ 4 | var ElementWatcher = function(){}; 5 | 6 | ElementWatcher.prototype.enterViewport = function(){}; 7 | ElementWatcher.prototype.exitViewport = function(){}; 8 | ElementWatcher.prototype.isInViewport = function(){}; 9 | 10 | 11 | var scrollMonitor = {}; 12 | 13 | /** 14 | * @return {ElementWatcher} 15 | */ 16 | scrollMonitor.create = function(){}; 17 | scrollMonitor.recalculateLocations = function(){}; 18 | 19 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs. 2 | # More information at http://EditorConfig.org 3 | 4 | # No .editorconfig files above the root directory 5 | root = true 6 | 7 | # All files 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | indent_size = 2 12 | indent_style = space 13 | insert_final_newline = true 14 | trim_trailing_whitespace = true 15 | 16 | # allow trailing whitespace in Markdown files 17 | [*.md] 18 | trim_trailing_whitespace = false 19 | -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/README.txt: -------------------------------------------------------------------------------- 1 | This package was compiled by Christian Perfect (http://checkmyworking.com) from the Computer Modern Unicode fonts created by Andrey V. Panov (http://cm-unicode.sourceforge.net/) 2 | 3 | They're released under the SIL Open Font License. See OFL.txt and OFL-FAQ.txt for the terms. 4 | 5 | A demo page for these fonts was at http://www.checkmyworking.com/cm-web-fonts/ when I released them. I can only apologise, citizen of the future, if that address doesn't exist any more. 6 | -------------------------------------------------------------------------------- /site/src/parinfer_site/state.cljs: -------------------------------------------------------------------------------- 1 | (ns parinfer-site.state 2 | "State of the editors on our page.") 3 | 4 | ;; map of editor key -> editor state 5 | (defonce state 6 | (atom {})) 7 | 8 | (def empty-editor-state 9 | {:text "" ;; text of the editor 10 | :mode :indent-mode ;; editor mode (:indent-mode, :paren-mode) 11 | :options nil ;; Parinfer input options 12 | :result nil ;; Parinfer result 13 | :cm nil ;; the CodeMirror instance 14 | :watcher nil}) ;; the ScrollMonitor instance 15 | 16 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/ruby/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("divide_equal_operator", 9 | "[variable bar] [operator /=] [variable foo]"); 10 | 11 | MT("divide_equal_operator_no_spacing", 12 | "[variable foo][operator /=][number 42]"); 13 | 14 | })(); 15 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/fold/foldgutter.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-foldmarker { 2 | color: blue; 3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; 4 | font-family: arial; 5 | line-height: .3; 6 | cursor: pointer; 7 | } 8 | .CodeMirror-foldgutter { 9 | width: .7em; 10 | } 11 | .CodeMirror-foldgutter-open, 12 | .CodeMirror-foldgutter-folded { 13 | cursor: pointer; 14 | } 15 | .CodeMirror-foldgutter-open:after { 16 | content: "\25BE"; 17 | } 18 | .CodeMirror-foldgutter-folded:after { 19 | content: "\25B8"; 20 | } 21 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/css/gss_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | "use strict"; 6 | 7 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss"); 8 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); } 9 | 10 | MT("atComponent", 11 | "[def @component] {", 12 | "[tag foo] {", 13 | " [property color]: [keyword black];", 14 | "}", 15 | "}"); 16 | 17 | })(); 18 | -------------------------------------------------------------------------------- /site/src/parinfer_site/util.clj: -------------------------------------------------------------------------------- 1 | (ns parinfer-site.util) 2 | 3 | ; Case 1: Show the state of a bunch of variables. 4 | ; 5 | ; > (inspect a b c) 6 | ; 7 | ; a => 1 8 | ; b => :foo-bar 9 | ; c => ["hi" "world"] 10 | ; 11 | ; Case 2: Print an expression and its result. 12 | ; 13 | ; > (inspect (+ 1 2 3)) 14 | ; 15 | ; (+ 1 2 3) => 6 16 | ; 17 | 18 | (defn- inspect-1 [expr] 19 | `(let [result# ~expr] 20 | (js/console.info (str (pr-str '~expr) " => " (pr-str result#))) 21 | result#)) 22 | 23 | (defmacro inspect [& exprs] 24 | `(do ~@(map inspect-1 exprs))) 25 | -------------------------------------------------------------------------------- /site/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cleans, builds, and publishes the parinfer site to: 4 | # http://shaunlebron.github.io/parinfer 5 | 6 | set -ex 7 | 8 | cd `dirname $0` 9 | 10 | lein clean 11 | 12 | vcr_file=src/parinfer_site/vcr.cljs 13 | sed -i .bak 's/(def SHOW_CONTROLS .*)/(def SHOW_CONTROLS false)/' $vcr_file 14 | lein cljsbuild once min 15 | mv ${vcr_file}.bak $vcr_file 16 | 17 | cd deploy 18 | 19 | git reset HEAD . 20 | git rm -rf * 21 | cp -r ../resources/public/ . 22 | git add -u 23 | git add . 24 | git commit -m "update deploy" 25 | git push origin master:gh-pages 26 | 27 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/tiki/tiki.css: -------------------------------------------------------------------------------- 1 | .cm-tw-syntaxerror { 2 | color: #FFF; 3 | background-color: #900; 4 | } 5 | 6 | .cm-tw-deleted { 7 | text-decoration: line-through; 8 | } 9 | 10 | .cm-tw-header5 { 11 | font-weight: bold; 12 | } 13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ 14 | padding-left: 10px; 15 | } 16 | 17 | .cm-tw-box { 18 | border-top-width: 0px ! important; 19 | border-style: solid; 20 | border-width: 1px; 21 | border-color: inherit; 22 | } 23 | 24 | .cm-tw-underline { 25 | text-decoration: underline; 26 | } -------------------------------------------------------------------------------- /site/resources/public/js/lib/gears.d3.externs.js: -------------------------------------------------------------------------------- 1 | var Gear = { 2 | create: function(){}, 3 | setPower: function(){}, 4 | randomArrange: function(){}, 5 | dragBehaviour: function(){}, 6 | anyGearCollides: function(){}, 7 | gearCollides: function(){}, 8 | propagateGears: function(){}, 9 | updateGears: function(){}, 10 | mesh: function(){}, 11 | path: function(){} 12 | }; 13 | 14 | Gear.Utility = { 15 | keys: function(){}, 16 | distanceSquared: function(){}, 17 | angle: function(){}, 18 | sign: function(){}, 19 | arrayShuffle: function(){}, 20 | arrayClone: function(){} 21 | }; 22 | -------------------------------------------------------------------------------- /site/src/parinfer_site/editor_support.cljs: -------------------------------------------------------------------------------- 1 | (ns parinfer-site.editor-support 2 | "Connects parinfer mode functions to CodeMirror" 3 | (:require 4 | [clojure.string :as string :refer [join]] 5 | [parinfer-site.parinfer :refer [smart-mode 6 | indent-mode 7 | paren-mode]] 8 | [parinfer-site.state :refer [state]])) 9 | 10 | (defprotocol IEditor 11 | "Custom data/methods for a CodeMirror editor." 12 | (cm-key [this]) 13 | (get-prev-state [this]) 14 | (frame-updated? [this]) 15 | (set-frame-updated! [this value]) 16 | (record-change! [this thing])) 17 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/dialog/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: inherit; 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: inherit; 9 | } 10 | 11 | .CodeMirror-dialog-top { 12 | border-bottom: 1px solid #eee; 13 | top: 0; 14 | } 15 | 16 | .CodeMirror-dialog-bottom { 17 | border-top: 1px solid #eee; 18 | bottom: 0; 19 | } 20 | 21 | .CodeMirror-dialog input { 22 | border: none; 23 | outline: none; 24 | background: transparent; 25 | width: 20em; 26 | color: inherit; 27 | font-family: monospace; 28 | } 29 | 30 | .CodeMirror-dialog button { 31 | font-size: 70%; 32 | } 33 | -------------------------------------------------------------------------------- /site/README.md: -------------------------------------------------------------------------------- 1 | # Parinfer Site 2 | 3 | This is the home page for [Parinfer], intended to communicate the value of 4 | Parinfer through animated and interactive demos, and to show a detailed 5 | exploration of its concepts. 6 | 7 | [Parinfer]:http://shaunlebron.github.io/parinfer/ 8 | 9 | We use [CodeMirror] for the demos, which is connected to the Parinfer library 10 | through the code [here][editor-support]. 11 | 12 | [CodeMirror]:https://codemirror.net/ 13 | [editor-support]:https://github.com/shaunlebron/parinfer/blob/master/site/src/parinfer_site/editor_support.cljs 14 | 15 | ## Development 16 | 17 | - Run `rlwrap lein figwheel` 18 | - Open to view the site. 19 | 20 | Indent and Paren mode editors are available for testing purposes here: 21 | 22 | - Open 23 | 24 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | li.CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/mode/multiplex_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | CodeMirror.defineMode("markdown_with_stex", function(){ 6 | var inner = CodeMirror.getMode({}, "stex"); 7 | var outer = CodeMirror.getMode({}, "markdown"); 8 | 9 | var innerOptions = { 10 | open: '$', 11 | close: '$', 12 | mode: inner, 13 | delimStyle: 'delim', 14 | innerStyle: 'inner' 15 | }; 16 | 17 | return CodeMirror.multiplexingMode(outer, innerOptions); 18 | }); 19 | 20 | var mode = CodeMirror.getMode({}, "markdown_with_stex"); 21 | 22 | function MT(name) { 23 | test.mode( 24 | name, 25 | mode, 26 | Array.prototype.slice.call(arguments, 1), 27 | 'multiplexing'); 28 | } 29 | 30 | MT( 31 | "stexInsideMarkdown", 32 | "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]"); 33 | })(); 34 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/lint/yaml-lint.js: -------------------------------------------------------------------------------- 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 | // Depends on js-yaml.js from https://github.com/nodeca/js-yaml 15 | 16 | // declare global: jsyaml 17 | 18 | CodeMirror.registerHelper("lint", "yaml", function(text) { 19 | var found = []; 20 | try { jsyaml.load(text); } 21 | catch(e) { 22 | var loc = e.mark; 23 | found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message }); 24 | } 25 | return found; 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/lint/json-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint 5 | 6 | // declare global: jsonlint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "json", function(text) { 19 | var found = []; 20 | jsonlint.parseError = function(str, hash) { 21 | var loc = hash.loc; 22 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), 23 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), 24 | message: str}); 25 | }; 26 | try { jsonlint.parse(text); } 27 | catch(e) {} 28 | return found; 29 | }); 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 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 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 13 | if (prev == CodeMirror.Init) prev = false; 14 | if (prev && !val) 15 | cm.removeOverlay("trailingspace"); 16 | else if (!prev && val) 17 | cm.addOverlay({ 18 | token: function(stream) { 19 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 20 | if (i > stream.pos) { stream.pos = i; return null; } 21 | stream.pos = l; 22 | return "trailingspace"; 23 | }, 24 | name: "trailingspace" 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/rust/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 4}, "rust"); 6 | function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));} 7 | 8 | MT('integer_test', 9 | '[number 123i32]', 10 | '[number 123u32]', 11 | '[number 123_u32]', 12 | '[number 0xff_u8]', 13 | '[number 0o70_i16]', 14 | '[number 0b1111_1111_1001_0000_i32]', 15 | '[number 0usize]'); 16 | 17 | MT('float_test', 18 | '[number 123.0f64]', 19 | '[number 0.1f64]', 20 | '[number 0.1f32]', 21 | '[number 12E+99_f64]'); 22 | 23 | MT('string-literals-test', 24 | '[string "foo"]', 25 | '[string r"foo"]', 26 | '[string "\\"foo\\""]', 27 | '[string r#""foo""#]', 28 | '[string "foo #\\"# bar"]', 29 | '[string r##"foo #"# bar"##]', 30 | 31 | '[string b"foo"]', 32 | '[string br"foo"]', 33 | '[string b"\\"foo\\""]', 34 | '[string br#""foo""#]', 35 | '[string br##"foo #" bar"##]', 36 | 37 | "[string-2 'h']", 38 | "[string-2 b'h']"); 39 | 40 | })(); 41 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/lint/css-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on csslint.js from https://github.com/stubbornella/csslint 5 | 6 | // declare global: CSSLint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "css", function(text) { 19 | var found = []; 20 | if (!window.CSSLint) return found; 21 | var results = CSSLint.verify(text), messages = results.messages, message = null; 22 | for ( var i = 0; i < messages.length; i++) { 23 | message = messages[i]; 24 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; 25 | found.push({ 26 | from: CodeMirror.Pos(startLine, startCol), 27 | to: CodeMirror.Pos(endLine, endCol), 28 | message: message.message, 29 | severity : message.type 30 | }); 31 | } 32 | return found; 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/diff/diff.js: -------------------------------------------------------------------------------- 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("diff", function() { 15 | 16 | var TOKEN_NAMES = { 17 | '+': 'positive', 18 | '-': 'negative', 19 | '@': 'meta' 20 | }; 21 | 22 | return { 23 | token: function(stream) { 24 | var tw_pos = stream.string.search(/[\t ]+?$/); 25 | 26 | if (!stream.sol() || tw_pos === 0) { 27 | stream.skipToEnd(); 28 | return ("error " + ( 29 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); 30 | } 31 | 32 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); 33 | 34 | if (tw_pos === -1) { 35 | stream.skipToEnd(); 36 | } else { 37 | stream.pos = tw_pos; 38 | } 39 | 40 | return token_name; 41 | } 42 | }; 43 | }); 44 | 45 | CodeMirror.defineMIME("text/x-diff", "diff"); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/tern/worker.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // declare global: tern, server 5 | 6 | var server; 7 | 8 | this.onmessage = function(e) { 9 | var data = e.data; 10 | switch (data.type) { 11 | case "init": return startServer(data.defs, data.plugins, data.scripts); 12 | case "add": return server.addFile(data.name, data.text); 13 | case "del": return server.delFile(data.name); 14 | case "req": return server.request(data.body, function(err, reqData) { 15 | postMessage({id: data.id, body: reqData, err: err && String(err)}); 16 | }); 17 | case "getFile": 18 | var c = pending[data.id]; 19 | delete pending[data.id]; 20 | return c(data.err, data.text); 21 | default: throw new Error("Unknown message type: " + data.type); 22 | } 23 | }; 24 | 25 | var nextId = 0, pending = {}; 26 | function getFile(file, c) { 27 | postMessage({type: "getFile", name: file, id: ++nextId}); 28 | pending[nextId] = c; 29 | } 30 | 31 | function startServer(defs, plugins, scripts) { 32 | if (scripts) importScripts.apply(null, scripts); 33 | 34 | server = new tern.Server({ 35 | getFile: getFile, 36 | async: true, 37 | defs: defs, 38 | plugins: plugins 39 | }); 40 | } 41 | 42 | this.console = { 43 | log: function(v) { postMessage({type: "debug", message: v}); } 44 | }; 45 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/lint/coffeescript-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js 5 | 6 | // declare global: coffeelint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "coffeescript", function(text) { 19 | var found = []; 20 | var parseError = function(err) { 21 | var loc = err.lineNumber; 22 | found.push({from: CodeMirror.Pos(loc-1, 0), 23 | to: CodeMirror.Pos(loc, 0), 24 | severity: err.level, 25 | message: err.message}); 26 | }; 27 | try { 28 | var res = coffeelint.lint(text); 29 | for(var i = 0; i < res.length; i++) { 30 | parseError(res[i]); 31 | } 32 | } catch(e) { 33 | found.push({from: CodeMirror.Pos(e.location.first_line, 0), 34 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column), 35 | severity: 'error', 36 | message: e.message}); 37 | } 38 | return found; 39 | }); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/mscgen/index_msgenny.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeMirror: msgenny mode 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: msgenny mode

13 | 14 |
34 | 35 | 41 | 42 |

MIME types defined: text/x-msgenny

43 | 44 | 45 | -------------------------------------------------------------------------------- /site/resources/public/fonts/serif/cmun-serif.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Computer Modern Serif'; 3 | src: url('cmunrm.eot'); 4 | src: url('cmunrm.eot?#iefix') format('embedded-opentype'), 5 | url('cmunrm.woff') format('woff'), 6 | url('cmunrm.ttf') format('truetype'), 7 | url('cmunrm.svg#cmunrm') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | 12 | 13 | @font-face { 14 | font-family: 'Computer Modern Serif'; 15 | src: url('cmunbx.eot'); 16 | src: url('cmunbx.eot?#iefix') format('embedded-opentype'), 17 | url('cmunbx.woff') format('woff'), 18 | url('cmunbx.ttf') format('truetype'), 19 | url('cmunbx.svg#cmunbx') format('svg'); 20 | font-weight: bold; 21 | font-style: normal; 22 | } 23 | 24 | 25 | @font-face { 26 | font-family: 'Computer Modern Serif'; 27 | src: url('cmunti.eot'); 28 | src: url('cmunti.eot?#iefix') format('embedded-opentype'), 29 | url('cmunti.woff') format('woff'), 30 | url('cmunti.ttf') format('truetype'), 31 | url('cmunti.svg#cmunti') format('svg'); 32 | font-weight: normal; 33 | font-style: italic; 34 | } 35 | 36 | 37 | @font-face { 38 | font-family: 'Computer Modern Serif'; 39 | src: url('cmunbi.eot'); 40 | src: url('cmunbi.eot?#iefix') format('embedded-opentype'), 41 | url('cmunbi.woff') format('woff'), 42 | url('cmunbi.ttf') format('truetype'), 43 | url('cmunbi.svg#cmunbi') format('svg'); 44 | font-weight: bold; 45 | font-style: italic; 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/runmode/colorize.js: -------------------------------------------------------------------------------- 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("./runmode")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "./runmode"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; 15 | 16 | function textContent(node, out) { 17 | if (node.nodeType == 3) return out.push(node.nodeValue); 18 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) { 19 | textContent(ch, out); 20 | if (isBlock.test(node.nodeType)) out.push("\n"); 21 | } 22 | } 23 | 24 | CodeMirror.colorize = function(collection, defaultMode) { 25 | if (!collection) collection = document.body.getElementsByTagName("pre"); 26 | 27 | for (var i = 0; i < collection.length; ++i) { 28 | var node = collection[i]; 29 | var mode = node.getAttribute("data-lang") || defaultMode; 30 | if (!mode) continue; 31 | 32 | var text = []; 33 | textContent(node, text); 34 | node.innerHTML = ""; 35 | CodeMirror.runMode(text.join(""), mode, node); 36 | 37 | node.className += " cm-s-default"; 38 | } 39 | }; 40 | }); 41 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/asciiarmor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ASCII Armor (PGP) mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ASCII Armor (PGP) mode

27 |
36 | 37 | 42 | 43 |

MIME types 44 | defined: application/pgp, application/pgp-keys, application/pgp-signature

45 | 46 |
47 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/htmlembedded/htmlembedded.js: -------------------------------------------------------------------------------- 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("../htmlmixed/htmlmixed"), 7 | require("../../addon/mode/multiplex")); 8 | else if (typeof define == "function" && define.amd) // AMD 9 | define(["../../lib/codemirror", "../htmlmixed/htmlmixed", 10 | "../../addon/mode/multiplex"], mod); 11 | else // Plain browser env 12 | mod(CodeMirror); 13 | })(function(CodeMirror) { 14 | "use strict"; 15 | 16 | CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { 17 | return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { 18 | open: parserConfig.open || parserConfig.scriptStartRegex || "<%", 19 | close: parserConfig.close || parserConfig.scriptEndRegex || "%>", 20 | mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) 21 | }); 22 | }, "htmlmixed"); 23 | 24 | CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); 25 | CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); 26 | CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); 27 | CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); 28 | }); 29 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/ntriples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: NTriples mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 28 | 29 |
30 |

NTriples mode

31 |
32 | 39 |
40 | 41 | 44 |

MIME types defined: text/n-triples.

45 |
46 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/twig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Twig mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Twig mode

27 |
40 | 45 |
46 | -------------------------------------------------------------------------------- /site/resources/public/debug_state.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Parinfer - simpler Lisp editing 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 19 |
20 | 21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/spreadsheet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Spreadsheet mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Spreadsheet mode

28 |
29 | 30 | 37 | 38 |

MIME types defined: text/x-spreadsheet.

39 | 40 |

The Spreadsheet Mode

41 |

Created by Robert Plummer

42 |
43 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/http/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: HTTP mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

HTTP mode

27 | 28 | 29 |
39 | 40 | 43 | 44 |

MIME types defined: message/http.

45 |
46 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/clike/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-c"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("indent", 9 | "[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {", 10 | " [variable-3 int] [variable c] [operator =] [variable b] [operator +]", 11 | " [number 1];", 12 | " [keyword return] [operator *][variable a];", 13 | "}"); 14 | 15 | MT("indent_switch", 16 | "[keyword switch] ([variable x]) {", 17 | " [keyword case] [number 10]:", 18 | " [keyword return] [number 20];", 19 | " [keyword default]:", 20 | " [variable printf]([string \"foo %c\"], [variable x]);", 21 | "}"); 22 | 23 | MT("def", 24 | "[variable-3 void] [def foo]() {}", 25 | "[keyword struct] [def bar]{}", 26 | "[variable-3 int] [variable-3 *][def baz]() {}"); 27 | 28 | MT("double_block", 29 | "[keyword for] (;;)", 30 | " [keyword for] (;;)", 31 | " [variable x][operator ++];", 32 | "[keyword return];"); 33 | 34 | var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src"); 35 | function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); } 36 | 37 | MTCPP("cpp14_literal", 38 | "[number 10'000];", 39 | "[number 0b10'000];", 40 | "[number 0x10'000];", 41 | "[string '100000'];"); 42 | })(); 43 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/solr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Solr mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 33 | 34 |
35 |

Solr mode

36 | 37 |
38 | 47 |
48 | 49 | 55 | 56 |

MIME types defined: text/x-solr.

57 |
58 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/ecl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ECL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ECL mode

27 |
45 | 48 | 49 |

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

50 |

MIME types defined: text/x-ecl.

51 | 52 |
53 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/z80/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Z80 assembly mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Z80 assembly mode

27 | 28 | 29 |
45 | 46 | 51 | 52 |

MIME types defined: text/x-z80, text/x-ez80.

53 |
54 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/oz/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Oz mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 26 | 27 |
28 |

Oz mode

29 | 50 |

MIME type defined: text/x-oz.

51 | 52 | 59 |
60 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/scroll/simplescrollbars.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { 2 | position: absolute; 3 | background: #ccc; 4 | -moz-box-sizing: border-box; 5 | box-sizing: border-box; 6 | border: 1px solid #bbb; 7 | border-radius: 2px; 8 | } 9 | 10 | .CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { 11 | position: absolute; 12 | z-index: 6; 13 | background: #eee; 14 | } 15 | 16 | .CodeMirror-simplescroll-horizontal { 17 | bottom: 0; left: 0; 18 | height: 8px; 19 | } 20 | .CodeMirror-simplescroll-horizontal div { 21 | bottom: 0; 22 | height: 100%; 23 | } 24 | 25 | .CodeMirror-simplescroll-vertical { 26 | right: 0; top: 0; 27 | width: 8px; 28 | } 29 | .CodeMirror-simplescroll-vertical div { 30 | right: 0; 31 | width: 100%; 32 | } 33 | 34 | 35 | .CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { 36 | display: none; 37 | } 38 | 39 | .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { 40 | position: absolute; 41 | background: #bcd; 42 | border-radius: 3px; 43 | } 44 | 45 | .CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { 46 | position: absolute; 47 | z-index: 6; 48 | } 49 | 50 | .CodeMirror-overlayscroll-horizontal { 51 | bottom: 0; left: 0; 52 | height: 6px; 53 | } 54 | .CodeMirror-overlayscroll-horizontal div { 55 | bottom: 0; 56 | height: 100%; 57 | } 58 | 59 | .CodeMirror-overlayscroll-vertical { 60 | right: 0; top: 0; 61 | width: 6px; 62 | } 63 | .CodeMirror-overlayscroll-vertical div { 64 | right: 0; 65 | width: 100%; 66 | } 67 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/display/fullscreen.js: -------------------------------------------------------------------------------- 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.defineOption("fullScreen", false, function(cm, val, old) { 15 | if (old == CodeMirror.Init) old = false; 16 | if (!old == !val) return; 17 | if (val) setFullscreen(cm); 18 | else setNormal(cm); 19 | }); 20 | 21 | function setFullscreen(cm) { 22 | var wrap = cm.getWrapperElement(); 23 | cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, 24 | width: wrap.style.width, height: wrap.style.height}; 25 | wrap.style.width = ""; 26 | wrap.style.height = "auto"; 27 | wrap.className += " CodeMirror-fullscreen"; 28 | document.documentElement.style.overflow = "hidden"; 29 | cm.refresh(); 30 | } 31 | 32 | function setNormal(cm) { 33 | var wrap = cm.getWrapperElement(); 34 | wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); 35 | document.documentElement.style.overflow = ""; 36 | var info = cm.state.fullScreenRestore; 37 | wrap.style.width = info.width; wrap.style.height = info.height; 38 | window.scrollTo(info.scrollLeft, info.scrollTop); 39 | cm.refresh(); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/turtle/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Turtle mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Turtle mode

27 |
41 | 47 | 48 |

MIME types defined: text/turtle.

49 | 50 |
51 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/scroll/scrollpastend.js: -------------------------------------------------------------------------------- 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.defineOption("scrollPastEnd", false, function(cm, val, old) { 15 | if (old && old != CodeMirror.Init) { 16 | cm.off("change", onChange); 17 | cm.off("refresh", updateBottomMargin); 18 | cm.display.lineSpace.parentNode.style.paddingBottom = ""; 19 | cm.state.scrollPastEndPadding = null; 20 | } 21 | if (val) { 22 | cm.on("change", onChange); 23 | cm.on("refresh", updateBottomMargin); 24 | updateBottomMargin(cm); 25 | } 26 | }); 27 | 28 | function onChange(cm, change) { 29 | if (CodeMirror.changeEnd(change).line == cm.lastLine()) 30 | updateBottomMargin(cm); 31 | } 32 | 33 | function updateBottomMargin(cm) { 34 | var padding = ""; 35 | if (cm.lineCount() > 1) { 36 | var totalH = cm.display.scroller.clientHeight - 30, 37 | lastLineH = cm.getLineHandle(cm.lastLine()).height; 38 | padding = (totalH - lastLineH) + "px"; 39 | } 40 | if (cm.state.scrollPastEndPadding != padding) { 41 | cm.state.scrollPastEndPadding = padding; 42 | cm.display.lineSpace.parentNode.style.paddingBottom = padding; 43 | cm.setSize(); 44 | } 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/lint/html-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on htmlhint.js from http://htmlhint.com/js/htmlhint.js 5 | 6 | // declare global: HTMLHint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror"), require("htmlhint")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror", "htmlhint"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | var defaultRules = { 19 | "tagname-lowercase": true, 20 | "attr-lowercase": true, 21 | "attr-value-double-quotes": true, 22 | "doctype-first": false, 23 | "tag-pair": true, 24 | "spec-char-escape": true, 25 | "id-unique": true, 26 | "src-not-empty": true, 27 | "attr-no-duplication": true 28 | }; 29 | 30 | CodeMirror.registerHelper("lint", "html", function(text, options) { 31 | var found = []; 32 | if (!window.HTMLHint) return found; 33 | var messages = HTMLHint.verify(text, options && options.rules || defaultRules); 34 | for (var i = 0; i < messages.length; i++) { 35 | var message = messages[i]; 36 | var startLine = message.line - 1, endLine = message.line - 1, startCol = message.col - 1, endCol = message.col; 37 | found.push({ 38 | from: CodeMirror.Pos(startLine, startCol), 39 | to: CodeMirror.Pos(endLine, endCol), 40 | message: message.message, 41 | severity : message.type 42 | }); 43 | } 44 | return found; 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/pascal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pascal mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pascal mode

27 | 28 | 29 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-pascal.

61 |
62 | -------------------------------------------------------------------------------- /site/resources/public/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Parinfer - simpler Lisp editing 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/pig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pig Latin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pig Latin mode

27 |
39 | 40 | 47 | 48 |

49 | Simple mode that handles Pig Latin language. 50 |

51 | 52 |

MIME type defined: text/x-pig 53 | (PIG code) 54 | 55 |

56 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/display/autorefresh.js: -------------------------------------------------------------------------------- 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.defineOption("autoRefresh", false, function(cm, val) { 15 | if (cm.state.autoRefresh) { 16 | stopListening(cm, cm.state.autoRefresh) 17 | cm.state.autoRefresh = null 18 | } 19 | if (val && cm.display.wrapper.offsetHeight == 0) 20 | startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250}) 21 | }) 22 | 23 | function startListening(cm, state) { 24 | function check() { 25 | if (cm.display.wrapper.offsetHeight) { 26 | stopListening(cm, state) 27 | if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight) 28 | cm.refresh() 29 | } else { 30 | state.timeout = setTimeout(check, state.delay) 31 | } 32 | } 33 | state.timeout = setTimeout(check, state.delay) 34 | state.hurry = function() { 35 | clearTimeout(state.timeout) 36 | state.timeout = setTimeout(check, 50) 37 | } 38 | CodeMirror.on(window, "mouseup", state.hurry) 39 | CodeMirror.on(window, "keyup", state.hurry) 40 | } 41 | 42 | function stopListening(_cm, state) { 43 | clearTimeout(state.timeout) 44 | CodeMirror.off(window, "mouseup", state.hurry) 45 | CodeMirror.off(window, "keyup", state.hurry) 46 | } 47 | }); 48 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/vbscript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: VBScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

VBScript mode

27 | 28 | 29 |
46 | 47 | 53 | 54 |

MIME types defined: text/vbscript.

55 |
56 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/gherkin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Gherkin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Gherkin mode

27 |
42 | 45 | 46 |

MIME types defined: text/x-feature.

47 | 48 |
49 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/properties/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Properties files mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Properties files mode

27 |
46 | 49 | 50 |

MIME types defined: text/x-properties, 51 | text/x-ini.

52 | 53 |
54 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/fold/indent-fold.js: -------------------------------------------------------------------------------- 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.registerHelper("fold", "indent", function(cm, start) { 15 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); 16 | if (!/\S/.test(firstLine)) return; 17 | var getIndent = function(line) { 18 | return CodeMirror.countColumn(line, null, tabSize); 19 | }; 20 | var myIndent = getIndent(firstLine); 21 | var lastLineInFold = null; 22 | // Go through lines until we find a line that definitely doesn't belong in 23 | // the block we're folding, or to the end. 24 | for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { 25 | var curLine = cm.getLine(i); 26 | var curIndent = getIndent(curLine); 27 | if (curIndent > myIndent) { 28 | // Lines with a greater indent are considered part of the block. 29 | lastLineInFold = i; 30 | } else if (!/\S/.test(curLine)) { 31 | // Empty lines might be breaks within the block we're trying to fold. 32 | } else { 33 | // A non-empty line at an indent equal to or less than ours marks the 34 | // start of another block. 35 | break; 36 | } 37 | } 38 | if (lastLineInFold) return { 39 | from: CodeMirror.Pos(start.line, firstLine.length), 40 | to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) 41 | }; 42 | }); 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/rust/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Rust mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Rust mode

28 | 29 | 30 |
53 | 54 | 62 | 63 |

MIME types defined: text/x-rustsrc.

64 |
65 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/fold/markdown-fold.js: -------------------------------------------------------------------------------- 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.registerHelper("fold", "markdown", function(cm, start) { 15 | var maxDepth = 100; 16 | 17 | function isHeader(lineNo) { 18 | var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0)); 19 | return tokentype && /\bheader\b/.test(tokentype); 20 | } 21 | 22 | function headerLevel(lineNo, line, nextLine) { 23 | var match = line && line.match(/^#+/); 24 | if (match && isHeader(lineNo)) return match[0].length; 25 | match = nextLine && nextLine.match(/^[=\-]+\s*$/); 26 | if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2; 27 | return maxDepth; 28 | } 29 | 30 | var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1); 31 | var level = headerLevel(start.line, firstLine, nextLine); 32 | if (level === maxDepth) return undefined; 33 | 34 | var lastLineNo = cm.lastLine(); 35 | var end = start.line, nextNextLine = cm.getLine(end + 2); 36 | while (end < lastLineNo) { 37 | if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break; 38 | ++end; 39 | nextLine = nextNextLine; 40 | nextNextLine = cm.getLine(end + 2); 41 | } 42 | 43 | return { 44 | from: CodeMirror.Pos(start.line, firstLine.length), 45 | to: CodeMirror.Pos(end, cm.getLine(end).length) 46 | }; 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/javascript/typescript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: TypeScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

TypeScript mode

27 | 28 | 29 |
51 | 52 | 59 | 60 |

This is a specialization of the JavaScript mode.

61 |
62 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/hint/anyword-hint.js: -------------------------------------------------------------------------------- 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 | var WORD = /[\w$]+/, RANGE = 500; 15 | 16 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) { 17 | var word = options && options.word || WORD; 18 | var range = options && options.range || RANGE; 19 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line); 20 | var end = cur.ch, start = end; 21 | while (start && word.test(curLine.charAt(start - 1))) --start; 22 | var curWord = start != end && curLine.slice(start, end); 23 | 24 | var list = options && options.list || [], seen = {}; 25 | var re = new RegExp(word.source, "g"); 26 | for (var dir = -1; dir <= 1; dir += 2) { 27 | var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; 28 | for (; line != endLine; line += dir) { 29 | var text = editor.getLine(line), m; 30 | while (m = re.exec(text)) { 31 | if (line == cur.line && m[0] === curWord) continue; 32 | if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) { 33 | seen[m[0]] = true; 34 | list.push(m[0]); 35 | } 36 | } 37 | } 38 | } 39 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/sass/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Sass mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Sass mode

28 |
58 | 64 | 65 |

MIME types defined: text/x-sass.

66 |
67 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/perl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Perl mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Perl mode

27 | 28 | 29 |
67 | 68 | 73 | 74 |

MIME types defined: text/x-perl.

75 |
76 | -------------------------------------------------------------------------------- /site/src/parinfer_site/parinfer.cljs: -------------------------------------------------------------------------------- 1 | (ns parinfer-site.parinfer) 2 | 3 | (defn major-version [] 4 | (aget js/window "parinfer" "version" "0")) 5 | 6 | (defn- convert-changed-line [e] 7 | {:line-no (aget e "lineNo") 8 | :line (aget e "line")}) 9 | 10 | (defn- convert-error [e] 11 | (when e 12 | {:name (aget e "name") 13 | :message (aget e "message") 14 | :line-no (aget e "lineNo") 15 | :x (aget e "x") 16 | :extra (when-let [extra (aget e "extra")] 17 | {:name (aget extra "name") 18 | :line-no (aget extra "lineNo") 19 | :x (aget extra "x")})})) 20 | 21 | (defn- convert-result [result] 22 | {:text (aget result "text") 23 | :cursor-x (aget result "cursorX") 24 | :success? (aget result "success") 25 | :changed-lines (mapv convert-changed-line (aget result "changedLines")) 26 | :error (convert-error (aget result "error"))}) 27 | 28 | (defn- convert-options [options] 29 | #js {:cursorX (:cursor-x options) 30 | :cursorLine (:cursor-line options) 31 | :prevCursorX (:prev-cursor-x options) 32 | :prevCursorLine (:prev-cursor-line options) 33 | :changes (clj->js (:changes options)) 34 | :forceBalance (:force-balance options)}) 35 | 36 | (def smart-mode* (aget js/window "parinfer" "smartMode")) 37 | (def indent-mode* (aget js/window "parinfer" "indentMode")) 38 | (def paren-mode* (aget js/window "parinfer" "parenMode")) 39 | 40 | (defn smart-mode 41 | ([text] (convert-result (smart-mode* text))) 42 | ([text options] (convert-result (smart-mode* text (convert-options options))))) 43 | 44 | (defn indent-mode 45 | ([text] (convert-result (indent-mode* text))) 46 | ([text options] (convert-result (indent-mode* text (convert-options options))))) 47 | 48 | (defn paren-mode 49 | ([text] (convert-result (paren-mode* text))) 50 | ([text options] (convert-result (paren-mode* text (convert-options options))))) 51 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/elm/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Elm mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Elm mode

27 | 28 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-elm.

61 |
62 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/idl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: IDL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

IDL mode

27 | 28 |
52 | 62 | 63 |

MIME types defined: text/x-idl.

64 |
65 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/dart/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Dart mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Dart mode

27 |
28 | 62 |
63 | 64 | 70 | 71 |
72 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/handlebars/handlebars.js: -------------------------------------------------------------------------------- 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("../../addon/mode/simple")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../../addon/mode/simple"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineSimpleMode("handlebars", { 15 | start: [ 16 | { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, 17 | { regex: /\{\{!/, push: "comment", token: "comment" }, 18 | { regex: /\{\{/, push: "handlebars", token: "tag" } 19 | ], 20 | handlebars: [ 21 | { regex: /\}\}/, pop: true, token: "tag" }, 22 | 23 | // Double and single quotes 24 | { regex: /"(?:[^\\]|\\.)*?"/, token: "string" }, 25 | { regex: /'(?:[^\\]|\\.)*?'/, token: "string" }, 26 | 27 | // Handlebars keywords 28 | { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, 29 | { regex: /(?:else|this)\b/, token: "keyword" }, 30 | 31 | // Numeral 32 | { regex: /\d+/i, token: "number" }, 33 | 34 | // Atoms like = and . 35 | { regex: /=|~|@|true|false/, token: "atom" }, 36 | 37 | // Paths 38 | { regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" } 39 | ], 40 | dash_comment: [ 41 | { regex: /--\}\}/, pop: true, token: "comment" }, 42 | 43 | // Commented code 44 | { regex: /./, token: "comment"} 45 | ], 46 | comment: [ 47 | { regex: /\}\}/, pop: true, token: "comment" }, 48 | { regex: /./, token: "comment" } 49 | ] 50 | }); 51 | 52 | CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); 53 | }); 54 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/xml/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } 7 | 8 | MT("matching", 9 | "[tag&bracket <][tag top][tag&bracket >]", 10 | " text", 11 | " [tag&bracket <][tag inner][tag&bracket />]", 12 | "[tag&bracket ]"); 13 | 14 | MT("nonmatching", 15 | "[tag&bracket <][tag top][tag&bracket >]", 16 | " [tag&bracket <][tag inner][tag&bracket />]", 17 | " [tag&bracket ]"); 18 | 19 | MT("doctype", 20 | "[meta ]", 21 | "[tag&bracket <][tag top][tag&bracket />]"); 22 | 23 | MT("cdata", 24 | "[tag&bracket <][tag top][tag&bracket >]", 25 | " [atom ]", 27 | "[tag&bracket ]"); 28 | 29 | // HTML tests 30 | mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); 31 | 32 | MT("selfclose", 33 | "[tag&bracket <][tag html][tag&bracket >]", 34 | " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", 35 | "[tag&bracket ]"); 36 | 37 | MT("list", 38 | "[tag&bracket <][tag ol][tag&bracket >]", 39 | " [tag&bracket <][tag li][tag&bracket >]one", 40 | " [tag&bracket <][tag li][tag&bracket >]two", 41 | "[tag&bracket ]"); 42 | 43 | MT("valueless", 44 | "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); 45 | 46 | MT("pThenArticle", 47 | "[tag&bracket <][tag p][tag&bracket >]", 48 | " foo", 49 | "[tag&bracket <][tag article][tag&bracket >]bar"); 50 | 51 | })(); 52 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/edit/continuelist.js: -------------------------------------------------------------------------------- 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 | var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/, 15 | emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/, 16 | unorderedListRE = /[*+-]\s/; 17 | 18 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { 19 | if (cm.getOption("disableInput")) return CodeMirror.Pass; 20 | var ranges = cm.listSelections(), replacements = []; 21 | for (var i = 0; i < ranges.length; i++) { 22 | var pos = ranges[i].head; 23 | var eolState = cm.getStateAfter(pos.line); 24 | var inList = eolState.list !== false; 25 | var inQuote = eolState.quote !== 0; 26 | 27 | var line = cm.getLine(pos.line), match = listRE.exec(line); 28 | if (!ranges[i].empty() || (!inList && !inQuote) || !match) { 29 | cm.execCommand("newlineAndIndent"); 30 | return; 31 | } 32 | if (emptyListRE.test(line)) { 33 | cm.replaceRange("", { 34 | line: pos.line, ch: 0 35 | }, { 36 | line: pos.line, ch: pos.ch + 1 37 | }); 38 | replacements[i] = "\n"; 39 | } else { 40 | var indent = match[1], after = match[5]; 41 | var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 42 | ? match[2] 43 | : (parseInt(match[3], 10) + 1) + match[4]; 44 | 45 | replacements[i] = "\n" + indent + bullet + after; 46 | } 47 | } 48 | 49 | cm.replaceSelections(replacements); 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/jinja2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Jinja2 mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Jinja2 mode

27 |
49 | 54 |
55 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/shell/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({}, "shell"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("var", 9 | "text [def $var] text"); 10 | MT("varBraces", 11 | "text[def ${var}]text"); 12 | MT("varVar", 13 | "text [def $a$b] text"); 14 | MT("varBracesVarBraces", 15 | "text[def ${a}${b}]text"); 16 | 17 | MT("singleQuotedVar", 18 | "[string 'text $var text']"); 19 | MT("singleQuotedVarBraces", 20 | "[string 'text ${var} text']"); 21 | 22 | MT("doubleQuotedVar", 23 | '[string "text ][def $var][string text"]'); 24 | MT("doubleQuotedVarBraces", 25 | '[string "text][def ${var}][string text"]'); 26 | MT("doubleQuotedVarPunct", 27 | '[string "text ][def $@][string text"]'); 28 | MT("doubleQuotedVarVar", 29 | '[string "][def $a$b][string "]'); 30 | MT("doubleQuotedVarBracesVarBraces", 31 | '[string "][def ${a}${b}][string "]'); 32 | 33 | MT("notAString", 34 | "text\\'text"); 35 | MT("escapes", 36 | "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); 37 | 38 | MT("subshell", 39 | "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); 40 | MT("doubleQuotedSubshell", 41 | "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); 42 | 43 | MT("hashbang", 44 | "[meta #!/bin/bash]"); 45 | MT("comment", 46 | "text [comment # Blurb]"); 47 | 48 | MT("numbers", 49 | "[number 0] [number 1] [number 2]"); 50 | MT("keywords", 51 | "[keyword while] [atom true]; [keyword do]", 52 | " [builtin sleep] [number 3]", 53 | "[keyword done]"); 54 | MT("options", 55 | "[builtin ls] [attribute -l] [attribute --human-readable]"); 56 | MT("operator", 57 | "[def var][operator =]value"); 58 | })(); 59 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/dart/dart.js: -------------------------------------------------------------------------------- 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("../clike/clike")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../clike/clike"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var keywords = ("this super static final const abstract class extends external factory " + 15 | "implements get native operator set typedef with enum throw rethrow " + 16 | "assert break case continue default in return new deferred async await " + 17 | "try catch finally do else for if switch while import library export " + 18 | "part of show hide is").split(" "); 19 | var blockKeywords = "try catch finally do else for if switch while".split(" "); 20 | var atoms = "true false null".split(" "); 21 | var builtins = "void bool num int double dynamic var String".split(" "); 22 | 23 | function set(words) { 24 | var obj = {}; 25 | for (var i = 0; i < words.length; ++i) obj[words[i]] = true; 26 | return obj; 27 | } 28 | 29 | CodeMirror.defineMIME("application/dart", { 30 | name: "clike", 31 | keywords: set(keywords), 32 | multiLineStrings: true, 33 | blockKeywords: set(blockKeywords), 34 | builtin: set(builtins), 35 | atoms: set(atoms), 36 | hooks: { 37 | "@": function(stream) { 38 | stream.eatWhile(/[\w\$_]/); 39 | return "meta"; 40 | } 41 | } 42 | }); 43 | 44 | CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins)); 45 | 46 | // This is needed to make loading through meta.js work. 47 | CodeMirror.defineMode("dart", function(conf) { 48 | return CodeMirror.getMode(conf, "application/dart"); 49 | }, "clike"); 50 | }); 51 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/sparql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: SPARQL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

SPARQL mode

28 |
52 | 58 | 59 |

MIME types defined: application/sparql-query.

60 | 61 |
62 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/shell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Shell mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 27 | 28 |
29 |

Shell mode

30 | 31 | 32 | 56 | 57 | 64 | 65 |

MIME types defined: text/x-sh.

66 |
67 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/tornado/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Tornado template mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | 28 |
29 |

Tornado template mode

30 |
50 | 51 | 59 | 60 |

Mode for HTML with embedded Tornado template markup.

61 | 62 |

MIME types defined: text/x-tornado

63 |
64 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/css/less_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | "use strict"; 6 | 7 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); 8 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } 9 | 10 | MT("variable", 11 | "[variable-2 @base]: [atom #f04615];", 12 | "[qualifier .class] {", 13 | " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", 14 | " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", 15 | "}"); 16 | 17 | MT("amp", 18 | "[qualifier .child], [qualifier .sibling] {", 19 | " [qualifier .parent] [atom &] {", 20 | " [property color]: [keyword black];", 21 | " }", 22 | " [atom &] + [atom &] {", 23 | " [property color]: [keyword red];", 24 | " }", 25 | "}"); 26 | 27 | MT("mixin", 28 | "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", 29 | " [property color]: [variable darken]([variable-2 @color], [number 10%]);", 30 | "}", 31 | "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", 32 | " [property color]: [variable lighten]([variable-2 @color], [number 10%]);", 33 | "}", 34 | "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", 35 | " [property display]: [atom block];", 36 | "}", 37 | "[variable-2 @switch]: [variable light];", 38 | "[qualifier .class] {", 39 | " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", 40 | "}"); 41 | 42 | MT("nest", 43 | "[qualifier .one] {", 44 | " [def @media] ([property width]: [number 400px]) {", 45 | " [property font-size]: [number 1.2em];", 46 | " [def @media] [attribute print] [keyword and] [property color] {", 47 | " [property color]: [keyword blue];", 48 | " }", 49 | " }", 50 | "}"); 51 | 52 | 53 | MT("interpolation", ".@{[variable foo]} { [property font-weight]: [atom bold]; }"); 54 | })(); 55 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/forth/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Forth mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 31 | 32 |
33 | 34 |

Forth mode

35 | 36 |
57 |
58 | 59 | 70 | 71 |

Simple mode that handle Forth-Syntax (Forth on WikiPedia).

72 | 73 |

MIME types defined: text/x-forth.

74 | 75 |
76 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/mscgen/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Oz mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 23 | 24 |
25 |

MscGen mode

26 | 27 |
56 | 57 | 63 | 64 |

MIME types defined: text/x-mscgen

65 |
66 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/gas/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Gas mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Gas mode

27 |
28 | 50 |
51 | 52 | 58 | 59 |

Handles AT&T assembler syntax (more specifically this handles 60 | the GNU Assembler (gas) syntax.) 61 | It takes a single optional configuration parameter: 62 | architecture, which can be one of "ARM", 63 | "ARMv6" or "x86". 64 | Including the parameter adds syntax for the registers and special 65 | directives for the supplied architecture. 66 | 67 |

MIME types defined: text/x-gas

68 |
69 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/mscgen/index_xu.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeMirror: xu mode 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: xù mode

13 | 14 |
60 | 61 | 67 | 68 |

MIME types defined: text/x-xu

69 | 70 | 71 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/toml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: TOML Mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

TOML Mode

27 |
64 | 70 |

The TOML Mode

71 |

Created by Forbes Lindesay.

72 |

MIME type defined: text/x-toml.

73 |
74 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/octave/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Octave mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Octave mode

27 | 28 |
71 | 81 | 82 |

MIME types defined: text/x-octave.

83 |
84 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/pegjs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: PEG.js Mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 28 | 29 |
30 |

PEG.js Mode

31 |
56 | 62 |

The PEG.js Mode

63 |

Created by Forbes Lindesay.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/tiki/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Tiki wiki mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Tiki wiki mode

28 | 29 | 30 |
87 | 88 | 94 | 95 |
96 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/cypher/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Cypher Mode for CodeMirror 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 30 | 31 |
32 |

Cypher Mode for CodeMirror

33 |
34 | 40 |
41 |

MIME types defined: 42 | application/x-cypher-query 43 |

44 | 62 | 63 |
64 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/xml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: XML mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

XML mode

27 |
39 | 45 |

The XML mode supports two configuration parameters:

46 |
47 |
htmlMode (boolean)
48 |
This switches the mode to parse HTML instead of XML. This 49 | means attributes do not have to be quoted, and some elements 50 | (such as br) do not require a closing tag.
51 |
alignCDATA (boolean)
52 |
Setting this to true will force the opening tag of CDATA 53 | blocks to not be indented.
54 |
55 | 56 |

MIME types defined: application/xml, text/html.

57 |
58 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/smalltalk/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Smalltalk mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 29 | 30 |
31 |

Smalltalk mode

32 |
55 | 56 | 64 | 65 |

Simple Smalltalk mode.

66 | 67 |

MIME types defined: text/x-stsrc.

68 |
69 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/soy/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Soy (Closure Template) mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 29 | 30 |
31 |

Soy (Closure Template) mode

32 |
55 | 56 | 65 | 66 |

A mode for Closure Templates (Soy).

67 |

MIME type defined: text/x-soy.

68 |
69 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/css/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: CSS mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | 28 |
29 |

CSS mode

30 |
65 | 70 | 71 |

MIME types defined: text/css, text/x-scss (demo), text/x-less (demo).

72 | 73 |

Parsing/Highlighting Tests: normal, verbose.

74 | 75 |
76 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/fold/comment-fold.js: -------------------------------------------------------------------------------- 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.registerGlobalHelper("fold", "comment", function(mode) { 15 | return mode.blockCommentStart && mode.blockCommentEnd; 16 | }, function(cm, start) { 17 | var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd; 18 | if (!startToken || !endToken) return; 19 | var line = start.line, lineText = cm.getLine(line); 20 | 21 | var startCh; 22 | for (var at = start.ch, pass = 0;;) { 23 | var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1); 24 | if (found == -1) { 25 | if (pass == 1) return; 26 | pass = 1; 27 | at = lineText.length; 28 | continue; 29 | } 30 | if (pass == 1 && found < start.ch) return; 31 | if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) { 32 | startCh = found + startToken.length; 33 | break; 34 | } 35 | at = found - 1; 36 | } 37 | 38 | var depth = 1, lastLine = cm.lastLine(), end, endCh; 39 | outer: for (var i = line; i <= lastLine; ++i) { 40 | var text = cm.getLine(i), pos = i == line ? startCh : 0; 41 | for (;;) { 42 | var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); 43 | if (nextOpen < 0) nextOpen = text.length; 44 | if (nextClose < 0) nextClose = text.length; 45 | pos = Math.min(nextOpen, nextClose); 46 | if (pos == text.length) break; 47 | if (pos == nextOpen) ++depth; 48 | else if (!--depth) { end = i; endCh = pos; break outer; } 49 | ++pos; 50 | } 51 | } 52 | if (end == null || line == end && endCh == startCh) return; 53 | return {from: CodeMirror.Pos(line, startCh), 54 | to: CodeMirror.Pos(end, endCh)}; 55 | }); 56 | 57 | }); 58 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/tern/tern.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-Tern-completion { 2 | padding-left: 22px; 3 | position: relative; 4 | line-height: 1.5; 5 | } 6 | .CodeMirror-Tern-completion:before { 7 | position: absolute; 8 | left: 2px; 9 | bottom: 2px; 10 | border-radius: 50%; 11 | font-size: 12px; 12 | font-weight: bold; 13 | height: 15px; 14 | width: 15px; 15 | line-height: 16px; 16 | text-align: center; 17 | color: white; 18 | -moz-box-sizing: border-box; 19 | box-sizing: border-box; 20 | } 21 | .CodeMirror-Tern-completion-unknown:before { 22 | content: "?"; 23 | background: #4bb; 24 | } 25 | .CodeMirror-Tern-completion-object:before { 26 | content: "O"; 27 | background: #77c; 28 | } 29 | .CodeMirror-Tern-completion-fn:before { 30 | content: "F"; 31 | background: #7c7; 32 | } 33 | .CodeMirror-Tern-completion-array:before { 34 | content: "A"; 35 | background: #c66; 36 | } 37 | .CodeMirror-Tern-completion-number:before { 38 | content: "1"; 39 | background: #999; 40 | } 41 | .CodeMirror-Tern-completion-string:before { 42 | content: "S"; 43 | background: #999; 44 | } 45 | .CodeMirror-Tern-completion-bool:before { 46 | content: "B"; 47 | background: #999; 48 | } 49 | 50 | .CodeMirror-Tern-completion-guess { 51 | color: #999; 52 | } 53 | 54 | .CodeMirror-Tern-tooltip { 55 | border: 1px solid silver; 56 | border-radius: 3px; 57 | color: #444; 58 | padding: 2px 5px; 59 | font-size: 90%; 60 | font-family: monospace; 61 | background-color: white; 62 | white-space: pre-wrap; 63 | 64 | max-width: 40em; 65 | position: absolute; 66 | z-index: 10; 67 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 68 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 69 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 70 | 71 | transition: opacity 1s; 72 | -moz-transition: opacity 1s; 73 | -webkit-transition: opacity 1s; 74 | -o-transition: opacity 1s; 75 | -ms-transition: opacity 1s; 76 | } 77 | 78 | .CodeMirror-Tern-hint-doc { 79 | max-width: 25em; 80 | margin-top: -3px; 81 | } 82 | 83 | .CodeMirror-Tern-fname { color: black; } 84 | .CodeMirror-Tern-farg { color: #70a; } 85 | .CodeMirror-Tern-farg-current { text-decoration: underline; } 86 | .CodeMirror-Tern-type { color: #07c; } 87 | .CodeMirror-Tern-fhint-guess { opacity: .7; } 88 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/php/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: PHP mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 30 | 31 |
32 |

PHP mode

33 |
48 | 49 | 58 | 59 |

Simple HTML/PHP mode based on 60 | the C-like mode. Depends on XML, 61 | JavaScript, CSS, HTMLMixed, and C-like modes.

62 | 63 |

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

64 |
65 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/htmlembedded/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Html Embedded Scripts mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 29 | 30 |
31 |

Html Embedded Scripts mode

32 |
44 | 45 | 53 | 54 |

Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on 55 | JavaScript, CSS and XML.
Other dependancies include those of the scriping language chosen.

56 | 57 |

MIME types defined: application/x-aspx (ASP.NET), 58 | application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

59 |
60 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/modelica/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Modelica mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | 28 |
29 |

Modelica mode

30 | 31 |
52 | 53 | 62 | 63 |

Simple mode that tries to handle Modelica as well as it can.

64 | 65 |

MIME types defined: text/x-modelica 66 | (Modlica code).

67 |
68 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/display/placeholder.js: -------------------------------------------------------------------------------- 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 | CodeMirror.defineOption("placeholder", "", function(cm, val, old) { 13 | var prev = old && old != CodeMirror.Init; 14 | if (val && !prev) { 15 | cm.on("blur", onBlur); 16 | cm.on("change", onChange); 17 | onChange(cm); 18 | } else if (!val && prev) { 19 | cm.off("blur", onBlur); 20 | cm.off("change", onChange); 21 | clearPlaceholder(cm); 22 | var wrapper = cm.getWrapperElement(); 23 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", ""); 24 | } 25 | 26 | if (val && !cm.hasFocus()) onBlur(cm); 27 | }); 28 | 29 | function clearPlaceholder(cm) { 30 | if (cm.state.placeholder) { 31 | cm.state.placeholder.parentNode.removeChild(cm.state.placeholder); 32 | cm.state.placeholder = null; 33 | } 34 | } 35 | function setPlaceholder(cm) { 36 | clearPlaceholder(cm); 37 | var elt = cm.state.placeholder = document.createElement("pre"); 38 | elt.style.cssText = "height: 0; overflow: visible"; 39 | elt.className = "CodeMirror-placeholder"; 40 | var placeHolder = cm.getOption("placeholder") 41 | if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder) 42 | elt.appendChild(placeHolder) 43 | cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild); 44 | } 45 | 46 | function onBlur(cm) { 47 | if (isEmpty(cm)) setPlaceholder(cm); 48 | } 49 | function onChange(cm) { 50 | var wrapper = cm.getWrapperElement(), empty = isEmpty(cm); 51 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : ""); 52 | 53 | if (empty) setPlaceholder(cm); 54 | else clearPlaceholder(cm); 55 | } 56 | 57 | function isEmpty(cm) { 58 | return (cm.lineCount() === 1) && (cm.getLine(0) === ""); 59 | } 60 | }); 61 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/display/rulers.js: -------------------------------------------------------------------------------- 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.defineOption("rulers", false, function(cm, val, old) { 15 | if (old && old != CodeMirror.Init) { 16 | clearRulers(cm); 17 | cm.off("refresh", refreshRulers); 18 | } 19 | if (val && val.length) { 20 | setRulers(cm); 21 | cm.on("refresh", refreshRulers); 22 | } 23 | }); 24 | 25 | function clearRulers(cm) { 26 | for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) { 27 | var node = cm.display.lineSpace.childNodes[i]; 28 | if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className)) 29 | node.parentNode.removeChild(node); 30 | } 31 | } 32 | 33 | function setRulers(cm) { 34 | var val = cm.getOption("rulers"); 35 | var cw = cm.defaultCharWidth(); 36 | var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left; 37 | var minH = cm.display.scroller.offsetHeight + 30; 38 | for (var i = 0; i < val.length; i++) { 39 | var elt = document.createElement("div"); 40 | elt.className = "CodeMirror-ruler"; 41 | var col, conf = val[i]; 42 | if (typeof conf == "number") { 43 | col = conf; 44 | } else { 45 | col = conf.column; 46 | if (conf.className) elt.className += " " + conf.className; 47 | if (conf.color) elt.style.borderColor = conf.color; 48 | if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle; 49 | if (conf.width) elt.style.borderLeftWidth = conf.width; 50 | } 51 | elt.style.left = (left + col * cw) + "px"; 52 | elt.style.top = "-50px"; 53 | elt.style.bottom = "-20px"; 54 | elt.style.minHeight = minH + "px"; 55 | cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv); 56 | } 57 | } 58 | 59 | function refreshRulers(cm) { 60 | clearRulers(cm); 61 | setRulers(cm); 62 | } 63 | }); 64 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/factor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Factor mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 31 | 32 |
33 | 34 |

Factor mode

35 | 36 |
60 |
61 | 62 | 72 |

73 |

Simple mode that handles Factor Syntax (Factor on WikiPedia).

74 | 75 |

MIME types defined: text/x-factor.

76 | 77 |
78 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/vue/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Vue.js mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 36 | 37 |
38 |

Vue.js mode

39 |
55 | 66 | 67 |

MIME types defined: text/x-vue

68 | 69 |
70 | -------------------------------------------------------------------------------- /site/2017-addendum.md: -------------------------------------------------------------------------------- 1 | _add following banner on original page and create new page with content after 2 | the fold_ 3 | 4 | > This is the 2015 version of the page. See the new 2017 addendum describing 5 | > new behavior and tooling. 6 | 7 | --- 8 | 9 | ## New ways to simplify writing Lisp 10 | 11 | __[Parinfer] was released two years ago__ after two months of research and 12 | prototyping. It was first available for Atom, and is probably still the 13 | most widely used version. It has since been ported and integrated into many 14 | different editors seen below: 15 | 16 | > (show editor icons here with links to plugins) 17 | 18 | __There has been lots of feedback__ highlighting areas that didn't quite feel 19 | right. Many people enjoyed the core of its behavior, but the main problems that 20 | emerged were 1) edge cases causing unintended structure changes, 2) confusion 21 | over switching modes, and 3) noisy diffs on projects where Parinfer was not 22 | used by everyone. 23 | 24 | __We now have a new version__ that represents our current attempt to fix these 25 | major issues. Not all are fully resolved, but it represents the next milestone 26 | toward designing a better experience for newcomers writing Lisp. 27 | 28 | --- 29 | 30 | _still brainstorming below_ 31 | 32 | ## Animated Examples 33 | 34 | Main Improvements 35 | 36 | - no more switching modes 37 | - structural tab stops 38 | - collaboration with parlinter (gif?) 39 | 40 | Main Compromises (for reducing surprise in edge cases) 41 | 42 | - forceBalance 43 | - mismatched inline close-paren 44 | - (not the "paredit without hotkeys" as we said originally. looking at ways to improve this in #141) 45 | - pressing enter (paren mode on leading close-paren) 46 | - dedenting in smart mode 47 | - show also the cursor-holding example 48 | - correction only done after editing to prevent aggressive 49 | 50 | philosophy of traveling through invalid states 51 | - dedent example 52 | - and imbalance example 53 | - paren 54 | - string 55 | 56 | 57 | copy-paste examples? 58 | 59 | ## Problems remaining 60 | 61 | - edit-based results (rather than full string) 62 | - multiple cursors 63 | 64 | ## Contributing 65 | 66 | talk about improved test experience and readability if it helps people who want 67 | to help. 68 | 69 | ## Thanks 70 | 71 | - plugin authors 72 | - people who gave feedback 73 | - slack folks for discussions and ideas 74 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/django/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Django template mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 28 | 29 |
30 |

Django template mode

31 |
59 | 60 | 69 | 70 |

Mode for HTML with embedded Django template markup.

71 | 72 |

MIME types defined: text/x-django

73 |
74 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/apl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: APL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 27 | 28 |
29 |

APL mode

30 |
56 | 57 | 64 | 65 |

Simple mode that tries to handle APL as well as it can.

66 |

It attempts to label functions/operators based upon 67 | monadic/dyadic usage (but this is far from fully fleshed out). 68 | This means there are meaningful classnames so hover states can 69 | have popups etc.

70 | 71 |

MIME types defined: text/apl (APL code)

72 |
73 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/hint/css-hint.js: -------------------------------------------------------------------------------- 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("../../mode/css/css")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../../mode/css/css"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var pseudoClasses = {link: 1, visited: 1, active: 1, hover: 1, focus: 1, 15 | "first-letter": 1, "first-line": 1, "first-child": 1, 16 | before: 1, after: 1, lang: 1}; 17 | 18 | CodeMirror.registerHelper("hint", "css", function(cm) { 19 | var cur = cm.getCursor(), token = cm.getTokenAt(cur); 20 | var inner = CodeMirror.innerMode(cm.getMode(), token.state); 21 | if (inner.mode.name != "css") return; 22 | 23 | if (token.type == "keyword" && "!important".indexOf(token.string) == 0) 24 | return {list: ["!important"], from: CodeMirror.Pos(cur.line, token.start), 25 | to: CodeMirror.Pos(cur.line, token.end)}; 26 | 27 | var start = token.start, end = cur.ch, word = token.string.slice(0, end - start); 28 | if (/[^\w$_-]/.test(word)) { 29 | word = ""; start = end = cur.ch; 30 | } 31 | 32 | var spec = CodeMirror.resolveMode("text/css"); 33 | 34 | var result = []; 35 | function add(keywords) { 36 | for (var name in keywords) 37 | if (!word || name.lastIndexOf(word, 0) == 0) 38 | result.push(name); 39 | } 40 | 41 | var st = inner.state.state; 42 | if (st == "pseudo" || token.type == "variable-3") { 43 | add(pseudoClasses); 44 | } else if (st == "block" || st == "maybeprop") { 45 | add(spec.propertyKeywords); 46 | } else if (st == "prop" || st == "parens" || st == "at" || st == "params") { 47 | add(spec.valueKeywords); 48 | add(spec.colorKeywords); 49 | } else if (st == "media" || st == "media_parens") { 50 | add(spec.mediaTypes); 51 | add(spec.mediaFeatures); 52 | } 53 | 54 | if (result.length) return { 55 | list: result, 56 | from: CodeMirror.Pos(cur.line, start), 57 | to: CodeMirror.Pos(cur.line, end) 58 | }; 59 | }); 60 | }); 61 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/haml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: HAML mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 28 | 29 |
30 |

HAML mode

31 |
68 | 74 | 75 |

MIME types defined: text/x-haml.

76 | 77 |

Parsing/Highlighting Tests: normal, verbose.

78 | 79 |
80 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/lua/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Lua mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 26 | 27 |
28 |

Lua mode

29 |
70 | 76 | 77 |

Loosely based on Franciszek 78 | Wawrzak's CodeMirror 79 | 1 mode. One configuration parameter is 80 | supported, specials, to which you can provide an 81 | array of strings to have those identifiers highlighted with 82 | the lua-special style.

83 |

MIME types defined: text/x-lua.

84 | 85 |
86 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/yaml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: YAML mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

YAML mode

27 |
74 | 77 | 78 |

MIME types defined: text/x-yaml.

79 | 80 |
81 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/javascript/json-ld.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: JSON-LD mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | 28 |
29 |

JSON-LD mode

30 | 31 | 32 |
61 | 62 | 70 | 71 |

This is a specialization of the JavaScript mode.

72 |
73 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/rpm/changes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: RPM changes mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 26 | 27 |
28 |

RPM changes mode

29 | 30 |
57 | 64 | 65 |

MIME types defined: text/x-rpm-changes.

66 |
67 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/swift/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Swift mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 27 | 28 |
29 |

Swift mode

30 |
76 | 77 | 84 | 85 |

A simple mode for Swift

86 | 87 |

MIME types defined: text/x-swift (Swift code)

88 |
89 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/erlang/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Erlang mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 26 | 27 |
28 |

Erlang mode

29 |
65 | 66 | 74 | 75 |

MIME types defined: text/x-erlang.

76 |
77 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/haskell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Haskell mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 26 | 27 |
28 |

Haskell mode

29 |
63 | 64 | 71 | 72 |

MIME types defined: text/x-haskell.

73 |
74 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/properties/properties.js: -------------------------------------------------------------------------------- 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("properties", function() { 15 | return { 16 | token: function(stream, state) { 17 | var sol = stream.sol() || state.afterSection; 18 | var eol = stream.eol(); 19 | 20 | state.afterSection = false; 21 | 22 | if (sol) { 23 | if (state.nextMultiline) { 24 | state.inMultiline = true; 25 | state.nextMultiline = false; 26 | } else { 27 | state.position = "def"; 28 | } 29 | } 30 | 31 | if (eol && ! state.nextMultiline) { 32 | state.inMultiline = false; 33 | state.position = "def"; 34 | } 35 | 36 | if (sol) { 37 | while(stream.eatSpace()); 38 | } 39 | 40 | var ch = stream.next(); 41 | 42 | if (sol && (ch === "#" || ch === "!" || ch === ";")) { 43 | state.position = "comment"; 44 | stream.skipToEnd(); 45 | return "comment"; 46 | } else if (sol && ch === "[") { 47 | state.afterSection = true; 48 | stream.skipTo("]"); stream.eat("]"); 49 | return "header"; 50 | } else if (ch === "=" || ch === ":") { 51 | state.position = "quote"; 52 | return null; 53 | } else if (ch === "\\" && state.position === "quote") { 54 | if (stream.eol()) { // end of line? 55 | // Multiline value 56 | state.nextMultiline = true; 57 | } 58 | } 59 | 60 | return state.position; 61 | }, 62 | 63 | startState: function() { 64 | return { 65 | position : "def", // Current position, "def", "quote" or "comment" 66 | nextMultiline : false, // Is the next line multiline value 67 | inMultiline : false, // Is the current line a multiline value 68 | afterSection : false // Did we just open a section 69 | }; 70 | } 71 | 72 | }; 73 | }); 74 | 75 | CodeMirror.defineMIME("text/x-properties", "properties"); 76 | CodeMirror.defineMIME("text/x-ini", "properties"); 77 | 78 | }); 79 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/addon/mode/loadmode.js: -------------------------------------------------------------------------------- 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"), "cjs"); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); }); 9 | else // Plain browser env 10 | mod(CodeMirror, "plain"); 11 | })(function(CodeMirror, env) { 12 | if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; 13 | 14 | var loading = {}; 15 | function splitCallback(cont, n) { 16 | var countDown = n; 17 | return function() { if (--countDown == 0) cont(); }; 18 | } 19 | function ensureDeps(mode, cont) { 20 | var deps = CodeMirror.modes[mode].dependencies; 21 | if (!deps) return cont(); 22 | var missing = []; 23 | for (var i = 0; i < deps.length; ++i) { 24 | if (!CodeMirror.modes.hasOwnProperty(deps[i])) 25 | missing.push(deps[i]); 26 | } 27 | if (!missing.length) return cont(); 28 | var split = splitCallback(cont, missing.length); 29 | for (var i = 0; i < missing.length; ++i) 30 | CodeMirror.requireMode(missing[i], split); 31 | } 32 | 33 | CodeMirror.requireMode = function(mode, cont) { 34 | if (typeof mode != "string") mode = mode.name; 35 | if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); 36 | if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); 37 | 38 | var file = CodeMirror.modeURL.replace(/%N/g, mode); 39 | if (env == "plain") { 40 | var script = document.createElement("script"); 41 | script.src = file; 42 | var others = document.getElementsByTagName("script")[0]; 43 | var list = loading[mode] = [cont]; 44 | CodeMirror.on(script, "load", function() { 45 | ensureDeps(mode, function() { 46 | for (var i = 0; i < list.length; ++i) list[i](); 47 | }); 48 | }); 49 | others.parentNode.insertBefore(script, others); 50 | } else if (env == "cjs") { 51 | require(file); 52 | cont(); 53 | } else if (env == "amd") { 54 | requirejs([file], cont); 55 | } 56 | }; 57 | 58 | CodeMirror.autoLoadMode = function(instance, mode) { 59 | if (!CodeMirror.modes.hasOwnProperty(mode)) 60 | CodeMirror.requireMode(mode, function() { 61 | instance.setOption("mode", instance.getOption("mode")); 62 | }); 63 | }; 64 | }); 65 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/go/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Go mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 26 | 27 |
28 |

Go mode

29 |
72 | 73 | 83 | 84 |

MIME type: text/x-go

85 |
86 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/groovy/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Groovy mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Groovy mode

28 |
74 | 75 | 82 | 83 |

MIME types defined: text/x-groovy

84 |
85 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/brainfuck/brainfuck.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11 5 | 6 | (function(mod) { 7 | if (typeof exports == "object" && typeof module == "object") 8 | mod(require("../../lib/codemirror")) 9 | else if (typeof define == "function" && define.amd) 10 | define(["../../lib/codemirror"], mod) 11 | else 12 | mod(CodeMirror) 13 | })(function(CodeMirror) { 14 | "use strict" 15 | var reserve = "><+-.,[]".split(""); 16 | /* 17 | comments can be either: 18 | placed behind lines 19 | 20 | +++ this is a comment 21 | 22 | where reserved characters cannot be used 23 | or in a loop 24 | [ 25 | this is ok to use [ ] and stuff 26 | ] 27 | or preceded by # 28 | */ 29 | CodeMirror.defineMode("brainfuck", function() { 30 | return { 31 | startState: function() { 32 | return { 33 | commentLine: false, 34 | left: 0, 35 | right: 0, 36 | commentLoop: false 37 | } 38 | }, 39 | token: function(stream, state) { 40 | if (stream.eatSpace()) return null 41 | if(stream.sol()){ 42 | state.commentLine = false; 43 | } 44 | var ch = stream.next().toString(); 45 | if(reserve.indexOf(ch) !== -1){ 46 | if(state.commentLine === true){ 47 | if(stream.eol()){ 48 | state.commentLine = false; 49 | } 50 | return "comment"; 51 | } 52 | if(ch === "]" || ch === "["){ 53 | if(ch === "["){ 54 | state.left++; 55 | } 56 | else{ 57 | state.right++; 58 | } 59 | return "bracket"; 60 | } 61 | else if(ch === "+" || ch === "-"){ 62 | return "keyword"; 63 | } 64 | else if(ch === "<" || ch === ">"){ 65 | return "atom"; 66 | } 67 | else if(ch === "." || ch === ","){ 68 | return "def"; 69 | } 70 | } 71 | else{ 72 | state.commentLine = true; 73 | if(stream.eol()){ 74 | state.commentLine = false; 75 | } 76 | return "comment"; 77 | } 78 | if(stream.eol()){ 79 | state.commentLine = false; 80 | } 81 | } 82 | }; 83 | }); 84 | CodeMirror.defineMIME("text/x-brainfuck","brainfuck") 85 | }); 86 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/mathematica/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Mathematica mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 27 | 28 |
29 |

Mathematica mode

30 | 31 | 32 | 62 | 63 | 70 | 71 |

MIME types defined: text/x-mathematica (Mathematica).

72 |
73 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/asn.1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ASN.1 mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 31 |
32 |

ASN.1 example

33 |
34 | 54 |
55 | 56 | 66 |
67 |

Language: Abstract Syntax Notation One 68 | (ASN.1) 69 |

70 |

MIME types defined: text/x-ttcn-asn

71 | 72 |
73 |

The development of this mode has been sponsored by Ericsson 74 | .

75 |

Coded by Asmelash Tsegay Gebretsadkan

76 |
77 | 78 | 79 | -------------------------------------------------------------------------------- /site/resources/public/codemirror/mode/dockerfile/dockerfile.js: -------------------------------------------------------------------------------- 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("../../addon/mode/simple")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../../addon/mode/simple"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | // Collect all Dockerfile directives 15 | var instructions = ["from", "maintainer", "run", "cmd", "expose", "env", 16 | "add", "copy", "entrypoint", "volume", "user", 17 | "workdir", "onbuild"], 18 | instructionRegex = "(" + instructions.join('|') + ")", 19 | instructionOnlyLine = new RegExp(instructionRegex + "\\s*$", "i"), 20 | instructionWithArguments = new RegExp(instructionRegex + "(\\s+)", "i"); 21 | 22 | CodeMirror.defineSimpleMode("dockerfile", { 23 | start: [ 24 | // Block comment: This is a line starting with a comment 25 | { 26 | regex: /#.*$/, 27 | token: "comment" 28 | }, 29 | // Highlight an instruction without any arguments (for convenience) 30 | { 31 | regex: instructionOnlyLine, 32 | token: "variable-2" 33 | }, 34 | // Highlight an instruction followed by arguments 35 | { 36 | regex: instructionWithArguments, 37 | token: ["variable-2", null], 38 | next: "arguments" 39 | }, 40 | { 41 | regex: /./, 42 | token: null 43 | } 44 | ], 45 | arguments: [ 46 | { 47 | // Line comment without instruction arguments is an error 48 | regex: /#.*$/, 49 | token: "error", 50 | next: "start" 51 | }, 52 | { 53 | regex: /[^#]+\\$/, 54 | token: null 55 | }, 56 | { 57 | // Match everything except for the inline comment 58 | regex: /[^#]+/, 59 | token: null, 60 | next: "start" 61 | }, 62 | { 63 | regex: /$/, 64 | token: null, 65 | next: "start" 66 | }, 67 | // Fail safe return to start 68 | { 69 | token: null, 70 | next: "start" 71 | } 72 | ], 73 | meta: { 74 | lineComment: "#" 75 | } 76 | }); 77 | 78 | CodeMirror.defineMIME("text/x-dockerfile", "dockerfile"); 79 | }); 80 | --------------------------------------------------------------------------------