marty 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +84 -0
- data/Rakefile +29 -0
- data/app/assets/javascripts/marty/application.js +15 -0
- data/app/assets/stylesheets/marty/application.css +13 -0
- data/app/components/marty/api_auth_view.rb +32 -0
- data/app/components/marty/auth_app.rb +55 -0
- data/app/components/marty/auth_app.rb~ +51 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js +91 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js~ +91 -0
- data/app/components/marty/cm_form_panel.rb~ +5 -0
- data/app/components/marty/cm_grid_panel.rb~ +35 -0
- data/app/components/marty/data_import_view.rb~ +142 -0
- data/app/components/marty/extras/layout.rb +46 -0
- data/app/components/marty/extras/layout.rb~ +46 -0
- data/app/components/marty/extras/misc.rb +18 -0
- data/app/components/marty/form.rb +6 -0
- data/app/components/marty/grid.rb +45 -0
- data/app/components/marty/grid_append_only.rb +12 -0
- data/app/components/marty/import_type_view.rb +53 -0
- data/app/components/marty/live_search_grid_panel.rb +46 -0
- data/app/components/marty/live_search_grid_panel.rb~ +49 -0
- data/app/components/marty/main_auth_app.rb +269 -0
- data/app/components/marty/main_auth_app.rb~ +238 -0
- data/app/components/marty/mcfly_grid_panel.rb +62 -0
- data/app/components/marty/mcfly_grid_panel.rb~ +80 -0
- data/app/components/marty/new_posting_form.rb +46 -0
- data/app/components/marty/new_posting_form.rb~ +46 -0
- data/app/components/marty/new_posting_window.rb +21 -0
- data/app/components/marty/new_posting_window.rb~ +21 -0
- data/app/components/marty/panel.rb +12 -0
- data/app/components/marty/pivot_grid.rb +52 -0
- data/app/components/marty/pivot_grid/endpoints.rb +45 -0
- data/app/components/marty/pivot_grid/javascripts/extensions.js +150 -0
- data/app/components/marty/pivot_grid/javascripts/pivot_grid.js +86 -0
- data/app/components/marty/pivot_grid/services.rb +44 -0
- data/app/components/marty/posting_grid.rb +139 -0
- data/app/components/marty/posting_grid.rb~ +140 -0
- data/app/components/marty/posting_window.rb +27 -0
- data/app/components/marty/promise_view.rb +177 -0
- data/app/components/marty/promise_view.rb~ +157 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css +26 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css~ +15 -0
- data/app/components/marty/report_form.rb +225 -0
- data/app/components/marty/report_form.rb~ +217 -0
- data/app/components/marty/report_select.rb +145 -0
- data/app/components/marty/report_select.rb~ +133 -0
- data/app/components/marty/reporting.rb +39 -0
- data/app/components/marty/reporting.rb~ +39 -0
- data/app/components/marty/script_detail.rb~ +430 -0
- data/app/components/marty/script_form.rb +233 -0
- data/app/components/marty/script_form.rb~ +233 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js +698 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js~ +909 -0
- data/app/components/marty/script_form/javascripts/codemirror.js +3130 -0
- data/app/components/marty/script_form/javascripts/mode/clike/clike.js +284 -0
- data/app/components/marty/script_form/javascripts/mode/clike/index.html +102 -0
- data/app/components/marty/script_form/javascripts/mode/clike/scala.html +766 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/clojure.js +206 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/index.html +67 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/LICENSE +22 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/coffeescript.js +346 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/index.html +728 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/commonlisp.js +101 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/index.html +165 -0
- data/app/components/marty/script_form/javascripts/mode/css/css.js +448 -0
- data/app/components/marty/script_form/javascripts/mode/css/index.html +58 -0
- data/app/components/marty/script_form/javascripts/mode/css/test.js +501 -0
- data/app/components/marty/script_form/javascripts/mode/delorean/delorean.js +189 -0
- data/app/components/marty/script_form/javascripts/mode/diff/diff.js +32 -0
- data/app/components/marty/script_form/javascripts/mode/diff/index.html +105 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/ecl.js +203 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/erlang.js +463 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/gfm.js +150 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/index.html +48 -0
- data/app/components/marty/script_form/javascripts/mode/go/go.js +170 -0
- data/app/components/marty/script_form/javascripts/mode/go/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/groovy.js +210 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/index.html +72 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/haskell.js +242 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/index.html +61 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/haxe.js +429 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/index.html +91 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/htmlembedded.js +72 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/htmlmixed.js +84 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/index.html +52 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/index.html +78 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/javascript.js +361 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/index.html +38 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/jinja2.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/less/index.html +740 -0
- data/app/components/marty/script_form/javascripts/mode/less/less.js +266 -0
- data/app/components/marty/script_form/javascripts/mode/lua/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/lua/lua.js +140 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/index.html +343 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/markdown.js +382 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/test.js +1084 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/mysql.js +186 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/index.html +33 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/ntriples.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/index.html +130 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/ocaml.js +114 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/LICENSE +7 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/pascal.js +94 -0
- data/app/components/marty/script_form/javascripts/mode/perl/LICENSE +19 -0
- data/app/components/marty/script_form/javascripts/mode/perl/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/perl/perl.js +816 -0
- data/app/components/marty/script_form/javascripts/mode/php/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/php/php.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/pig/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/pig/pig.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/plsql.js +217 -0
- data/app/components/marty/script_form/javascripts/mode/properties/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/properties/properties.js +63 -0
- data/app/components/marty/script_form/javascripts/mode/python/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/python/index.html +123 -0
- data/app/components/marty/script_form/javascripts/mode/python/python.js +338 -0
- data/app/components/marty/script_form/javascripts/mode/r/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/r/index.html +74 -0
- data/app/components/marty/script_form/javascripts/mode/r/r.js +141 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/changes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/index.html +54 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/index.html +100 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.css +5 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.js +66 -0
- data/app/components/marty/script_form/javascripts/mode/rst/index.html +526 -0
- data/app/components/marty/script_form/javascripts/mode/rst/rst.js +326 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/index.html +172 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/ruby.js +195 -0
- data/app/components/marty/script_form/javascripts/mode/rust/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/rust/rust.js +432 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/index.html +65 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/scheme.js +230 -0
- data/app/components/marty/script_form/javascripts/mode/shell/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/shell/shell.js +118 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/LICENSE +23 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/index.html +81 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/sieve.js +156 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/index.html +56 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/smalltalk.js +139 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/smarty.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/sparql.js +143 -0
- data/app/components/marty/script_form/javascripts/mode/stex/index.html +98 -0
- data/app/components/marty/script_form/javascripts/mode/stex/stex.js +182 -0
- data/app/components/marty/script_form/javascripts/mode/stex/test.js +343 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/index.html +141 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.js +384 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.css +26 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.js +309 -0
- data/app/components/marty/script_form/javascripts/mode/vb/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/vb/index.html +89 -0
- data/app/components/marty/script_form/javascripts/mode/vb/vb.js +260 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/vbscript.js +26 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/index.html +104 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/velocity.js +146 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/index.html +211 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/verilog.js +194 -0
- data/app/components/marty/script_form/javascripts/mode/xml/index.html +45 -0
- data/app/components/marty/script_form/javascripts/mode/xml/xml.js +318 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/LICENSE +20 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/index.html +223 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/index.html +27 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testBase.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testEmptySequenceKeyword.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testMultiAttr.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testNamespaces.js +91 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testProcessingInstructions.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testQuotes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/xquery.js +451 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/index.html +68 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/yaml.js +95 -0
- data/app/components/marty/script_form/javascripts/util/closetag.js +164 -0
- data/app/components/marty/script_form/javascripts/util/dialog.css +27 -0
- data/app/components/marty/script_form/javascripts/util/dialog.js +70 -0
- data/app/components/marty/script_form/javascripts/util/foldcode.js +196 -0
- data/app/components/marty/script_form/javascripts/util/formatting.js +193 -0
- data/app/components/marty/script_form/javascripts/util/javascript-hint.js +134 -0
- data/app/components/marty/script_form/javascripts/util/loadmode.js +51 -0
- data/app/components/marty/script_form/javascripts/util/match-highlighter.js +44 -0
- data/app/components/marty/script_form/javascripts/util/multiplex.js +77 -0
- data/app/components/marty/script_form/javascripts/util/overlay.js +54 -0
- data/app/components/marty/script_form/javascripts/util/pig-hint.js +123 -0
- data/app/components/marty/script_form/javascripts/util/runmode-standalone.js +90 -0
- data/app/components/marty/script_form/javascripts/util/runmode.js +53 -0
- data/app/components/marty/script_form/javascripts/util/search.js +118 -0
- data/app/components/marty/script_form/javascripts/util/searchcursor.js +119 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.css +16 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.js +97 -0
- data/app/components/marty/script_form/javascripts/util/xml-hint.js +137 -0
- data/app/components/marty/script_form/stylesheets/codemirror.css +172 -0
- data/app/components/marty/script_form/stylesheets/delorean.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/ambiance.css +81 -0
- data/app/components/marty/script_form/stylesheets/theme/blackboard.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/cobalt.css +18 -0
- data/app/components/marty/script_form/stylesheets/theme/eclipse.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/elegant.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/erlang-dark.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/lesser-dark.css +44 -0
- data/app/components/marty/script_form/stylesheets/theme/monokai.css +28 -0
- data/app/components/marty/script_form/stylesheets/theme/neat.css +9 -0
- data/app/components/marty/script_form/stylesheets/theme/night.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/rubyblue.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/vibrant-ink.css +27 -0
- data/app/components/marty/script_form/stylesheets/theme/xq-dark.css +46 -0
- data/app/components/marty/script_grid.rb +104 -0
- data/app/components/marty/script_grid.rb~ +99 -0
- data/app/components/marty/script_tester.rb +114 -0
- data/app/components/marty/script_tester.rb~ +213 -0
- data/app/components/marty/scripting.rb +132 -0
- data/app/components/marty/scripting.rb~ +124 -0
- data/app/components/marty/select_report.rb~ +143 -0
- data/app/components/marty/simple_app.rb +97 -0
- data/app/components/marty/simple_app.rb~ +101 -0
- data/app/components/marty/simple_app/javascripts/simple_app.js +50 -0
- data/app/components/marty/simple_app/javascripts/statusbar_ext.js +8 -0
- data/app/components/marty/tag_grid.rb +83 -0
- data/app/components/marty/tag_grid.rb~ +89 -0
- data/app/components/marty/tree_panel.rb~ +256 -0
- data/app/components/marty/tree_panel/javascripts/tree_panel.js~ +317 -0
- data/app/components/marty/user_pivot.rb +128 -0
- data/app/components/marty/user_view.rb +181 -0
- data/app/components/marty/user_view.rb~ +188 -0
- data/app/controllers/marty/application_controller.rb +124 -0
- data/app/controllers/marty/application_controller.rb~ +133 -0
- data/app/controllers/marty/components_controller.rb +41 -0
- data/app/controllers/marty/components_controller.rb~ +37 -0
- data/app/controllers/marty/job_controller.rb +28 -0
- data/app/controllers/marty/job_controller.rb~ +28 -0
- data/app/controllers/marty/rpc_controller.rb +64 -0
- data/app/controllers/marty/rpc_controller.rb~ +61 -0
- data/app/helpers/marty/application_helper.rb +4 -0
- data/app/helpers/marty/script_set.rb +57 -0
- data/app/helpers/marty/script_set.rb~ +59 -0
- data/app/models/marty/api_auth.rb +44 -0
- data/app/models/marty/api_auth.rb~ +48 -0
- data/app/models/marty/base.rb +4 -0
- data/app/models/marty/data_change.rb +179 -0
- data/app/models/marty/data_change.rb~ +141 -0
- data/app/models/marty/enum.rb +22 -0
- data/app/models/marty/enum.rb~ +16 -0
- data/app/models/marty/import_type.rb +44 -0
- data/app/models/marty/import_type.rb~ +48 -0
- data/app/models/marty/poop.rb~ +169 -0
- data/app/models/marty/posting.rb +101 -0
- data/app/models/marty/posting.rb~ +86 -0
- data/app/models/marty/posting_type.rb +12 -0
- data/app/models/marty/posting_type.rb~ +21 -0
- data/app/models/marty/promise.rb +252 -0
- data/app/models/marty/promise.rb~ +196 -0
- data/app/models/marty/role.rb +6 -0
- data/app/models/marty/role.rb~ +10 -0
- data/app/models/marty/script.rb +144 -0
- data/app/models/marty/script.rb~ +62 -0
- data/app/models/marty/tag.rb +96 -0
- data/app/models/marty/tag.rb~ +91 -0
- data/app/models/marty/token.rb +30 -0
- data/app/models/marty/user.rb +146 -0
- data/app/models/marty/user.rb~ +148 -0
- data/app/models/marty/user_role.rb +7 -0
- data/app/models/marty/user_role.rb~ +13 -0
- data/app/views/layouts/marty/application.html.erb +12 -0
- data/app/views/layouts/marty/application.html.erb~ +11 -0
- data/config/locales/en.yml +134 -0
- data/config/routes.rb +6 -0
- data/config/routes.rb~ +10 -0
- data/db/migrate/001_create_marty_scripts.rb +14 -0
- data/db/migrate/003_create_marty_users.rb +12 -0
- data/db/migrate/004_create_marty_roles.rb +7 -0
- data/db/migrate/005_create_marty_user_roles.rb +14 -0
- data/db/migrate/006_create_marty_tokens.rb +14 -0
- data/db/migrate/008_create_marty_posting_types.rb +7 -0
- data/db/migrate/019_create_marty_postings.rb +18 -0
- data/db/migrate/019_create_marty_postings.rb~ +19 -0
- data/db/migrate/068_create_marty_import_types.rb +12 -0
- data/db/migrate/069_create_marty_import_synonyms.rb +15 -0
- data/db/migrate/070_create_versions.rb +18 -0
- data/db/migrate/071_add_object_changes_column_to_versions.rb +9 -0
- data/db/migrate/072_add_validation_function_to_import_types.rb +6 -0
- data/db/migrate/073_add_preprocess_function_to_import_types.rb +5 -0
- data/db/migrate/090_create_delayed_jobs.rb +22 -0
- data/db/migrate/091_create_marty_promises.rb +36 -0
- data/db/migrate/095_create_marty_tags.rb +14 -0
- data/db/migrate/095_create_marty_tags.rb~ +19 -0
- data/db/migrate/096_add_user_roles_to_import_types.rb +11 -0
- data/db/migrate/097_drop_versions.rb +9 -0
- data/db/migrate/098_create_marty_api_auths.rb +20 -0
- data/db/seeds.rb +48 -0
- data/lib/marty.rb +18 -0
- data/lib/marty.rb~ +13 -0
- data/lib/marty/content_handler.rb +97 -0
- data/lib/marty/content_handler.rb~ +93 -0
- data/lib/marty/data_conversion.rb +298 -0
- data/lib/marty/data_exporter.rb +150 -0
- data/lib/marty/data_exporter.rb~ +137 -0
- data/lib/marty/data_importer.rb +122 -0
- data/lib/marty/data_importer.rb~ +114 -0
- data/lib/marty/data_row_processor.rb~ +206 -0
- data/lib/marty/drop_folder_hook.rb~ +17 -0
- data/lib/marty/engine.rb +10 -0
- data/lib/marty/folder_hook.rb~ +9 -0
- data/lib/marty/lazy_column_loader.rb +57 -0
- data/lib/marty/lazy_column_loader.rb~ +47 -0
- data/lib/marty/mcfly_query.rb +189 -0
- data/lib/marty/mcfly_query.rb~ +188 -0
- data/lib/marty/migrations.rb +108 -0
- data/lib/marty/migrations.rb~ +65 -0
- data/lib/marty/monkey.rb +163 -0
- data/lib/marty/monkey.rb~ +160 -0
- data/lib/marty/permissions.rb +64 -0
- data/lib/marty/permissions.rb~ +69 -0
- data/lib/marty/promise.rb~ +41 -0
- data/lib/marty/promise_job.rb +123 -0
- data/lib/marty/promise_job.rb~ +121 -0
- data/lib/marty/promise_proxy.rb +94 -0
- data/lib/marty/promise_proxy.rb~ +69 -0
- data/lib/marty/railtie.rb +5 -0
- data/lib/marty/relation.rb +39 -0
- data/lib/marty/util.rb +110 -0
- data/lib/marty/util.rb~ +80 -0
- data/lib/marty/version.rb +3 -0
- data/lib/marty/version.rb~ +3 -0
- data/lib/marty/xl.rb +527 -0
- data/lib/marty/xl.rb~ +526 -0
- data/lib/pyxll/README.txt +19 -0
- data/lib/pyxll/README.txt~ +16 -0
- data/lib/pyxll/gemini.py +155 -0
- data/lib/pyxll/gemini.py~ +110 -0
- data/lib/pyxll/pyxll.cfg +12 -0
- data/lib/pyxll/pyxll.cfg~ +12 -0
- data/lib/pyxll/sample.xlsx +0 -0
- data/lib/tasks/marty_tasks.rake +37 -0
- metadata +517 -0
@@ -0,0 +1,343 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>CodeMirror: Markdown mode</title>
|
6
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7
|
+
<script src="../../lib/codemirror.js"></script>
|
8
|
+
<script src="../xml/xml.js"></script>
|
9
|
+
<script src="markdown.js"></script>
|
10
|
+
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<h1>CodeMirror: Markdown mode</h1>
|
15
|
+
|
16
|
+
<!-- source: http://daringfireball.net/projects/markdown/basics.text -->
|
17
|
+
<form><textarea id="code" name="code">
|
18
|
+
Markdown: Basics
|
19
|
+
================
|
20
|
+
|
21
|
+
<ul id="ProjectSubmenu">
|
22
|
+
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
|
23
|
+
<li><a class="selected" title="Markdown Basics">Basics</a></li>
|
24
|
+
<li><a href="/projects/markdown/syntax" title="Markdown Syntax Documentation">Syntax</a></li>
|
25
|
+
<li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li>
|
26
|
+
<li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li>
|
27
|
+
</ul>
|
28
|
+
|
29
|
+
|
30
|
+
Getting the Gist of Markdown's Formatting Syntax
|
31
|
+
------------------------------------------------
|
32
|
+
|
33
|
+
This page offers a brief overview of what it's like to use Markdown.
|
34
|
+
The [syntax page] [s] provides complete, detailed documentation for
|
35
|
+
every feature, but Markdown should be very easy to pick up simply by
|
36
|
+
looking at a few examples of it in action. The examples on this page
|
37
|
+
are written in a before/after style, showing example syntax and the
|
38
|
+
HTML output produced by Markdown.
|
39
|
+
|
40
|
+
It's also helpful to simply try Markdown out; the [Dingus] [d] is a
|
41
|
+
web application that allows you type your own Markdown-formatted text
|
42
|
+
and translate it to XHTML.
|
43
|
+
|
44
|
+
**Note:** This document is itself written using Markdown; you
|
45
|
+
can [see the source for it by adding '.text' to the URL] [src].
|
46
|
+
|
47
|
+
[s]: /projects/markdown/syntax "Markdown Syntax"
|
48
|
+
[d]: /projects/markdown/dingus "Markdown Dingus"
|
49
|
+
[src]: /projects/markdown/basics.text
|
50
|
+
|
51
|
+
|
52
|
+
## Paragraphs, Headers, Blockquotes ##
|
53
|
+
|
54
|
+
A paragraph is simply one or more consecutive lines of text, separated
|
55
|
+
by one or more blank lines. (A blank line is any line that looks like
|
56
|
+
a blank line -- a line containing nothing but spaces or tabs is
|
57
|
+
considered blank.) Normal paragraphs should not be indented with
|
58
|
+
spaces or tabs.
|
59
|
+
|
60
|
+
Markdown offers two styles of headers: *Setext* and *atx*.
|
61
|
+
Setext-style headers for `<h1>` and `<h2>` are created by
|
62
|
+
"underlining" with equal signs (`=`) and hyphens (`-`), respectively.
|
63
|
+
To create an atx-style header, you put 1-6 hash marks (`#`) at the
|
64
|
+
beginning of the line -- the number of hashes equals the resulting
|
65
|
+
HTML header level.
|
66
|
+
|
67
|
+
Blockquotes are indicated using email-style '`>`' angle brackets.
|
68
|
+
|
69
|
+
Markdown:
|
70
|
+
|
71
|
+
A First Level Header
|
72
|
+
====================
|
73
|
+
|
74
|
+
A Second Level Header
|
75
|
+
---------------------
|
76
|
+
|
77
|
+
Now is the time for all good men to come to
|
78
|
+
the aid of their country. This is just a
|
79
|
+
regular paragraph.
|
80
|
+
|
81
|
+
The quick brown fox jumped over the lazy
|
82
|
+
dog's back.
|
83
|
+
|
84
|
+
### Header 3
|
85
|
+
|
86
|
+
> This is a blockquote.
|
87
|
+
>
|
88
|
+
> This is the second paragraph in the blockquote.
|
89
|
+
>
|
90
|
+
> ## This is an H2 in a blockquote
|
91
|
+
|
92
|
+
|
93
|
+
Output:
|
94
|
+
|
95
|
+
<h1>A First Level Header</h1>
|
96
|
+
|
97
|
+
<h2>A Second Level Header</h2>
|
98
|
+
|
99
|
+
<p>Now is the time for all good men to come to
|
100
|
+
the aid of their country. This is just a
|
101
|
+
regular paragraph.</p>
|
102
|
+
|
103
|
+
<p>The quick brown fox jumped over the lazy
|
104
|
+
dog's back.</p>
|
105
|
+
|
106
|
+
<h3>Header 3</h3>
|
107
|
+
|
108
|
+
<blockquote>
|
109
|
+
<p>This is a blockquote.</p>
|
110
|
+
|
111
|
+
<p>This is the second paragraph in the blockquote.</p>
|
112
|
+
|
113
|
+
<h2>This is an H2 in a blockquote</h2>
|
114
|
+
</blockquote>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
### Phrase Emphasis ###
|
119
|
+
|
120
|
+
Markdown uses asterisks and underscores to indicate spans of emphasis.
|
121
|
+
|
122
|
+
Markdown:
|
123
|
+
|
124
|
+
Some of these words *are emphasized*.
|
125
|
+
Some of these words _are emphasized also_.
|
126
|
+
|
127
|
+
Use two asterisks for **strong emphasis**.
|
128
|
+
Or, if you prefer, __use two underscores instead__.
|
129
|
+
|
130
|
+
Output:
|
131
|
+
|
132
|
+
<p>Some of these words <em>are emphasized</em>.
|
133
|
+
Some of these words <em>are emphasized also</em>.</p>
|
134
|
+
|
135
|
+
<p>Use two asterisks for <strong>strong emphasis</strong>.
|
136
|
+
Or, if you prefer, <strong>use two underscores instead</strong>.</p>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
## Lists ##
|
141
|
+
|
142
|
+
Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
|
143
|
+
`+`, and `-`) as list markers. These three markers are
|
144
|
+
interchangable; this:
|
145
|
+
|
146
|
+
* Candy.
|
147
|
+
* Gum.
|
148
|
+
* Booze.
|
149
|
+
|
150
|
+
this:
|
151
|
+
|
152
|
+
+ Candy.
|
153
|
+
+ Gum.
|
154
|
+
+ Booze.
|
155
|
+
|
156
|
+
and this:
|
157
|
+
|
158
|
+
- Candy.
|
159
|
+
- Gum.
|
160
|
+
- Booze.
|
161
|
+
|
162
|
+
all produce the same output:
|
163
|
+
|
164
|
+
<ul>
|
165
|
+
<li>Candy.</li>
|
166
|
+
<li>Gum.</li>
|
167
|
+
<li>Booze.</li>
|
168
|
+
</ul>
|
169
|
+
|
170
|
+
Ordered (numbered) lists use regular numbers, followed by periods, as
|
171
|
+
list markers:
|
172
|
+
|
173
|
+
1. Red
|
174
|
+
2. Green
|
175
|
+
3. Blue
|
176
|
+
|
177
|
+
Output:
|
178
|
+
|
179
|
+
<ol>
|
180
|
+
<li>Red</li>
|
181
|
+
<li>Green</li>
|
182
|
+
<li>Blue</li>
|
183
|
+
</ol>
|
184
|
+
|
185
|
+
If you put blank lines between items, you'll get `<p>` tags for the
|
186
|
+
list item text. You can create multi-paragraph list items by indenting
|
187
|
+
the paragraphs by 4 spaces or 1 tab:
|
188
|
+
|
189
|
+
* A list item.
|
190
|
+
|
191
|
+
With multiple paragraphs.
|
192
|
+
|
193
|
+
* Another item in the list.
|
194
|
+
|
195
|
+
Output:
|
196
|
+
|
197
|
+
<ul>
|
198
|
+
<li><p>A list item.</p>
|
199
|
+
<p>With multiple paragraphs.</p></li>
|
200
|
+
<li><p>Another item in the list.</p></li>
|
201
|
+
</ul>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
### Links ###
|
206
|
+
|
207
|
+
Markdown supports two styles for creating links: *inline* and
|
208
|
+
*reference*. With both styles, you use square brackets to delimit the
|
209
|
+
text you want to turn into a link.
|
210
|
+
|
211
|
+
Inline-style links use parentheses immediately after the link text.
|
212
|
+
For example:
|
213
|
+
|
214
|
+
This is an [example link](http://example.com/).
|
215
|
+
|
216
|
+
Output:
|
217
|
+
|
218
|
+
<p>This is an <a href="http://example.com/">
|
219
|
+
example link</a>.</p>
|
220
|
+
|
221
|
+
Optionally, you may include a title attribute in the parentheses:
|
222
|
+
|
223
|
+
This is an [example link](http://example.com/ "With a Title").
|
224
|
+
|
225
|
+
Output:
|
226
|
+
|
227
|
+
<p>This is an <a href="http://example.com/" title="With a Title">
|
228
|
+
example link</a>.</p>
|
229
|
+
|
230
|
+
Reference-style links allow you to refer to your links by names, which
|
231
|
+
you define elsewhere in your document:
|
232
|
+
|
233
|
+
I get 10 times more traffic from [Google][1] than from
|
234
|
+
[Yahoo][2] or [MSN][3].
|
235
|
+
|
236
|
+
[1]: http://google.com/ "Google"
|
237
|
+
[2]: http://search.yahoo.com/ "Yahoo Search"
|
238
|
+
[3]: http://search.msn.com/ "MSN Search"
|
239
|
+
|
240
|
+
Output:
|
241
|
+
|
242
|
+
<p>I get 10 times more traffic from <a href="http://google.com/"
|
243
|
+
title="Google">Google</a> than from <a href="http://search.yahoo.com/"
|
244
|
+
title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
|
245
|
+
title="MSN Search">MSN</a>.</p>
|
246
|
+
|
247
|
+
The title attribute is optional. Link names may contain letters,
|
248
|
+
numbers and spaces, but are *not* case sensitive:
|
249
|
+
|
250
|
+
I start my morning with a cup of coffee and
|
251
|
+
[The New York Times][NY Times].
|
252
|
+
|
253
|
+
[ny times]: http://www.nytimes.com/
|
254
|
+
|
255
|
+
Output:
|
256
|
+
|
257
|
+
<p>I start my morning with a cup of coffee and
|
258
|
+
<a href="http://www.nytimes.com/">The New York Times</a>.</p>
|
259
|
+
|
260
|
+
|
261
|
+
### Images ###
|
262
|
+
|
263
|
+
Image syntax is very much like link syntax.
|
264
|
+
|
265
|
+
Inline (titles are optional):
|
266
|
+
|
267
|
+
![alt text](/path/to/img.jpg "Title")
|
268
|
+
|
269
|
+
Reference-style:
|
270
|
+
|
271
|
+
![alt text][id]
|
272
|
+
|
273
|
+
[id]: /path/to/img.jpg "Title"
|
274
|
+
|
275
|
+
Both of the above examples produce the same output:
|
276
|
+
|
277
|
+
<img src="/path/to/img.jpg" alt="alt text" title="Title" />
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
### Code ###
|
282
|
+
|
283
|
+
In a regular paragraph, you can create code span by wrapping text in
|
284
|
+
backtick quotes. Any ampersands (`&`) and angle brackets (`<` or
|
285
|
+
`>`) will automatically be translated into HTML entities. This makes
|
286
|
+
it easy to use Markdown to write about HTML example code:
|
287
|
+
|
288
|
+
I strongly recommend against using any `<blink>` tags.
|
289
|
+
|
290
|
+
I wish SmartyPants used named entities like `&mdash;`
|
291
|
+
instead of decimal-encoded entites like `&#8212;`.
|
292
|
+
|
293
|
+
Output:
|
294
|
+
|
295
|
+
<p>I strongly recommend against using any
|
296
|
+
<code>&lt;blink&gt;</code> tags.</p>
|
297
|
+
|
298
|
+
<p>I wish SmartyPants used named entities like
|
299
|
+
<code>&amp;mdash;</code> instead of decimal-encoded
|
300
|
+
entites like <code>&amp;#8212;</code>.</p>
|
301
|
+
|
302
|
+
|
303
|
+
To specify an entire block of pre-formatted code, indent every line of
|
304
|
+
the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`,
|
305
|
+
and `>` characters will be escaped automatically.
|
306
|
+
|
307
|
+
Markdown:
|
308
|
+
|
309
|
+
If you want your page to validate under XHTML 1.0 Strict,
|
310
|
+
you've got to put paragraph tags in your blockquotes:
|
311
|
+
|
312
|
+
<blockquote>
|
313
|
+
<p>For example.</p>
|
314
|
+
</blockquote>
|
315
|
+
|
316
|
+
Output:
|
317
|
+
|
318
|
+
<p>If you want your page to validate under XHTML 1.0 Strict,
|
319
|
+
you've got to put paragraph tags in your blockquotes:</p>
|
320
|
+
|
321
|
+
<pre><code>&lt;blockquote&gt;
|
322
|
+
&lt;p&gt;For example.&lt;/p&gt;
|
323
|
+
&lt;/blockquote&gt;
|
324
|
+
</code></pre>
|
325
|
+
</textarea></form>
|
326
|
+
|
327
|
+
<script>
|
328
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
329
|
+
mode: 'markdown',
|
330
|
+
lineNumbers: true,
|
331
|
+
matchBrackets: true,
|
332
|
+
theme: "default"
|
333
|
+
});
|
334
|
+
</script>
|
335
|
+
|
336
|
+
<p>Optionally depends on the XML mode for properly highlighted inline XML blocks.</p>
|
337
|
+
|
338
|
+
<p><strong>MIME types defined:</strong> <code>text/x-markdown</code>.</p>
|
339
|
+
|
340
|
+
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#markdown_*">normal</a>, <a href="../../test/index.html#verbose,markdown_*">verbose</a>.</p>
|
341
|
+
|
342
|
+
</body>
|
343
|
+
</html>
|
@@ -0,0 +1,382 @@
|
|
1
|
+
CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
2
|
+
|
3
|
+
var htmlFound = CodeMirror.mimeModes.hasOwnProperty("text/html");
|
4
|
+
var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? "text/html" : "text/plain");
|
5
|
+
|
6
|
+
var codeDepth = 0;
|
7
|
+
var prevLineHasContent = false
|
8
|
+
, thisLineHasContent = false;
|
9
|
+
|
10
|
+
var header = 'header'
|
11
|
+
, code = 'comment'
|
12
|
+
, quote = 'quote'
|
13
|
+
, list = 'string'
|
14
|
+
, hr = 'hr'
|
15
|
+
, linkinline = 'link'
|
16
|
+
, linkemail = 'link'
|
17
|
+
, linktext = 'link'
|
18
|
+
, linkhref = 'string'
|
19
|
+
, em = 'em'
|
20
|
+
, strong = 'strong'
|
21
|
+
, emstrong = 'emstrong';
|
22
|
+
|
23
|
+
var hrRE = /^([*\-=_])(?:\s*\1){2,}\s*$/
|
24
|
+
, ulRE = /^[*\-+]\s+/
|
25
|
+
, olRE = /^[0-9]+\.\s+/
|
26
|
+
, headerRE = /^(?:\={1,}|-{1,})$/
|
27
|
+
, textRE = /^[^\[*_\\<>` "'(]+/;
|
28
|
+
|
29
|
+
function switchInline(stream, state, f) {
|
30
|
+
state.f = state.inline = f;
|
31
|
+
return f(stream, state);
|
32
|
+
}
|
33
|
+
|
34
|
+
function switchBlock(stream, state, f) {
|
35
|
+
state.f = state.block = f;
|
36
|
+
return f(stream, state);
|
37
|
+
}
|
38
|
+
|
39
|
+
|
40
|
+
// Blocks
|
41
|
+
|
42
|
+
function blankLine(state) {
|
43
|
+
// Reset linkTitle state
|
44
|
+
state.linkTitle = false;
|
45
|
+
// Reset CODE state
|
46
|
+
state.code = false;
|
47
|
+
// Reset EM state
|
48
|
+
state.em = false;
|
49
|
+
// Reset STRONG state
|
50
|
+
state.strong = false;
|
51
|
+
// Reset state.quote
|
52
|
+
state.quote = false;
|
53
|
+
if (!htmlFound && state.f == htmlBlock) {
|
54
|
+
state.f = inlineNormal;
|
55
|
+
state.block = blockNormal;
|
56
|
+
}
|
57
|
+
return null;
|
58
|
+
}
|
59
|
+
|
60
|
+
function blockNormal(stream, state) {
|
61
|
+
var match;
|
62
|
+
|
63
|
+
if (state.list !== false && state.indentationDiff >= 0) { // Continued list
|
64
|
+
if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block
|
65
|
+
state.indentation -= state.indentationDiff;
|
66
|
+
}
|
67
|
+
state.list = null;
|
68
|
+
} else { // No longer a list
|
69
|
+
state.list = false;
|
70
|
+
}
|
71
|
+
|
72
|
+
if (state.indentationDiff >= 4) {
|
73
|
+
state.indentation -= 4;
|
74
|
+
stream.skipToEnd();
|
75
|
+
return code;
|
76
|
+
} else if (stream.eatSpace()) {
|
77
|
+
return null;
|
78
|
+
} else if (stream.peek() === '#' || (prevLineHasContent && stream.match(headerRE)) ) {
|
79
|
+
state.header = true;
|
80
|
+
} else if (stream.eat('>')) {
|
81
|
+
state.indentation++;
|
82
|
+
state.quote = true;
|
83
|
+
} else if (stream.peek() === '[') {
|
84
|
+
return switchInline(stream, state, footnoteLink);
|
85
|
+
} else if (stream.match(hrRE, true)) {
|
86
|
+
return hr;
|
87
|
+
} else if (match = stream.match(ulRE, true) || stream.match(olRE, true)) {
|
88
|
+
state.indentation += 4;
|
89
|
+
state.list = true;
|
90
|
+
}
|
91
|
+
|
92
|
+
return switchInline(stream, state, state.inline);
|
93
|
+
}
|
94
|
+
|
95
|
+
function htmlBlock(stream, state) {
|
96
|
+
var style = htmlMode.token(stream, state.htmlState);
|
97
|
+
if (htmlFound && style === 'tag' && state.htmlState.type !== 'openTag' && !state.htmlState.context) {
|
98
|
+
state.f = inlineNormal;
|
99
|
+
state.block = blockNormal;
|
100
|
+
}
|
101
|
+
if (state.md_inside && stream.current().indexOf(">")!=-1) {
|
102
|
+
state.f = inlineNormal;
|
103
|
+
state.block = blockNormal;
|
104
|
+
state.htmlState.context = undefined;
|
105
|
+
}
|
106
|
+
return style;
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
// Inline
|
111
|
+
function getType(state) {
|
112
|
+
var styles = [];
|
113
|
+
|
114
|
+
if (state.strong) { styles.push(state.em ? emstrong : strong); }
|
115
|
+
else if (state.em) { styles.push(em); }
|
116
|
+
|
117
|
+
if (state.code) { styles.push(code); }
|
118
|
+
|
119
|
+
if (state.header) { styles.push(header); }
|
120
|
+
if (state.quote) { styles.push(quote); }
|
121
|
+
if (state.list !== false) { styles.push(list); }
|
122
|
+
|
123
|
+
return styles.length ? styles.join(' ') : null;
|
124
|
+
}
|
125
|
+
|
126
|
+
function handleText(stream, state) {
|
127
|
+
if (stream.match(textRE, true)) {
|
128
|
+
return getType(state);
|
129
|
+
}
|
130
|
+
return undefined;
|
131
|
+
}
|
132
|
+
|
133
|
+
function inlineNormal(stream, state) {
|
134
|
+
var style = state.text(stream, state);
|
135
|
+
if (typeof style !== 'undefined')
|
136
|
+
return style;
|
137
|
+
|
138
|
+
if (state.list) { // List marker (*, +, -, 1., etc)
|
139
|
+
state.list = null;
|
140
|
+
return list;
|
141
|
+
}
|
142
|
+
|
143
|
+
var ch = stream.next();
|
144
|
+
|
145
|
+
if (ch === '\\') {
|
146
|
+
stream.next();
|
147
|
+
return getType(state);
|
148
|
+
}
|
149
|
+
|
150
|
+
// Matches link titles present on next line
|
151
|
+
if (state.linkTitle) {
|
152
|
+
state.linkTitle = false;
|
153
|
+
var matchCh = ch;
|
154
|
+
if (ch === '(') {
|
155
|
+
matchCh = ')';
|
156
|
+
}
|
157
|
+
matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
|
158
|
+
var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
|
159
|
+
if (stream.match(new RegExp(regex), true)) {
|
160
|
+
return linkhref;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
if (ch === '`') {
|
165
|
+
var t = getType(state);
|
166
|
+
var before = stream.pos;
|
167
|
+
stream.eatWhile('`');
|
168
|
+
var difference = 1 + stream.pos - before;
|
169
|
+
if (!state.code) {
|
170
|
+
codeDepth = difference;
|
171
|
+
state.code = true;
|
172
|
+
return getType(state);
|
173
|
+
} else {
|
174
|
+
if (difference === codeDepth) { // Must be exact
|
175
|
+
state.code = false;
|
176
|
+
return t;
|
177
|
+
}
|
178
|
+
return getType(state);
|
179
|
+
}
|
180
|
+
} else if (state.code) {
|
181
|
+
return getType(state);
|
182
|
+
}
|
183
|
+
|
184
|
+
if (ch === '[' && stream.match(/.*\] ?(?:\(|\[)/, false)) {
|
185
|
+
return switchInline(stream, state, linkText);
|
186
|
+
}
|
187
|
+
|
188
|
+
if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, true)) {
|
189
|
+
return switchInline(stream, state, inlineElement(linkinline, '>'));
|
190
|
+
}
|
191
|
+
|
192
|
+
if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, true)) {
|
193
|
+
return switchInline(stream, state, inlineElement(linkemail, '>'));
|
194
|
+
}
|
195
|
+
|
196
|
+
if (ch === '<' && stream.match(/^\w/, false)) {
|
197
|
+
var md_inside = false;
|
198
|
+
if (stream.string.indexOf(">")!=-1) {
|
199
|
+
var atts = stream.string.substring(1,stream.string.indexOf(">"));
|
200
|
+
if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) {
|
201
|
+
state.md_inside = true;
|
202
|
+
}
|
203
|
+
}
|
204
|
+
stream.backUp(1);
|
205
|
+
return switchBlock(stream, state, htmlBlock);
|
206
|
+
}
|
207
|
+
|
208
|
+
if (ch === '<' && stream.match(/^\/\w*?>/)) {
|
209
|
+
state.md_inside = false;
|
210
|
+
return "tag";
|
211
|
+
}
|
212
|
+
|
213
|
+
var t = getType(state);
|
214
|
+
if (ch === '*' || ch === '_') {
|
215
|
+
if (state.strong === ch && stream.eat(ch)) { // Remove STRONG
|
216
|
+
state.strong = false;
|
217
|
+
return t;
|
218
|
+
} else if (!state.strong && stream.eat(ch)) { // Add STRONG
|
219
|
+
state.strong = ch;
|
220
|
+
return getType(state);
|
221
|
+
} else if (state.em === ch) { // Remove EM
|
222
|
+
state.em = false;
|
223
|
+
return t;
|
224
|
+
} else if (!state.em) { // Add EM
|
225
|
+
state.em = ch;
|
226
|
+
return getType(state);
|
227
|
+
}
|
228
|
+
} else if (ch === ' ') {
|
229
|
+
if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
|
230
|
+
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
|
231
|
+
return getType(state);
|
232
|
+
} else { // Not surrounded by spaces, back up pointer
|
233
|
+
stream.backUp(1);
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}
|
237
|
+
|
238
|
+
return getType(state);
|
239
|
+
}
|
240
|
+
|
241
|
+
function linkText(stream, state) {
|
242
|
+
while (!stream.eol()) {
|
243
|
+
var ch = stream.next();
|
244
|
+
if (ch === '\\') stream.next();
|
245
|
+
if (ch === ']') {
|
246
|
+
state.inline = state.f = linkHref;
|
247
|
+
return linktext;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
return linktext;
|
251
|
+
}
|
252
|
+
|
253
|
+
function linkHref(stream, state) {
|
254
|
+
// Check if space, and return NULL if so (to avoid marking the space)
|
255
|
+
if(stream.eatSpace()){
|
256
|
+
return null;
|
257
|
+
}
|
258
|
+
var ch = stream.next();
|
259
|
+
if (ch === '(' || ch === '[') {
|
260
|
+
return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']'));
|
261
|
+
}
|
262
|
+
return 'error';
|
263
|
+
}
|
264
|
+
|
265
|
+
function footnoteLink(stream, state) {
|
266
|
+
if (stream.match(/^[^\]]*\]:/, true)) {
|
267
|
+
state.f = footnoteUrl;
|
268
|
+
return linktext;
|
269
|
+
}
|
270
|
+
return switchInline(stream, state, inlineNormal);
|
271
|
+
}
|
272
|
+
|
273
|
+
function footnoteUrl(stream, state) {
|
274
|
+
// Check if space, and return NULL if so (to avoid marking the space)
|
275
|
+
if(stream.eatSpace()){
|
276
|
+
return null;
|
277
|
+
}
|
278
|
+
// Match URL
|
279
|
+
stream.match(/^[^\s]+/, true);
|
280
|
+
// Check for link title
|
281
|
+
if (stream.peek() === undefined) { // End of line, set flag to check next line
|
282
|
+
state.linkTitle = true;
|
283
|
+
} else { // More content on line, check if link title
|
284
|
+
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
|
285
|
+
}
|
286
|
+
state.f = state.inline = inlineNormal;
|
287
|
+
return linkhref;
|
288
|
+
}
|
289
|
+
|
290
|
+
function inlineRE(endChar) {
|
291
|
+
if (!inlineRE[endChar]) {
|
292
|
+
// Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741)
|
293
|
+
endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
|
294
|
+
// Match any non-endChar, escaped character, as well as the closing
|
295
|
+
// endChar.
|
296
|
+
inlineRE[endChar] = new RegExp('^(?:[^\\\\]+?|\\\\.)*?(' + endChar + ')');
|
297
|
+
}
|
298
|
+
return inlineRE[endChar];
|
299
|
+
}
|
300
|
+
|
301
|
+
function inlineElement(type, endChar, next) {
|
302
|
+
next = next || inlineNormal;
|
303
|
+
return function(stream, state) {
|
304
|
+
stream.match(inlineRE(endChar));
|
305
|
+
state.inline = state.f = next;
|
306
|
+
return type;
|
307
|
+
};
|
308
|
+
}
|
309
|
+
|
310
|
+
return {
|
311
|
+
startState: function() {
|
312
|
+
return {
|
313
|
+
f: blockNormal,
|
314
|
+
|
315
|
+
block: blockNormal,
|
316
|
+
htmlState: CodeMirror.startState(htmlMode),
|
317
|
+
indentation: 0,
|
318
|
+
|
319
|
+
inline: inlineNormal,
|
320
|
+
text: handleText,
|
321
|
+
linkTitle: false,
|
322
|
+
em: false,
|
323
|
+
strong: false,
|
324
|
+
header: false,
|
325
|
+
list: false,
|
326
|
+
quote: false
|
327
|
+
};
|
328
|
+
},
|
329
|
+
|
330
|
+
copyState: function(s) {
|
331
|
+
return {
|
332
|
+
f: s.f,
|
333
|
+
|
334
|
+
block: s.block,
|
335
|
+
htmlState: CodeMirror.copyState(htmlMode, s.htmlState),
|
336
|
+
indentation: s.indentation,
|
337
|
+
|
338
|
+
inline: s.inline,
|
339
|
+
text: s.text,
|
340
|
+
linkTitle: s.linkTitle,
|
341
|
+
em: s.em,
|
342
|
+
strong: s.strong,
|
343
|
+
header: s.header,
|
344
|
+
list: s.list,
|
345
|
+
quote: s.quote,
|
346
|
+
md_inside: s.md_inside
|
347
|
+
};
|
348
|
+
},
|
349
|
+
|
350
|
+
token: function(stream, state) {
|
351
|
+
if (stream.sol()) {
|
352
|
+
if (stream.match(/^\s*$/, true)) {
|
353
|
+
prevLineHasContent = false;
|
354
|
+
return blankLine(state);
|
355
|
+
} else {
|
356
|
+
if(thisLineHasContent){
|
357
|
+
prevLineHasContent = true;
|
358
|
+
thisLineHasContent = false;
|
359
|
+
}
|
360
|
+
thisLineHasContent = true;
|
361
|
+
}
|
362
|
+
|
363
|
+
// Reset state.header
|
364
|
+
state.header = false;
|
365
|
+
|
366
|
+
state.f = state.block;
|
367
|
+
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length;
|
368
|
+
state.indentationDiff = indentation - state.indentation;
|
369
|
+
state.indentation = indentation;
|
370
|
+
if (indentation > 0) { return null; }
|
371
|
+
}
|
372
|
+
return state.f(stream, state);
|
373
|
+
},
|
374
|
+
|
375
|
+
blankLine: blankLine,
|
376
|
+
|
377
|
+
getType: getType
|
378
|
+
};
|
379
|
+
|
380
|
+
}, "xml");
|
381
|
+
|
382
|
+
CodeMirror.defineMIME("text/x-markdown", "markdown");
|