swagr 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/swagr +15 -0
- data/examples/examples01/app.rb +6 -2
- data/examples/examples01/coffee/data_port.coffee +2 -0
- data/examples/examples01/static/css/codemirror.css +1247 -0
- data/examples/examples01/static/js/codemirror-compressed-3-0.js +5 -0
- data/examples/examples01/static/js/codemirror/keymap/emacs.js +30 -0
- data/examples/examples01/static/js/codemirror/keymap/vim.js +2298 -0
- data/examples/examples01/static/js/codemirror/lib/codemirror.css +239 -0
- data/examples/examples01/static/js/codemirror/lib/codemirror.js +4553 -0
- data/examples/examples01/static/js/codemirror/lib/util/closetag.js +85 -0
- data/examples/examples01/static/js/codemirror/lib/util/colorize.js +29 -0
- data/examples/examples01/static/js/codemirror/lib/util/continuecomment.js +36 -0
- data/examples/examples01/static/js/codemirror/lib/util/continuelist.js +28 -0
- data/examples/examples01/static/js/codemirror/lib/util/dialog.css +32 -0
- data/examples/examples01/static/js/codemirror/lib/util/dialog.js +75 -0
- data/examples/examples01/static/js/codemirror/lib/util/foldcode.js +182 -0
- data/examples/examples01/static/js/codemirror/lib/util/formatting.js +108 -0
- data/examples/examples01/static/js/codemirror/lib/util/javascript-hint.js +137 -0
- data/examples/examples01/static/js/codemirror/lib/util/loadmode.js +51 -0
- data/examples/examples01/static/js/codemirror/lib/util/match-highlighter.js +46 -0
- data/examples/examples01/static/js/codemirror/lib/util/matchbrackets.js +63 -0
- data/examples/examples01/static/js/codemirror/lib/util/multiplex.js +95 -0
- data/examples/examples01/static/js/codemirror/lib/util/overlay.js +59 -0
- data/examples/examples01/static/js/codemirror/lib/util/pig-hint.js +117 -0
- data/examples/examples01/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
- data/examples/examples01/static/js/codemirror/lib/util/runmode.js +52 -0
- data/examples/examples01/static/js/codemirror/lib/util/search.js +119 -0
- data/examples/examples01/static/js/codemirror/lib/util/searchcursor.js +119 -0
- data/examples/examples01/static/js/codemirror/lib/util/simple-hint.css +16 -0
- data/examples/examples01/static/js/codemirror/lib/util/simple-hint.js +102 -0
- data/examples/examples01/static/js/codemirror/lib/util/xml-hint.js +131 -0
- data/examples/examples01/static/js/codemirror/mode/clike/clike.js +300 -0
- data/examples/examples01/static/js/codemirror/mode/clike/index.html +103 -0
- data/examples/examples01/static/js/codemirror/mode/clike/scala.html +767 -0
- data/examples/examples01/static/js/codemirror/mode/clojure/clojure.js +206 -0
- data/examples/examples01/static/js/codemirror/mode/clojure/index.html +67 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/index.html +728 -0
- data/examples/examples01/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/examples/examples01/static/js/codemirror/mode/commonlisp/index.html +165 -0
- data/examples/examples01/static/js/codemirror/mode/css/css.js +465 -0
- data/examples/examples01/static/js/codemirror/mode/css/index.html +58 -0
- data/examples/examples01/static/js/codemirror/mode/css/test.js +501 -0
- data/examples/examples01/static/js/codemirror/mode/diff/diff.js +32 -0
- data/examples/examples01/static/js/codemirror/mode/diff/index.html +105 -0
- data/examples/examples01/static/js/codemirror/mode/ecl/ecl.js +192 -0
- data/examples/examples01/static/js/codemirror/mode/ecl/index.html +39 -0
- data/examples/examples01/static/js/codemirror/mode/erlang/erlang.js +463 -0
- data/examples/examples01/static/js/codemirror/mode/erlang/index.html +64 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/gfm.js +94 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/index.html +70 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/test.js +225 -0
- data/examples/examples01/static/js/codemirror/mode/go/go.js +165 -0
- data/examples/examples01/static/js/codemirror/mode/go/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/groovy/groovy.js +210 -0
- data/examples/examples01/static/js/codemirror/mode/groovy/index.html +73 -0
- data/examples/examples01/static/js/codemirror/mode/haskell/haskell.js +242 -0
- data/examples/examples01/static/js/codemirror/mode/haskell/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/haxe/haxe.js +429 -0
- data/examples/examples01/static/js/codemirror/mode/haxe/index.html +90 -0
- data/examples/examples01/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/examples/examples01/static/js/codemirror/mode/htmlembedded/index.html +49 -0
- data/examples/examples01/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
- data/examples/examples01/static/js/codemirror/mode/htmlmixed/index.html +52 -0
- data/examples/examples01/static/js/codemirror/mode/http/http.js +98 -0
- data/examples/examples01/static/js/codemirror/mode/http/index.html +32 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/index.html +88 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/javascript.js +411 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/typescript.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/jinja2/index.html +38 -0
- data/examples/examples01/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
- data/examples/examples01/static/js/codemirror/mode/less/index.html +741 -0
- data/examples/examples01/static/js/codemirror/mode/less/less.js +266 -0
- data/examples/examples01/static/js/codemirror/mode/lua/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/lua/lua.js +140 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/index.html +344 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/markdown.js +474 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/test.js +1266 -0
- data/examples/examples01/static/js/codemirror/mode/mysql/index.html +41 -0
- data/examples/examples01/static/js/codemirror/mode/mysql/mysql.js +203 -0
- data/examples/examples01/static/js/codemirror/mode/ntriples/index.html +33 -0
- data/examples/examples01/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
- data/examples/examples01/static/js/codemirror/mode/ocaml/index.html +131 -0
- data/examples/examples01/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/LICENSE +7 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/index.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/pascal.js +94 -0
- data/examples/examples01/static/js/codemirror/mode/perl/LICENSE +19 -0
- data/examples/examples01/static/js/codemirror/mode/perl/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/perl/perl.js +816 -0
- data/examples/examples01/static/js/codemirror/mode/php/index.html +51 -0
- data/examples/examples01/static/js/codemirror/mode/php/php.js +129 -0
- data/examples/examples01/static/js/codemirror/mode/pig/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/pig/pig.js +171 -0
- data/examples/examples01/static/js/codemirror/mode/plsql/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/plsql/plsql.js +216 -0
- data/examples/examples01/static/js/codemirror/mode/properties/index.html +41 -0
- data/examples/examples01/static/js/codemirror/mode/properties/properties.js +63 -0
- data/examples/examples01/static/js/codemirror/mode/python/LICENSE.txt +21 -0
- data/examples/examples01/static/js/codemirror/mode/python/index.html +124 -0
- data/examples/examples01/static/js/codemirror/mode/python/python.js +340 -0
- data/examples/examples01/static/js/codemirror/mode/r/LICENSE +24 -0
- data/examples/examples01/static/js/codemirror/mode/r/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/r/r.js +141 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/changes/index.html +53 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/index.html +99 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
- data/examples/examples01/static/js/codemirror/mode/rst/index.html +526 -0
- data/examples/examples01/static/js/codemirror/mode/rst/rst.js +314 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/LICENSE +24 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/index.html +173 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/ruby.js +195 -0
- data/examples/examples01/static/js/codemirror/mode/rust/index.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/rust/rust.js +432 -0
- data/examples/examples01/static/js/codemirror/mode/scheme/index.html +65 -0
- data/examples/examples01/static/js/codemirror/mode/scheme/scheme.js +230 -0
- data/examples/examples01/static/js/codemirror/mode/shell/index.html +51 -0
- data/examples/examples01/static/js/codemirror/mode/shell/shell.js +118 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/LICENSE +23 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/index.html +81 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/sieve.js +156 -0
- data/examples/examples01/static/js/codemirror/mode/smalltalk/index.html +57 -0
- data/examples/examples01/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/examples/examples01/static/js/codemirror/mode/smarty/index.html +83 -0
- data/examples/examples01/static/js/codemirror/mode/smarty/smarty.js +148 -0
- data/examples/examples01/static/js/codemirror/mode/sparql/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/sparql/sparql.js +143 -0
- data/examples/examples01/static/js/codemirror/mode/stex/index.html +98 -0
- data/examples/examples01/static/js/codemirror/mode/stex/stex.js +175 -0
- data/examples/examples01/static/js/codemirror/mode/stex/test.js +343 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/index.html +81 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/tiki.css +26 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/tiki.js +309 -0
- data/examples/examples01/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
- data/examples/examples01/static/js/codemirror/mode/vb/index.html +88 -0
- data/examples/examples01/static/js/codemirror/mode/vb/vb.js +260 -0
- data/examples/examples01/static/js/codemirror/mode/vbscript/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
- data/examples/examples01/static/js/codemirror/mode/velocity/index.html +103 -0
- data/examples/examples01/static/js/codemirror/mode/velocity/velocity.js +144 -0
- data/examples/examples01/static/js/codemirror/mode/verilog/index.html +210 -0
- data/examples/examples01/static/js/codemirror/mode/verilog/verilog.js +182 -0
- data/examples/examples01/static/js/codemirror/mode/xml/index.html +45 -0
- data/examples/examples01/static/js/codemirror/mode/xml/xml.js +324 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/LICENSE +20 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/index.html +221 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/test.js +77 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/xquery.js +450 -0
- data/examples/examples01/static/js/codemirror/mode/yaml/index.html +68 -0
- data/examples/examples01/static/js/codemirror/mode/yaml/yaml.js +95 -0
- data/examples/examples01/static/js/codemirror/mode/z80/index.html +39 -0
- data/examples/examples01/static/js/codemirror/mode/z80/z80.js +113 -0
- data/examples/examples01/static/js/codemirror/theme/ambiance-mobile.css +6 -0
- data/examples/examples01/static/js/codemirror/theme/ambiance.css +76 -0
- data/examples/examples01/static/js/codemirror/theme/blackboard.css +25 -0
- data/examples/examples01/static/js/codemirror/theme/cobalt.css +18 -0
- data/examples/examples01/static/js/codemirror/theme/eclipse.css +25 -0
- data/examples/examples01/static/js/codemirror/theme/elegant.css +10 -0
- data/examples/examples01/static/js/codemirror/theme/erlang-dark.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/lesser-dark.css +44 -0
- data/examples/examples01/static/js/codemirror/theme/monokai.css +28 -0
- data/examples/examples01/static/js/codemirror/theme/neat.css +9 -0
- data/examples/examples01/static/js/codemirror/theme/night.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/rubyblue.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/solarized.css +207 -0
- data/examples/examples01/static/js/codemirror/theme/twilight.css +26 -0
- data/examples/examples01/static/js/codemirror/theme/vibrant-ink.css +27 -0
- data/examples/examples01/static/js/codemirror/theme/xq-dark.css +46 -0
- data/examples/examples01/static/js/d3.v3.min.js +2 -2
- data/examples/examples01/static/test/cm.html +33 -0
- data/examples/examples01/views/about.slim +15 -0
- data/examples/examples01/views/index.slim +1 -1
- data/examples/examples01/views/layout.slim +1 -0
- data/examples/examples01/views/layout_cm.slim +17 -0
- data/examples/examples01/views/navbar.slim +4 -4
- data/lib/swagr/version.rb +1 -1
- data/templates/app.rb +4 -0
- data/templates/static/js/codemirror/keymap/emacs.js +30 -0
- data/templates/static/js/codemirror/keymap/vim.js +2298 -0
- data/templates/static/js/codemirror/lib/codemirror.css +239 -0
- data/templates/static/js/codemirror/lib/codemirror.js +4553 -0
- data/templates/static/js/codemirror/lib/util/closetag.js +85 -0
- data/templates/static/js/codemirror/lib/util/colorize.js +29 -0
- data/templates/static/js/codemirror/lib/util/continuecomment.js +36 -0
- data/templates/static/js/codemirror/lib/util/continuelist.js +28 -0
- data/templates/static/js/codemirror/lib/util/dialog.css +32 -0
- data/templates/static/js/codemirror/lib/util/dialog.js +75 -0
- data/templates/static/js/codemirror/lib/util/foldcode.js +182 -0
- data/templates/static/js/codemirror/lib/util/formatting.js +108 -0
- data/templates/static/js/codemirror/lib/util/javascript-hint.js +137 -0
- data/templates/static/js/codemirror/lib/util/loadmode.js +51 -0
- data/templates/static/js/codemirror/lib/util/match-highlighter.js +46 -0
- data/templates/static/js/codemirror/lib/util/matchbrackets.js +63 -0
- data/templates/static/js/codemirror/lib/util/multiplex.js +95 -0
- data/templates/static/js/codemirror/lib/util/overlay.js +59 -0
- data/templates/static/js/codemirror/lib/util/pig-hint.js +117 -0
- data/templates/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
- data/templates/static/js/codemirror/lib/util/runmode.js +52 -0
- data/templates/static/js/codemirror/lib/util/search.js +119 -0
- data/templates/static/js/codemirror/lib/util/searchcursor.js +119 -0
- data/templates/static/js/codemirror/lib/util/simple-hint.css +16 -0
- data/templates/static/js/codemirror/lib/util/simple-hint.js +102 -0
- data/templates/static/js/codemirror/lib/util/xml-hint.js +131 -0
- data/templates/static/js/codemirror/mode/clike/clike.js +300 -0
- data/templates/static/js/codemirror/mode/clike/index.html +103 -0
- data/templates/static/js/codemirror/mode/clike/scala.html +767 -0
- data/templates/static/js/codemirror/mode/clojure/clojure.js +206 -0
- data/templates/static/js/codemirror/mode/clojure/index.html +67 -0
- data/templates/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
- data/templates/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/templates/static/js/codemirror/mode/coffeescript/index.html +728 -0
- data/templates/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/templates/static/js/codemirror/mode/commonlisp/index.html +165 -0
- data/templates/static/js/codemirror/mode/css/css.js +465 -0
- data/templates/static/js/codemirror/mode/css/index.html +58 -0
- data/templates/static/js/codemirror/mode/css/test.js +501 -0
- data/templates/static/js/codemirror/mode/diff/diff.js +32 -0
- data/templates/static/js/codemirror/mode/diff/index.html +105 -0
- data/templates/static/js/codemirror/mode/ecl/ecl.js +192 -0
- data/templates/static/js/codemirror/mode/ecl/index.html +39 -0
- data/templates/static/js/codemirror/mode/erlang/erlang.js +463 -0
- data/templates/static/js/codemirror/mode/erlang/index.html +64 -0
- data/templates/static/js/codemirror/mode/gfm/gfm.js +94 -0
- data/templates/static/js/codemirror/mode/gfm/index.html +70 -0
- data/templates/static/js/codemirror/mode/gfm/test.js +225 -0
- data/templates/static/js/codemirror/mode/go/go.js +165 -0
- data/templates/static/js/codemirror/mode/go/index.html +74 -0
- data/templates/static/js/codemirror/mode/groovy/groovy.js +210 -0
- data/templates/static/js/codemirror/mode/groovy/index.html +73 -0
- data/templates/static/js/codemirror/mode/haskell/haskell.js +242 -0
- data/templates/static/js/codemirror/mode/haskell/index.html +62 -0
- data/templates/static/js/codemirror/mode/haxe/haxe.js +429 -0
- data/templates/static/js/codemirror/mode/haxe/index.html +90 -0
- data/templates/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/templates/static/js/codemirror/mode/htmlembedded/index.html +49 -0
- data/templates/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
- data/templates/static/js/codemirror/mode/htmlmixed/index.html +52 -0
- data/templates/static/js/codemirror/mode/http/http.js +98 -0
- data/templates/static/js/codemirror/mode/http/index.html +32 -0
- data/templates/static/js/codemirror/mode/javascript/index.html +88 -0
- data/templates/static/js/codemirror/mode/javascript/javascript.js +411 -0
- data/templates/static/js/codemirror/mode/javascript/typescript.html +48 -0
- data/templates/static/js/codemirror/mode/jinja2/index.html +38 -0
- data/templates/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
- data/templates/static/js/codemirror/mode/less/index.html +741 -0
- data/templates/static/js/codemirror/mode/less/less.js +266 -0
- data/templates/static/js/codemirror/mode/lua/index.html +74 -0
- data/templates/static/js/codemirror/mode/lua/lua.js +140 -0
- data/templates/static/js/codemirror/mode/markdown/index.html +344 -0
- data/templates/static/js/codemirror/mode/markdown/markdown.js +474 -0
- data/templates/static/js/codemirror/mode/markdown/test.js +1266 -0
- data/templates/static/js/codemirror/mode/mysql/index.html +41 -0
- data/templates/static/js/codemirror/mode/mysql/mysql.js +203 -0
- data/templates/static/js/codemirror/mode/ntriples/index.html +33 -0
- data/templates/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
- data/templates/static/js/codemirror/mode/ocaml/index.html +131 -0
- data/templates/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
- data/templates/static/js/codemirror/mode/pascal/LICENSE +7 -0
- data/templates/static/js/codemirror/mode/pascal/index.html +48 -0
- data/templates/static/js/codemirror/mode/pascal/pascal.js +94 -0
- data/templates/static/js/codemirror/mode/perl/LICENSE +19 -0
- data/templates/static/js/codemirror/mode/perl/index.html +62 -0
- data/templates/static/js/codemirror/mode/perl/perl.js +816 -0
- data/templates/static/js/codemirror/mode/php/index.html +51 -0
- data/templates/static/js/codemirror/mode/php/php.js +129 -0
- data/templates/static/js/codemirror/mode/pig/index.html +42 -0
- data/templates/static/js/codemirror/mode/pig/pig.js +171 -0
- data/templates/static/js/codemirror/mode/plsql/index.html +62 -0
- data/templates/static/js/codemirror/mode/plsql/plsql.js +216 -0
- data/templates/static/js/codemirror/mode/properties/index.html +41 -0
- data/templates/static/js/codemirror/mode/properties/properties.js +63 -0
- data/templates/static/js/codemirror/mode/python/LICENSE.txt +21 -0
- data/templates/static/js/codemirror/mode/python/index.html +124 -0
- data/templates/static/js/codemirror/mode/python/python.js +340 -0
- data/templates/static/js/codemirror/mode/r/LICENSE +24 -0
- data/templates/static/js/codemirror/mode/r/index.html +74 -0
- data/templates/static/js/codemirror/mode/r/r.js +141 -0
- data/templates/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
- data/templates/static/js/codemirror/mode/rpm/changes/index.html +53 -0
- data/templates/static/js/codemirror/mode/rpm/spec/index.html +99 -0
- data/templates/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
- data/templates/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
- data/templates/static/js/codemirror/mode/rst/index.html +526 -0
- data/templates/static/js/codemirror/mode/rst/rst.js +314 -0
- data/templates/static/js/codemirror/mode/ruby/LICENSE +24 -0
- data/templates/static/js/codemirror/mode/ruby/index.html +173 -0
- data/templates/static/js/codemirror/mode/ruby/ruby.js +195 -0
- data/templates/static/js/codemirror/mode/rust/index.html +48 -0
- data/templates/static/js/codemirror/mode/rust/rust.js +432 -0
- data/templates/static/js/codemirror/mode/scheme/index.html +65 -0
- data/templates/static/js/codemirror/mode/scheme/scheme.js +230 -0
- data/templates/static/js/codemirror/mode/shell/index.html +51 -0
- data/templates/static/js/codemirror/mode/shell/shell.js +118 -0
- data/templates/static/js/codemirror/mode/sieve/LICENSE +23 -0
- data/templates/static/js/codemirror/mode/sieve/index.html +81 -0
- data/templates/static/js/codemirror/mode/sieve/sieve.js +156 -0
- data/templates/static/js/codemirror/mode/smalltalk/index.html +57 -0
- data/templates/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/templates/static/js/codemirror/mode/smarty/index.html +83 -0
- data/templates/static/js/codemirror/mode/smarty/smarty.js +148 -0
- data/templates/static/js/codemirror/mode/sparql/index.html +42 -0
- data/templates/static/js/codemirror/mode/sparql/sparql.js +143 -0
- data/templates/static/js/codemirror/mode/stex/index.html +98 -0
- data/templates/static/js/codemirror/mode/stex/stex.js +175 -0
- data/templates/static/js/codemirror/mode/stex/test.js +343 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/templates/static/js/codemirror/mode/tiki/index.html +81 -0
- data/templates/static/js/codemirror/mode/tiki/tiki.css +26 -0
- data/templates/static/js/codemirror/mode/tiki/tiki.js +309 -0
- data/templates/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
- data/templates/static/js/codemirror/mode/vb/index.html +88 -0
- data/templates/static/js/codemirror/mode/vb/vb.js +260 -0
- data/templates/static/js/codemirror/mode/vbscript/index.html +42 -0
- data/templates/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
- data/templates/static/js/codemirror/mode/velocity/index.html +103 -0
- data/templates/static/js/codemirror/mode/velocity/velocity.js +144 -0
- data/templates/static/js/codemirror/mode/verilog/index.html +210 -0
- data/templates/static/js/codemirror/mode/verilog/verilog.js +182 -0
- data/templates/static/js/codemirror/mode/xml/index.html +45 -0
- data/templates/static/js/codemirror/mode/xml/xml.js +324 -0
- data/templates/static/js/codemirror/mode/xquery/LICENSE +20 -0
- data/templates/static/js/codemirror/mode/xquery/index.html +221 -0
- data/templates/static/js/codemirror/mode/xquery/test.js +77 -0
- data/templates/static/js/codemirror/mode/xquery/xquery.js +450 -0
- data/templates/static/js/codemirror/mode/yaml/index.html +68 -0
- data/templates/static/js/codemirror/mode/yaml/yaml.js +95 -0
- data/templates/static/js/codemirror/mode/z80/index.html +39 -0
- data/templates/static/js/codemirror/mode/z80/z80.js +113 -0
- data/templates/static/js/codemirror/theme/ambiance-mobile.css +6 -0
- data/templates/static/js/codemirror/theme/ambiance.css +76 -0
- data/templates/static/js/codemirror/theme/blackboard.css +25 -0
- data/templates/static/js/codemirror/theme/cobalt.css +18 -0
- data/templates/static/js/codemirror/theme/eclipse.css +25 -0
- data/templates/static/js/codemirror/theme/elegant.css +10 -0
- data/templates/static/js/codemirror/theme/erlang-dark.css +21 -0
- data/templates/static/js/codemirror/theme/lesser-dark.css +44 -0
- data/templates/static/js/codemirror/theme/monokai.css +28 -0
- data/templates/static/js/codemirror/theme/neat.css +9 -0
- data/templates/static/js/codemirror/theme/night.css +21 -0
- data/templates/static/js/codemirror/theme/rubyblue.css +21 -0
- data/templates/static/js/codemirror/theme/solarized.css +207 -0
- data/templates/static/js/codemirror/theme/twilight.css +26 -0
- data/templates/static/js/codemirror/theme/vibrant-ink.css +27 -0
- data/templates/static/js/codemirror/theme/xq-dark.css +46 -0
- data/templates/static/js/d3.v3.min.js +2 -2
- data/templates/static/test/cm.html +33 -0
- data/templates/views/about.slim +15 -0
- data/templates/views/index.slim +1 -1
- data/templates/views/layout.slim +1 -0
- data/templates/views/navbar.slim +4 -4
- metadata +347 -2
@@ -0,0 +1,131 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<meta charset=utf-8>
|
3
|
+
<title>CodeMirror: OCaml mode</title>
|
4
|
+
|
5
|
+
<link rel=stylesheet href=../../lib/codemirror.css>
|
6
|
+
<link rel=stylesheet href=../../doc/docs.css>
|
7
|
+
|
8
|
+
<style type=text/css>
|
9
|
+
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
10
|
+
</style>
|
11
|
+
|
12
|
+
<script src=../../lib/codemirror.js></script>
|
13
|
+
<script src=../../lib/util/matchbrackets.js></script>
|
14
|
+
<script src=ocaml.js></script>
|
15
|
+
|
16
|
+
<h1>CodeMirror: OCaml mode</h1>
|
17
|
+
|
18
|
+
<textarea id=code>
|
19
|
+
(* Summing a list of integers *)
|
20
|
+
let rec sum xs =
|
21
|
+
match xs with
|
22
|
+
| [] -> 0
|
23
|
+
| x :: xs' -> x + sum xs'
|
24
|
+
|
25
|
+
(* Quicksort *)
|
26
|
+
let rec qsort = function
|
27
|
+
| [] -> []
|
28
|
+
| pivot :: rest ->
|
29
|
+
let is_less x = x < pivot in
|
30
|
+
let left, right = List.partition is_less rest in
|
31
|
+
qsort left @ [pivot] @ qsort right
|
32
|
+
|
33
|
+
(* Fibonacci Sequence *)
|
34
|
+
let rec fib_aux n a b =
|
35
|
+
match n with
|
36
|
+
| 0 -> a
|
37
|
+
| _ -> fib_aux (n - 1) (a + b) a
|
38
|
+
let fib n = fib_aux n 0 1
|
39
|
+
|
40
|
+
(* Birthday paradox *)
|
41
|
+
let year_size = 365.
|
42
|
+
|
43
|
+
let rec birthday_paradox prob people =
|
44
|
+
let prob' = (year_size -. float people) /. year_size *. prob in
|
45
|
+
if prob' < 0.5 then
|
46
|
+
Printf.printf "answer = %d\n" (people+1)
|
47
|
+
else
|
48
|
+
birthday_paradox prob' (people+1) ;;
|
49
|
+
|
50
|
+
birthday_paradox 1.0 1
|
51
|
+
|
52
|
+
(* Church numerals *)
|
53
|
+
let zero f x = x
|
54
|
+
let succ n f x = f (n f x)
|
55
|
+
let one = succ zero
|
56
|
+
let two = succ (succ zero)
|
57
|
+
let add n1 n2 f x = n1 f (n2 f x)
|
58
|
+
let to_string n = n (fun k -> "S" ^ k) "0"
|
59
|
+
let _ = to_string (add (succ two) two)
|
60
|
+
|
61
|
+
(* Elementary functions *)
|
62
|
+
let square x = x * x;;
|
63
|
+
let rec fact x =
|
64
|
+
if x <= 1 then 1 else x * fact (x - 1);;
|
65
|
+
|
66
|
+
(* Automatic memory management *)
|
67
|
+
let l = 1 :: 2 :: 3 :: [];;
|
68
|
+
[1; 2; 3];;
|
69
|
+
5 :: l;;
|
70
|
+
|
71
|
+
(* Polymorphism: sorting lists *)
|
72
|
+
let rec sort = function
|
73
|
+
| [] -> []
|
74
|
+
| x :: l -> insert x (sort l)
|
75
|
+
|
76
|
+
and insert elem = function
|
77
|
+
| [] -> [elem]
|
78
|
+
| x :: l ->
|
79
|
+
if elem < x then elem :: x :: l else x :: insert elem l;;
|
80
|
+
|
81
|
+
(* Imperative features *)
|
82
|
+
let add_polynom p1 p2 =
|
83
|
+
let n1 = Array.length p1
|
84
|
+
and n2 = Array.length p2 in
|
85
|
+
let result = Array.create (max n1 n2) 0 in
|
86
|
+
for i = 0 to n1 - 1 do result.(i) <- p1.(i) done;
|
87
|
+
for i = 0 to n2 - 1 do result.(i) <- result.(i) + p2.(i) done;
|
88
|
+
result;;
|
89
|
+
add_polynom [| 1; 2 |] [| 1; 2; 3 |];;
|
90
|
+
|
91
|
+
(* We may redefine fact using a reference cell and a for loop *)
|
92
|
+
let fact n =
|
93
|
+
let result = ref 1 in
|
94
|
+
for i = 2 to n do
|
95
|
+
result := i * !result
|
96
|
+
done;
|
97
|
+
!result;;
|
98
|
+
fact 5;;
|
99
|
+
|
100
|
+
(* Triangle (graphics) *)
|
101
|
+
let () =
|
102
|
+
ignore( Glut.init Sys.argv );
|
103
|
+
Glut.initDisplayMode ~double_buffer:true ();
|
104
|
+
ignore (Glut.createWindow ~title:"OpenGL Demo");
|
105
|
+
let angle t = 10. *. t *. t in
|
106
|
+
let render () =
|
107
|
+
GlClear.clear [ `color ];
|
108
|
+
GlMat.load_identity ();
|
109
|
+
GlMat.rotate ~angle: (angle (Sys.time ())) ~z:1. ();
|
110
|
+
GlDraw.begins `triangles;
|
111
|
+
List.iter GlDraw.vertex2 [-1., -1.; 0., 1.; 1., -1.];
|
112
|
+
GlDraw.ends ();
|
113
|
+
Glut.swapBuffers () in
|
114
|
+
GlMat.mode `modelview;
|
115
|
+
Glut.displayFunc ~cb:render;
|
116
|
+
Glut.idleFunc ~cb:(Some Glut.postRedisplay);
|
117
|
+
Glut.mainLoop ()
|
118
|
+
|
119
|
+
(* A Hundred Lines of Caml - http://caml.inria.fr/about/taste.en.html *)
|
120
|
+
(* OCaml page on Wikipedia - http://en.wikipedia.org/wiki/OCaml *)
|
121
|
+
</textarea>
|
122
|
+
|
123
|
+
<script>
|
124
|
+
var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
|
125
|
+
mode: 'ocaml',
|
126
|
+
lineNumbers: true,
|
127
|
+
matchBrackets: true
|
128
|
+
});
|
129
|
+
</script>
|
130
|
+
|
131
|
+
<p><strong>MIME types defined:</strong> <code>text/x-ocaml</code>.</p>
|
@@ -0,0 +1,113 @@
|
|
1
|
+
CodeMirror.defineMode('ocaml', function() {
|
2
|
+
|
3
|
+
var words = {
|
4
|
+
'true': 'atom',
|
5
|
+
'false': 'atom',
|
6
|
+
'let': 'keyword',
|
7
|
+
'rec': 'keyword',
|
8
|
+
'in': 'keyword',
|
9
|
+
'of': 'keyword',
|
10
|
+
'and': 'keyword',
|
11
|
+
'succ': 'keyword',
|
12
|
+
'if': 'keyword',
|
13
|
+
'then': 'keyword',
|
14
|
+
'else': 'keyword',
|
15
|
+
'for': 'keyword',
|
16
|
+
'to': 'keyword',
|
17
|
+
'while': 'keyword',
|
18
|
+
'do': 'keyword',
|
19
|
+
'done': 'keyword',
|
20
|
+
'fun': 'keyword',
|
21
|
+
'function': 'keyword',
|
22
|
+
'val': 'keyword',
|
23
|
+
'type': 'keyword',
|
24
|
+
'mutable': 'keyword',
|
25
|
+
'match': 'keyword',
|
26
|
+
'with': 'keyword',
|
27
|
+
'try': 'keyword',
|
28
|
+
'raise': 'keyword',
|
29
|
+
'begin': 'keyword',
|
30
|
+
'end': 'keyword',
|
31
|
+
'open': 'builtin',
|
32
|
+
'trace': 'builtin',
|
33
|
+
'ignore': 'builtin',
|
34
|
+
'exit': 'builtin',
|
35
|
+
'print_string': 'builtin',
|
36
|
+
'print_endline': 'builtin'
|
37
|
+
};
|
38
|
+
|
39
|
+
function tokenBase(stream, state) {
|
40
|
+
var ch = stream.next();
|
41
|
+
|
42
|
+
if (ch === '"') {
|
43
|
+
state.tokenize = tokenString;
|
44
|
+
return state.tokenize(stream, state);
|
45
|
+
}
|
46
|
+
if (ch === '(') {
|
47
|
+
if (stream.eat('*')) {
|
48
|
+
state.commentLevel++;
|
49
|
+
state.tokenize = tokenComment;
|
50
|
+
return state.tokenize(stream, state);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
if (ch === '~') {
|
54
|
+
stream.eatWhile(/\w/);
|
55
|
+
return 'variable-2';
|
56
|
+
}
|
57
|
+
if (ch === '`') {
|
58
|
+
stream.eatWhile(/\w/);
|
59
|
+
return 'quote';
|
60
|
+
}
|
61
|
+
if (/\d/.test(ch)) {
|
62
|
+
stream.eatWhile(/[\d]/);
|
63
|
+
if (stream.eat('.')) {
|
64
|
+
stream.eatWhile(/[\d]/);
|
65
|
+
}
|
66
|
+
return 'number';
|
67
|
+
}
|
68
|
+
if ( /[+\-*&%=<>!?|]/.test(ch)) {
|
69
|
+
return 'operator';
|
70
|
+
}
|
71
|
+
stream.eatWhile(/\w/);
|
72
|
+
var cur = stream.current();
|
73
|
+
return words[cur] || 'variable';
|
74
|
+
}
|
75
|
+
|
76
|
+
function tokenString(stream, state) {
|
77
|
+
var next, end = false, escaped = false;
|
78
|
+
while ((next = stream.next()) != null) {
|
79
|
+
if (next === '"' && !escaped) {
|
80
|
+
end = true;
|
81
|
+
break;
|
82
|
+
}
|
83
|
+
escaped = !escaped && next === '\\';
|
84
|
+
}
|
85
|
+
if (end && !escaped) {
|
86
|
+
state.tokenize = tokenBase;
|
87
|
+
}
|
88
|
+
return 'string';
|
89
|
+
};
|
90
|
+
|
91
|
+
function tokenComment(stream, state) {
|
92
|
+
var prev, next;
|
93
|
+
while(state.commentLevel > 0 && (next = stream.next()) != null) {
|
94
|
+
if (prev === '(' && next === '*') state.commentLevel++;
|
95
|
+
if (prev === '*' && next === ')') state.commentLevel--;
|
96
|
+
prev = next;
|
97
|
+
}
|
98
|
+
if (state.commentLevel <= 0) {
|
99
|
+
state.tokenize = tokenBase;
|
100
|
+
}
|
101
|
+
return 'comment';
|
102
|
+
}
|
103
|
+
|
104
|
+
return {
|
105
|
+
startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
|
106
|
+
token: function(stream, state) {
|
107
|
+
if (stream.eatSpace()) return null;
|
108
|
+
return state.tokenize(stream, state);
|
109
|
+
}
|
110
|
+
};
|
111
|
+
});
|
112
|
+
|
113
|
+
CodeMirror.defineMIME('text/x-ocaml', 'ocaml');
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2011 souceLair <support@sourcelair.com>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>CodeMirror: Pascal mode</title>
|
6
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7
|
+
<script src="../../lib/codemirror.js"></script>
|
8
|
+
<script src="pascal.js"></script>
|
9
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
10
|
+
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<h1>CodeMirror: Pascal mode</h1>
|
14
|
+
|
15
|
+
<div><textarea id="code" name="code">
|
16
|
+
(* Example Pascal code *)
|
17
|
+
|
18
|
+
while a <> b do writeln('Waiting');
|
19
|
+
|
20
|
+
if a > b then
|
21
|
+
writeln('Condition met')
|
22
|
+
else
|
23
|
+
writeln('Condition not met');
|
24
|
+
|
25
|
+
for i := 1 to 10 do
|
26
|
+
writeln('Iteration: ', i:1);
|
27
|
+
|
28
|
+
repeat
|
29
|
+
a := a + 1
|
30
|
+
until a = 10;
|
31
|
+
|
32
|
+
case i of
|
33
|
+
0: write('zero');
|
34
|
+
1: write('one');
|
35
|
+
2: write('two')
|
36
|
+
end;
|
37
|
+
</textarea></div>
|
38
|
+
|
39
|
+
<script>
|
40
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
41
|
+
lineNumbers: true,
|
42
|
+
mode: "text/x-pascal"
|
43
|
+
});
|
44
|
+
</script>
|
45
|
+
|
46
|
+
<p><strong>MIME types defined:</strong> <code>text/x-pascal</code>.</p>
|
47
|
+
</body>
|
48
|
+
</html>
|
@@ -0,0 +1,94 @@
|
|
1
|
+
CodeMirror.defineMode("pascal", function() {
|
2
|
+
function words(str) {
|
3
|
+
var obj = {}, words = str.split(" ");
|
4
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
5
|
+
return obj;
|
6
|
+
}
|
7
|
+
var keywords = words("and array begin case const div do downto else end file for forward integer " +
|
8
|
+
"boolean char function goto if in label mod nil not of or packed procedure " +
|
9
|
+
"program record repeat set string then to type until var while with");
|
10
|
+
var atoms = {"null": true};
|
11
|
+
|
12
|
+
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
13
|
+
|
14
|
+
function tokenBase(stream, state) {
|
15
|
+
var ch = stream.next();
|
16
|
+
if (ch == "#" && state.startOfLine) {
|
17
|
+
stream.skipToEnd();
|
18
|
+
return "meta";
|
19
|
+
}
|
20
|
+
if (ch == '"' || ch == "'") {
|
21
|
+
state.tokenize = tokenString(ch);
|
22
|
+
return state.tokenize(stream, state);
|
23
|
+
}
|
24
|
+
if (ch == "(" && stream.eat("*")) {
|
25
|
+
state.tokenize = tokenComment;
|
26
|
+
return tokenComment(stream, state);
|
27
|
+
}
|
28
|
+
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
29
|
+
return null;
|
30
|
+
}
|
31
|
+
if (/\d/.test(ch)) {
|
32
|
+
stream.eatWhile(/[\w\.]/);
|
33
|
+
return "number";
|
34
|
+
}
|
35
|
+
if (ch == "/") {
|
36
|
+
if (stream.eat("/")) {
|
37
|
+
stream.skipToEnd();
|
38
|
+
return "comment";
|
39
|
+
}
|
40
|
+
}
|
41
|
+
if (isOperatorChar.test(ch)) {
|
42
|
+
stream.eatWhile(isOperatorChar);
|
43
|
+
return "operator";
|
44
|
+
}
|
45
|
+
stream.eatWhile(/[\w\$_]/);
|
46
|
+
var cur = stream.current();
|
47
|
+
if (keywords.propertyIsEnumerable(cur)) return "keyword";
|
48
|
+
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
49
|
+
return "variable";
|
50
|
+
}
|
51
|
+
|
52
|
+
function tokenString(quote) {
|
53
|
+
return function(stream, state) {
|
54
|
+
var escaped = false, next, end = false;
|
55
|
+
while ((next = stream.next()) != null) {
|
56
|
+
if (next == quote && !escaped) {end = true; break;}
|
57
|
+
escaped = !escaped && next == "\\";
|
58
|
+
}
|
59
|
+
if (end || !escaped) state.tokenize = null;
|
60
|
+
return "string";
|
61
|
+
};
|
62
|
+
}
|
63
|
+
|
64
|
+
function tokenComment(stream, state) {
|
65
|
+
var maybeEnd = false, ch;
|
66
|
+
while (ch = stream.next()) {
|
67
|
+
if (ch == ")" && maybeEnd) {
|
68
|
+
state.tokenize = null;
|
69
|
+
break;
|
70
|
+
}
|
71
|
+
maybeEnd = (ch == "*");
|
72
|
+
}
|
73
|
+
return "comment";
|
74
|
+
}
|
75
|
+
|
76
|
+
// Interface
|
77
|
+
|
78
|
+
return {
|
79
|
+
startState: function() {
|
80
|
+
return {tokenize: null};
|
81
|
+
},
|
82
|
+
|
83
|
+
token: function(stream, state) {
|
84
|
+
if (stream.eatSpace()) return null;
|
85
|
+
var style = (state.tokenize || tokenBase)(stream, state);
|
86
|
+
if (style == "comment" || style == "meta") return style;
|
87
|
+
return style;
|
88
|
+
},
|
89
|
+
|
90
|
+
electricChars: "{}"
|
91
|
+
};
|
92
|
+
});
|
93
|
+
|
94
|
+
CodeMirror.defineMIME("text/x-pascal", "pascal");
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (C) 2011 by Sabaca <mail@sabaca.com> under the MIT license.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>CodeMirror: Perl mode</title>
|
6
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7
|
+
<script src="../../lib/codemirror.js"></script>
|
8
|
+
<script src="perl.js"></script>
|
9
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
10
|
+
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<h1>CodeMirror: Perl mode</h1>
|
14
|
+
|
15
|
+
<div><textarea id="code" name="code">
|
16
|
+
#!/usr/bin/perl
|
17
|
+
|
18
|
+
use Something qw(func1 func2);
|
19
|
+
|
20
|
+
# strings
|
21
|
+
my $s1 = qq'single line';
|
22
|
+
our $s2 = q(multi-
|
23
|
+
line);
|
24
|
+
|
25
|
+
=item Something
|
26
|
+
Example.
|
27
|
+
=cut
|
28
|
+
|
29
|
+
my $html=<<'HTML'
|
30
|
+
<html>
|
31
|
+
<title>hi!</title>
|
32
|
+
</html>
|
33
|
+
HTML
|
34
|
+
|
35
|
+
print "first,".join(',', 'second', qq~third~);
|
36
|
+
|
37
|
+
if($s1 =~ m[(?<!\s)(l.ne)\z]o) {
|
38
|
+
$h->{$1}=$$.' predefined variables';
|
39
|
+
$s2 =~ s/\-line//ox;
|
40
|
+
$s1 =~ s[
|
41
|
+
line ]
|
42
|
+
[
|
43
|
+
block
|
44
|
+
]ox;
|
45
|
+
}
|
46
|
+
|
47
|
+
1; # numbers and comments
|
48
|
+
|
49
|
+
__END__
|
50
|
+
something...
|
51
|
+
|
52
|
+
</textarea></div>
|
53
|
+
|
54
|
+
<script>
|
55
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
56
|
+
lineNumbers: true
|
57
|
+
});
|
58
|
+
</script>
|
59
|
+
|
60
|
+
<p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p>
|
61
|
+
</body>
|
62
|
+
</html>
|