ad2games-ui_components 2.0.0
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/Rakefile +28 -0
- data/app/assets/javascripts/ui_components.js.erb +26 -0
- data/app/assets/javascripts/ui_components/chosen_init.coffee +9 -0
- data/app/assets/javascripts/ui_components/domchange.coffee +1 -0
- data/app/assets/javascripts/ui_components/hide_empty_dropdowns.coffee +4 -0
- data/app/assets/javascripts/ui_components/modal.coffee +1 -0
- data/app/assets/javascripts/ui_components/navbar.coffee +2 -0
- data/app/assets/javascripts/ui_components/sticky_header.coffee +24 -0
- data/app/assets/javascripts/ui_components/submit_on_change.coffee +3 -0
- data/app/assets/javascripts/ui_components/turbolinks_progressbar.coffee +2 -0
- data/app/assets/stylesheets/a2g_ui_components.scss +8 -0
- data/app/assets/stylesheets/default_theme/button.scss +160 -0
- data/app/assets/stylesheets/default_theme/common.scss +15 -0
- data/app/assets/stylesheets/default_theme/footer.scss +7 -0
- data/app/assets/stylesheets/default_theme/form.scss +72 -0
- data/app/assets/stylesheets/default_theme/navbar.scss +55 -0
- data/app/assets/stylesheets/default_theme/table.scss +68 -0
- data/app/assets/stylesheets/default_theme/toolbar.scss +117 -0
- data/app/assets/stylesheets/libs.scss +6 -0
- data/app/assets/stylesheets/ui_components.scss.erb +15 -0
- data/app/assets/stylesheets/ui_components/checkbox_list.scss +11 -0
- data/app/assets/stylesheets/ui_components/date_range.scss +5 -0
- data/app/assets/stylesheets/ui_components/markdown_textarea.scss +7 -0
- data/app/assets/stylesheets/variables.scss +893 -0
- data/app/cells/checkbox_list/checkbox_list.yml +7 -0
- data/app/cells/checkbox_list/checkbox_list_cell.rb +33 -0
- data/app/cells/datagrid_filter/datagrid_filter.yml +14 -0
- data/app/cells/datagrid_filter/datagrid_filter_cell.rb +35 -0
- data/app/cells/date_range/date_range.coffee +69 -0
- data/app/cells/date_range/date_range.yml +7 -0
- data/app/cells/date_range/date_range_cell.rb +55 -0
- data/app/cells/form_cell_base.rb +26 -0
- data/app/cells/hello_world/hello_world.slim +1 -0
- data/app/cells/hello_world/hello_world.yml +5 -0
- data/app/cells/hello_world/hello_world_cell.rb +4 -0
- data/app/cells/markdown_readonly/markdown_readonly.coffee +5 -0
- data/app/cells/markdown_readonly/markdown_readonly.slim +1 -0
- data/app/cells/markdown_readonly/markdown_readonly.yml +4 -0
- data/app/cells/markdown_readonly/markdown_readonly_cell.rb +4 -0
- data/app/cells/markdown_textarea/markdown_textarea.coffee +9 -0
- data/app/cells/markdown_textarea/markdown_textarea.slim +9 -0
- data/app/cells/markdown_textarea/markdown_textarea.yml +8 -0
- data/app/cells/markdown_textarea/markdown_textarea_cell.rb +42 -0
- data/app/cells/modal/modal.coffee +2 -0
- data/app/cells/modal/modal.slim +12 -0
- data/app/cells/modal/modal.yml +22 -0
- data/app/cells/modal/modal_cell.rb +31 -0
- data/app/cells/select/select.coffee +35 -0
- data/app/cells/select/select.yml +14 -0
- data/app/cells/select/select_cell.rb +59 -0
- data/app/helpers/ui_components/view_helper.rb +8 -0
- data/lib/generators/generate_component.thor +32 -0
- data/lib/tasks/styleguide.rake +8 -0
- data/lib/ui_components.rb +14 -0
- data/lib/ui_components/cell.rb +16 -0
- data/lib/ui_components/cell_attributes.rb +49 -0
- data/lib/ui_components/docu_cop.rb +31 -0
- data/lib/ui_components/engine.rb +26 -0
- data/lib/ui_components/form_helper.rb +32 -0
- data/lib/ui_components/templates/cell.tt +2 -0
- data/lib/ui_components/templates/coffee.tt +0 -0
- data/lib/ui_components/templates/config.tt +9 -0
- data/lib/ui_components/templates/sass.tt +0 -0
- data/lib/ui_components/templates/view.tt +0 -0
- data/vendor/assets/bower_components/ajax-chosen/CHANGELOG.md +10 -0
- data/vendor/assets/bower_components/ajax-chosen/Cakefile +93 -0
- data/vendor/assets/bower_components/ajax-chosen/Makefile +2 -0
- data/vendor/assets/bower_components/ajax-chosen/README.md +131 -0
- data/vendor/assets/bower_components/ajax-chosen/VERSION +1 -0
- data/vendor/assets/bower_components/ajax-chosen/bower.json +23 -0
- data/vendor/assets/bower_components/ajax-chosen/data.json +57 -0
- data/vendor/assets/bower_components/ajax-chosen/docs/ajax-chosen.html +71 -0
- data/vendor/assets/bower_components/ajax-chosen/docs/docco.css +186 -0
- data/vendor/assets/bower_components/ajax-chosen/index.html +47 -0
- data/vendor/assets/bower_components/ajax-chosen/lib/ajax-chosen.js +159 -0
- data/vendor/assets/bower_components/ajax-chosen/lib/ajax-chosen.min.js +17 -0
- data/vendor/assets/bower_components/ajax-chosen/package.json +18 -0
- data/vendor/assets/bower_components/ajax-chosen/src/ajax-chosen.coffee +183 -0
- data/vendor/assets/bower_components/bootstrap-chosen/README.md +29 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen-variables.less +24 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen-variables.scss +16 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen.less +473 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen.scss +459 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bower.json +25 -0
- data/vendor/assets/bower_components/bootstrap-chosen/chosen-sprite.png +0 -0
- data/vendor/assets/bower_components/bootstrap-chosen/chosen-sprite@2x.png +0 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/README.md +200 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/bower.json +20 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker-bs2.css +303 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker-bs3.css +335 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker.js +1348 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/examples.html +272 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/package.js +18 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/package.json +32 -0
- data/vendor/assets/bower_components/chosen/bower.json +50 -0
- data/vendor/assets/bower_components/chosen/chosen-sprite.png +0 -0
- data/vendor/assets/bower_components/chosen/chosen-sprite@2x.png +0 -0
- data/vendor/assets/bower_components/chosen/chosen.css +448 -0
- data/vendor/assets/bower_components/chosen/chosen.jquery.js +1272 -0
- data/vendor/assets/bower_components/highlightjs/LICENSE +24 -0
- data/vendor/assets/bower_components/highlightjs/Makefile +21 -0
- data/vendor/assets/bower_components/highlightjs/README.md +12 -0
- data/vendor/assets/bower_components/highlightjs/bower.json +14 -0
- data/vendor/assets/bower_components/highlightjs/component.json +12 -0
- data/vendor/assets/bower_components/highlightjs/composer.json +26 -0
- data/vendor/assets/bower_components/highlightjs/highlight.pack.js +15263 -0
- data/vendor/assets/bower_components/highlightjs/highlight.pack.min.js +12 -0
- data/vendor/assets/bower_components/highlightjs/package.json +8 -0
- data/vendor/assets/bower_components/highlightjs/styles/agate.css +108 -0
- data/vendor/assets/bower_components/highlightjs/styles/androidstudio.css +66 -0
- data/vendor/assets/bower_components/highlightjs/styles/arduino-light.css +88 -0
- data/vendor/assets/bower_components/highlightjs/styles/arta.css +73 -0
- data/vendor/assets/bower_components/highlightjs/styles/ascetic.css +45 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-cave-dark.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-cave-light.css +85 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-cave.dark.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-cave.light.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-dune-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-dune-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-dune.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-dune.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary-dark.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary-light.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary.dark.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary.light.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-forest-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-forest-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-forest.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-forest.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-heath-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-heath-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-heath.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-heath.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau-dark.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau-light.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau.dark.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau.light.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna-dark.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna-light.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna.dark.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna.light.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/brown-paper.css +64 -0
- data/vendor/assets/bower_components/highlightjs/styles/brown-papersq.png +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/brown_paper.css +103 -0
- data/vendor/assets/bower_components/highlightjs/styles/brown_papersq.png +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/codepen-embed.css +60 -0
- data/vendor/assets/bower_components/highlightjs/styles/color-brewer.css +71 -0
- data/vendor/assets/bower_components/highlightjs/styles/dark.css +63 -0
- data/vendor/assets/bower_components/highlightjs/styles/darkula.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/default.css +99 -0
- data/vendor/assets/bower_components/highlightjs/styles/docco.css +97 -0
- data/vendor/assets/bower_components/highlightjs/styles/dracula.css +76 -0
- data/vendor/assets/bower_components/highlightjs/styles/far.css +71 -0
- data/vendor/assets/bower_components/highlightjs/styles/foundation.css +88 -0
- data/vendor/assets/bower_components/highlightjs/styles/github-gist.css +71 -0
- data/vendor/assets/bower_components/highlightjs/styles/github.css +99 -0
- data/vendor/assets/bower_components/highlightjs/styles/googlecode.css +89 -0
- data/vendor/assets/bower_components/highlightjs/styles/grayscale.css +101 -0
- data/vendor/assets/bower_components/highlightjs/styles/gruvbox-dark.css +108 -0
- data/vendor/assets/bower_components/highlightjs/styles/gruvbox-light.css +108 -0
- data/vendor/assets/bower_components/highlightjs/styles/hopscotch.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/hybrid.css +102 -0
- data/vendor/assets/bower_components/highlightjs/styles/idea.css +97 -0
- data/vendor/assets/bower_components/highlightjs/styles/ir-black.css +73 -0
- data/vendor/assets/bower_components/highlightjs/styles/ir_black.css +106 -0
- data/vendor/assets/bower_components/highlightjs/styles/kimbie.dark.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/kimbie.light.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/magula.css +70 -0
- data/vendor/assets/bower_components/highlightjs/styles/mono-blue.css +59 -0
- data/vendor/assets/bower_components/highlightjs/styles/monokai-sublime.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/monokai.css +70 -0
- data/vendor/assets/bower_components/highlightjs/styles/monokai_sublime.css +154 -0
- data/vendor/assets/bower_components/highlightjs/styles/obsidian.css +88 -0
- data/vendor/assets/bower_components/highlightjs/styles/paraiso-dark.css +72 -0
- data/vendor/assets/bower_components/highlightjs/styles/paraiso-light.css +72 -0
- data/vendor/assets/bower_components/highlightjs/styles/paraiso.dark.css +96 -0
- data/vendor/assets/bower_components/highlightjs/styles/paraiso.light.css +96 -0
- data/vendor/assets/bower_components/highlightjs/styles/pojoaque.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/pojoaque.jpg +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/qtcreator_dark.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/qtcreator_light.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/railscasts.css +106 -0
- data/vendor/assets/bower_components/highlightjs/styles/rainbow.css +85 -0
- data/vendor/assets/bower_components/highlightjs/styles/school-book.css +72 -0
- data/vendor/assets/bower_components/highlightjs/styles/school-book.png +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/school_book.css +111 -0
- data/vendor/assets/bower_components/highlightjs/styles/school_book.png +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/solarized-dark.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/solarized-light.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/solarized_dark.css +107 -0
- data/vendor/assets/bower_components/highlightjs/styles/solarized_light.css +107 -0
- data/vendor/assets/bower_components/highlightjs/styles/sunburst.css +102 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-blue.css +75 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-bright.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-eighties.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night.css +75 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow.css +72 -0
- data/vendor/assets/bower_components/highlightjs/styles/vs.css +68 -0
- data/vendor/assets/bower_components/highlightjs/styles/xcode.css +93 -0
- data/vendor/assets/bower_components/highlightjs/styles/zenburn.css +80 -0
- data/vendor/assets/bower_components/jquery.floatThead/CONTRIBUTING.md +33 -0
- data/vendor/assets/bower_components/jquery.floatThead/README.md +285 -0
- data/vendor/assets/bower_components/jquery.floatThead/bower.json +34 -0
- data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead-slim.js +899 -0
- data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead-slim.min.js +3 -0
- data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead.js +964 -0
- data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead.min.js +3 -0
- data/vendor/assets/bower_components/jquery.floatThead/license.txt +21 -0
- data/vendor/assets/bower_components/jquery/AUTHORS.txt +278 -0
- data/vendor/assets/bower_components/jquery/LICENSE.txt +36 -0
- data/vendor/assets/bower_components/jquery/README.md +65 -0
- data/vendor/assets/bower_components/jquery/bower.json +14 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.js +9842 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.min.js +4 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.min.map +1 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.slim.js +7877 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.slim.min.js +4 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.slim.min.map +1 -0
- data/vendor/assets/bower_components/jquery/sizzle/LICENSE.txt +36 -0
- data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.js +2143 -0
- data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.min.js +3 -0
- data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.min.map +1 -0
- data/vendor/assets/bower_components/jquery/src/ajax.js +845 -0
- data/vendor/assets/bower_components/jquery/src/ajax/jsonp.js +100 -0
- data/vendor/assets/bower_components/jquery/src/ajax/load.js +83 -0
- data/vendor/assets/bower_components/jquery/src/ajax/parseJSON.js +13 -0
- data/vendor/assets/bower_components/jquery/src/ajax/parseXML.js +27 -0
- data/vendor/assets/bower_components/jquery/src/ajax/script.js +68 -0
- data/vendor/assets/bower_components/jquery/src/ajax/var/location.js +3 -0
- data/vendor/assets/bower_components/jquery/src/ajax/var/nonce.js +5 -0
- data/vendor/assets/bower_components/jquery/src/ajax/var/rquery.js +3 -0
- data/vendor/assets/bower_components/jquery/src/ajax/xhr.js +167 -0
- data/vendor/assets/bower_components/jquery/src/attributes.js +11 -0
- data/vendor/assets/bower_components/jquery/src/attributes/attr.js +142 -0
- data/vendor/assets/bower_components/jquery/src/attributes/classes.js +177 -0
- data/vendor/assets/bower_components/jquery/src/attributes/prop.js +125 -0
- data/vendor/assets/bower_components/jquery/src/attributes/support.js +36 -0
- data/vendor/assets/bower_components/jquery/src/attributes/val.js +177 -0
- data/vendor/assets/bower_components/jquery/src/callbacks.js +232 -0
- data/vendor/assets/bower_components/jquery/src/core.js +494 -0
- data/vendor/assets/bower_components/jquery/src/core/DOMEval.js +14 -0
- data/vendor/assets/bower_components/jquery/src/core/access.js +65 -0
- data/vendor/assets/bower_components/jquery/src/core/init.js +134 -0
- data/vendor/assets/bower_components/jquery/src/core/parseHTML.js +41 -0
- data/vendor/assets/bower_components/jquery/src/core/ready.js +103 -0
- data/vendor/assets/bower_components/jquery/src/core/support.js +18 -0
- data/vendor/assets/bower_components/jquery/src/core/var/rsingleTag.js +5 -0
- data/vendor/assets/bower_components/jquery/src/css.js +515 -0
- data/vendor/assets/bower_components/jquery/src/css/addGetHookIf.js +24 -0
- data/vendor/assets/bower_components/jquery/src/css/adjustCSS.js +65 -0
- data/vendor/assets/bower_components/jquery/src/css/curCSS.js +60 -0
- data/vendor/assets/bower_components/jquery/src/css/defaultDisplay.js +72 -0
- data/vendor/assets/bower_components/jquery/src/css/hiddenVisibleSelectors.js +18 -0
- data/vendor/assets/bower_components/jquery/src/css/showHide.js +48 -0
- data/vendor/assets/bower_components/jquery/src/css/support.js +121 -0
- data/vendor/assets/bower_components/jquery/src/css/var/cssExpand.js +3 -0
- data/vendor/assets/bower_components/jquery/src/css/var/getStyles.js +15 -0
- data/vendor/assets/bower_components/jquery/src/css/var/isHidden.js +16 -0
- data/vendor/assets/bower_components/jquery/src/css/var/rmargin.js +3 -0
- data/vendor/assets/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/vendor/assets/bower_components/jquery/src/css/var/swap.js +24 -0
- data/vendor/assets/bower_components/jquery/src/data.js +187 -0
- data/vendor/assets/bower_components/jquery/src/data/Data.js +200 -0
- data/vendor/assets/bower_components/jquery/src/data/accepts.js +20 -0
- data/vendor/assets/bower_components/jquery/src/data/support.js +23 -0
- data/vendor/assets/bower_components/jquery/src/data/var/acceptData.js +18 -0
- data/vendor/assets/bower_components/jquery/src/data/var/dataPriv.js +5 -0
- data/vendor/assets/bower_components/jquery/src/data/var/dataUser.js +5 -0
- data/vendor/assets/bower_components/jquery/src/deferred.js +158 -0
- data/vendor/assets/bower_components/jquery/src/deferred/exceptionHook.js +19 -0
- data/vendor/assets/bower_components/jquery/src/deprecated.js +32 -0
- data/vendor/assets/bower_components/jquery/src/dimensions.js +54 -0
- data/vendor/assets/bower_components/jquery/src/effects.js +629 -0
- data/vendor/assets/bower_components/jquery/src/effects/Tween.js +121 -0
- data/vendor/assets/bower_components/jquery/src/effects/animatedSelector.js +13 -0
- data/vendor/assets/bower_components/jquery/src/effects/support.js +58 -0
- data/vendor/assets/bower_components/jquery/src/event.js +710 -0
- data/vendor/assets/bower_components/jquery/src/event/ajax.js +20 -0
- data/vendor/assets/bower_components/jquery/src/event/alias.js +27 -0
- data/vendor/assets/bower_components/jquery/src/event/focusin.js +53 -0
- data/vendor/assets/bower_components/jquery/src/event/support.js +9 -0
- data/vendor/assets/bower_components/jquery/src/event/trigger.js +199 -0
- data/vendor/assets/bower_components/jquery/src/exports/amd.js +24 -0
- data/vendor/assets/bower_components/jquery/src/exports/global.js +26 -0
- data/vendor/assets/bower_components/jquery/src/intro.js +44 -0
- data/vendor/assets/bower_components/jquery/src/jquery.js +37 -0
- data/vendor/assets/bower_components/jquery/src/manipulation.js +481 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/_evalUrl.js +20 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/buildFragment.js +102 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/createSafeFragment.js +20 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/getAll.js +21 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/setGlobalEval.js +20 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/support.js +33 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/nodeNames.js +5 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/rtagName.js +3 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/wrapMap.js +27 -0
- data/vendor/assets/bower_components/jquery/src/offset.js +218 -0
- data/vendor/assets/bower_components/jquery/src/outro.js +2 -0
- data/vendor/assets/bower_components/jquery/src/queue.js +143 -0
- data/vendor/assets/bower_components/jquery/src/queue/delay.js +22 -0
- data/vendor/assets/bower_components/jquery/src/selector-native.js +211 -0
- data/vendor/assets/bower_components/jquery/src/selector-sizzle.js +14 -0
- data/vendor/assets/bower_components/jquery/src/selector.js +1 -0
- data/vendor/assets/bower_components/jquery/src/serialize.js +125 -0
- data/vendor/assets/bower_components/jquery/src/support.js +63 -0
- data/vendor/assets/bower_components/jquery/src/traversing.js +175 -0
- data/vendor/assets/bower_components/jquery/src/traversing/findFilter.js +100 -0
- data/vendor/assets/bower_components/jquery/src/traversing/var/dir.js +20 -0
- data/vendor/assets/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/vendor/assets/bower_components/jquery/src/traversing/var/siblings.js +15 -0
- data/vendor/assets/bower_components/jquery/src/var/arr.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/class2type.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/concat.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/deletedIds.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/document.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/documentElement.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/hasOwn.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/indexOf.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/pnum.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/push.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/rcssNum.js +7 -0
- data/vendor/assets/bower_components/jquery/src/var/rnotwhite.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/slice.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/support.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/toString.js +5 -0
- data/vendor/assets/bower_components/jquery/src/wrap.js +79 -0
- data/vendor/assets/bower_components/marked/Gulpfile.js +22 -0
- data/vendor/assets/bower_components/marked/LICENSE +19 -0
- data/vendor/assets/bower_components/marked/Makefile +12 -0
- data/vendor/assets/bower_components/marked/README.md +406 -0
- data/vendor/assets/bower_components/marked/bin/marked +187 -0
- data/vendor/assets/bower_components/marked/bower.json +24 -0
- data/vendor/assets/bower_components/marked/component.json +10 -0
- data/vendor/assets/bower_components/marked/doc/broken.md +426 -0
- data/vendor/assets/bower_components/marked/doc/todo.md +2 -0
- data/vendor/assets/bower_components/marked/index.js +1 -0
- data/vendor/assets/bower_components/marked/lib/marked.js +1285 -0
- data/vendor/assets/bower_components/marked/man/marked.1 +91 -0
- data/vendor/assets/bower_components/marked/marked.min.js +6 -0
- data/vendor/assets/bower_components/marked/package.json +24 -0
- data/vendor/assets/bower_components/moment/CHANGELOG.md +423 -0
- data/vendor/assets/bower_components/moment/LICENSE +22 -0
- data/vendor/assets/bower_components/moment/Moment.js.nuspec +28 -0
- data/vendor/assets/bower_components/moment/README.md +39 -0
- data/vendor/assets/bower_components/moment/benchmarks/clone.js +10 -0
- data/vendor/assets/bower_components/moment/bower.json +20 -0
- data/vendor/assets/bower_components/moment/locale/af.js +71 -0
- data/vendor/assets/bower_components/moment/locale/ar-ma.js +57 -0
- data/vendor/assets/bower_components/moment/locale/ar-sa.js +101 -0
- data/vendor/assets/bower_components/moment/locale/ar-tn.js +55 -0
- data/vendor/assets/bower_components/moment/locale/ar.js +134 -0
- data/vendor/assets/bower_components/moment/locale/az.js +107 -0
- data/vendor/assets/bower_components/moment/locale/be.js +154 -0
- data/vendor/assets/bower_components/moment/locale/bg.js +88 -0
- data/vendor/assets/bower_components/moment/locale/bn.js +111 -0
- data/vendor/assets/bower_components/moment/locale/bo.js +108 -0
- data/vendor/assets/bower_components/moment/locale/br.js +109 -0
- data/vendor/assets/bower_components/moment/locale/bs.js +140 -0
- data/vendor/assets/bower_components/moment/locale/ca.js +77 -0
- data/vendor/assets/bower_components/moment/locale/cs.js +157 -0
- data/vendor/assets/bower_components/moment/locale/cv.js +61 -0
- data/vendor/assets/bower_components/moment/locale/cy.js +79 -0
- data/vendor/assets/bower_components/moment/locale/da.js +58 -0
- data/vendor/assets/bower_components/moment/locale/de-at.js +74 -0
- data/vendor/assets/bower_components/moment/locale/de.js +73 -0
- data/vendor/assets/bower_components/moment/locale/el.js +94 -0
- data/vendor/assets/bower_components/moment/locale/en-au.js +64 -0
- data/vendor/assets/bower_components/moment/locale/en-ca.js +61 -0
- data/vendor/assets/bower_components/moment/locale/en-gb.js +65 -0
- data/vendor/assets/bower_components/moment/locale/eo.js +71 -0
- data/vendor/assets/bower_components/moment/locale/es.js +77 -0
- data/vendor/assets/bower_components/moment/locale/et.js +78 -0
- data/vendor/assets/bower_components/moment/locale/eu.js +62 -0
- data/vendor/assets/bower_components/moment/locale/fa.js +103 -0
- data/vendor/assets/bower_components/moment/locale/fi.js +107 -0
- data/vendor/assets/bower_components/moment/locale/fo.js +58 -0
- data/vendor/assets/bower_components/moment/locale/fr-ca.js +56 -0
- data/vendor/assets/bower_components/moment/locale/fr.js +60 -0
- data/vendor/assets/bower_components/moment/locale/fy.js +69 -0
- data/vendor/assets/bower_components/moment/locale/gl.js +73 -0
- data/vendor/assets/bower_components/moment/locale/he.js +80 -0
- data/vendor/assets/bower_components/moment/locale/hi.js +121 -0
- data/vendor/assets/bower_components/moment/locale/hr.js +141 -0
- data/vendor/assets/bower_components/moment/locale/hu.js +111 -0
- data/vendor/assets/bower_components/moment/locale/hy-am.js +118 -0
- data/vendor/assets/bower_components/moment/locale/id.js +81 -0
- data/vendor/assets/bower_components/moment/locale/is.js +126 -0
- data/vendor/assets/bower_components/moment/locale/it.js +68 -0
- data/vendor/assets/bower_components/moment/locale/ja.js +63 -0
- data/vendor/assets/bower_components/moment/locale/ka.js +109 -0
- data/vendor/assets/bower_components/moment/locale/km.js +56 -0
- data/vendor/assets/bower_components/moment/locale/ko.js +65 -0
- data/vendor/assets/bower_components/moment/locale/lb.js +139 -0
- data/vendor/assets/bower_components/moment/locale/lt.js +120 -0
- data/vendor/assets/bower_components/moment/locale/lv.js +79 -0
- data/vendor/assets/bower_components/moment/locale/mk.js +88 -0
- data/vendor/assets/bower_components/moment/locale/ml.js +69 -0
- data/vendor/assets/bower_components/moment/locale/mr.js +120 -0
- data/vendor/assets/bower_components/moment/locale/ms-my.js +80 -0
- data/vendor/assets/bower_components/moment/locale/my.js +89 -0
- data/vendor/assets/bower_components/moment/locale/nb.js +59 -0
- data/vendor/assets/bower_components/moment/locale/ne.js +121 -0
- data/vendor/assets/bower_components/moment/locale/nl.js +69 -0
- data/vendor/assets/bower_components/moment/locale/nn.js +58 -0
- data/vendor/assets/bower_components/moment/locale/pl.js +100 -0
- data/vendor/assets/bower_components/moment/locale/pt-br.js +58 -0
- data/vendor/assets/bower_components/moment/locale/pt.js +62 -0
- data/vendor/assets/bower_components/moment/locale/ro.js +73 -0
- data/vendor/assets/bower_components/moment/locale/ru.js +176 -0
- data/vendor/assets/bower_components/moment/locale/sk.js +158 -0
- data/vendor/assets/bower_components/moment/locale/sl.js +146 -0
- data/vendor/assets/bower_components/moment/locale/sq.js +67 -0
- data/vendor/assets/bower_components/moment/locale/sr-cyrl.js +107 -0
- data/vendor/assets/bower_components/moment/locale/sr.js +107 -0
- data/vendor/assets/bower_components/moment/locale/sv.js +65 -0
- data/vendor/assets/bower_components/moment/locale/ta.js +130 -0
- data/vendor/assets/bower_components/moment/locale/th.js +63 -0
- data/vendor/assets/bower_components/moment/locale/tl-ph.js +60 -0
- data/vendor/assets/bower_components/moment/locale/tr.js +94 -0
- data/vendor/assets/bower_components/moment/locale/tzm-latn.js +56 -0
- data/vendor/assets/bower_components/moment/locale/tzm.js +56 -0
- data/vendor/assets/bower_components/moment/locale/uk.js +163 -0
- data/vendor/assets/bower_components/moment/locale/uz.js +56 -0
- data/vendor/assets/bower_components/moment/locale/vi.js +64 -0
- data/vendor/assets/bower_components/moment/locale/zh-cn.js +125 -0
- data/vendor/assets/bower_components/moment/locale/zh-tw.js +99 -0
- data/vendor/assets/bower_components/moment/meteor/README.md +25 -0
- data/vendor/assets/bower_components/moment/meteor/export.js +3 -0
- data/vendor/assets/bower_components/moment/meteor/test.js +5 -0
- data/vendor/assets/bower_components/moment/min/locales.js +7306 -0
- data/vendor/assets/bower_components/moment/min/locales.min.js +4 -0
- data/vendor/assets/bower_components/moment/min/moment-with-locales.js +9792 -0
- data/vendor/assets/bower_components/moment/min/moment-with-locales.min.js +10 -0
- data/vendor/assets/bower_components/moment/min/moment.min.js +7 -0
- data/vendor/assets/bower_components/moment/moment.js +3043 -0
- data/vendor/assets/bower_components/moment/scripts/npm_prepublish.sh +43 -0
- data/vendor/assets/bower_components/underscore/LICENSE +23 -0
- data/vendor/assets/bower_components/underscore/README.md +22 -0
- data/vendor/assets/bower_components/underscore/bower.json +7 -0
- data/vendor/assets/bower_components/underscore/underscore-min.js +6 -0
- data/vendor/assets/bower_components/underscore/underscore-min.map +1 -0
- data/vendor/assets/bower_components/underscore/underscore.js +1548 -0
- metadata +782 -0
@@ -0,0 +1,79 @@
|
|
1
|
+
define( [
|
2
|
+
"./core",
|
3
|
+
"./core/init",
|
4
|
+
"./manipulation", // clone
|
5
|
+
"./traversing" // parent, contents
|
6
|
+
], function( jQuery ) {
|
7
|
+
|
8
|
+
jQuery.fn.extend( {
|
9
|
+
wrapAll: function( html ) {
|
10
|
+
var wrap;
|
11
|
+
|
12
|
+
if ( jQuery.isFunction( html ) ) {
|
13
|
+
return this.each( function( i ) {
|
14
|
+
jQuery( this ).wrapAll( html.call( this, i ) );
|
15
|
+
} );
|
16
|
+
}
|
17
|
+
|
18
|
+
if ( this[ 0 ] ) {
|
19
|
+
|
20
|
+
// The elements to wrap the target around
|
21
|
+
wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
|
22
|
+
|
23
|
+
if ( this[ 0 ].parentNode ) {
|
24
|
+
wrap.insertBefore( this[ 0 ] );
|
25
|
+
}
|
26
|
+
|
27
|
+
wrap.map( function() {
|
28
|
+
var elem = this;
|
29
|
+
|
30
|
+
while ( elem.firstElementChild ) {
|
31
|
+
elem = elem.firstElementChild;
|
32
|
+
}
|
33
|
+
|
34
|
+
return elem;
|
35
|
+
} ).append( this );
|
36
|
+
}
|
37
|
+
|
38
|
+
return this;
|
39
|
+
},
|
40
|
+
|
41
|
+
wrapInner: function( html ) {
|
42
|
+
if ( jQuery.isFunction( html ) ) {
|
43
|
+
return this.each( function( i ) {
|
44
|
+
jQuery( this ).wrapInner( html.call( this, i ) );
|
45
|
+
} );
|
46
|
+
}
|
47
|
+
|
48
|
+
return this.each( function() {
|
49
|
+
var self = jQuery( this ),
|
50
|
+
contents = self.contents();
|
51
|
+
|
52
|
+
if ( contents.length ) {
|
53
|
+
contents.wrapAll( html );
|
54
|
+
|
55
|
+
} else {
|
56
|
+
self.append( html );
|
57
|
+
}
|
58
|
+
} );
|
59
|
+
},
|
60
|
+
|
61
|
+
wrap: function( html ) {
|
62
|
+
var isFunction = jQuery.isFunction( html );
|
63
|
+
|
64
|
+
return this.each( function( i ) {
|
65
|
+
jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
|
66
|
+
} );
|
67
|
+
},
|
68
|
+
|
69
|
+
unwrap: function() {
|
70
|
+
return this.parent().each( function() {
|
71
|
+
if ( !jQuery.nodeName( this, "body" ) ) {
|
72
|
+
jQuery( this ).replaceWith( this.childNodes );
|
73
|
+
}
|
74
|
+
} ).end();
|
75
|
+
}
|
76
|
+
} );
|
77
|
+
|
78
|
+
return jQuery;
|
79
|
+
} );
|
@@ -0,0 +1,22 @@
|
|
1
|
+
var gulp = require('gulp');
|
2
|
+
var uglify = require('gulp-uglify');
|
3
|
+
var concat = require('gulp-concat');
|
4
|
+
|
5
|
+
var preserveFirstComment = function() {
|
6
|
+
var set = false;
|
7
|
+
|
8
|
+
return function() {
|
9
|
+
if (set) return false;
|
10
|
+
set = true;
|
11
|
+
return true;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
|
15
|
+
gulp.task('uglify', function() {
|
16
|
+
gulp.src('lib/marked.js')
|
17
|
+
.pipe(uglify({preserveComments: preserveFirstComment()}))
|
18
|
+
.pipe(concat('marked.min.js'))
|
19
|
+
.pipe(gulp.dest('.'));
|
20
|
+
});
|
21
|
+
|
22
|
+
gulp.task('default', ['uglify']);
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)
|
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,406 @@
|
|
1
|
+
# marked
|
2
|
+
|
3
|
+
> A full-featured markdown parser and compiler, written in JavaScript. Built
|
4
|
+
> for speed.
|
5
|
+
|
6
|
+
[![NPM version](https://badge.fury.io/js/marked.png)][badge]
|
7
|
+
|
8
|
+
## Install
|
9
|
+
|
10
|
+
``` bash
|
11
|
+
npm install marked --save
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
Minimal usage:
|
17
|
+
|
18
|
+
```js
|
19
|
+
var marked = require('marked');
|
20
|
+
console.log(marked('I am using __markdown__.'));
|
21
|
+
// Outputs: <p>I am using <strong>markdown</strong>.</p>
|
22
|
+
```
|
23
|
+
|
24
|
+
Example setting options with default values:
|
25
|
+
|
26
|
+
```js
|
27
|
+
var marked = require('marked');
|
28
|
+
marked.setOptions({
|
29
|
+
renderer: new marked.Renderer(),
|
30
|
+
gfm: true,
|
31
|
+
tables: true,
|
32
|
+
breaks: false,
|
33
|
+
pedantic: false,
|
34
|
+
sanitize: true,
|
35
|
+
smartLists: true,
|
36
|
+
smartypants: false
|
37
|
+
});
|
38
|
+
|
39
|
+
console.log(marked('I am using __markdown__.'));
|
40
|
+
```
|
41
|
+
|
42
|
+
### Browser
|
43
|
+
|
44
|
+
```html
|
45
|
+
<!doctype html>
|
46
|
+
<html>
|
47
|
+
<head>
|
48
|
+
<meta charset="utf-8"/>
|
49
|
+
<title>Marked in the browser</title>
|
50
|
+
<script src="lib/marked.js"></script>
|
51
|
+
</head>
|
52
|
+
<body>
|
53
|
+
<div id="content"></div>
|
54
|
+
<script>
|
55
|
+
document.getElementById('content').innerHTML =
|
56
|
+
marked('# Marked in browser\n\nRendered by **marked**.');
|
57
|
+
</script>
|
58
|
+
</body>
|
59
|
+
</html>
|
60
|
+
```
|
61
|
+
|
62
|
+
## marked(markdownString [,options] [,callback])
|
63
|
+
|
64
|
+
### markdownString
|
65
|
+
|
66
|
+
Type: `string`
|
67
|
+
|
68
|
+
String of markdown source to be compiled.
|
69
|
+
|
70
|
+
### options
|
71
|
+
|
72
|
+
Type: `object`
|
73
|
+
|
74
|
+
Hash of options. Can also be set using the `marked.setOptions` method as seen
|
75
|
+
above.
|
76
|
+
|
77
|
+
### callback
|
78
|
+
|
79
|
+
Type: `function`
|
80
|
+
|
81
|
+
Function called when the `markdownString` has been fully parsed when using
|
82
|
+
async highlighting. If the `options` argument is omitted, this can be used as
|
83
|
+
the second argument.
|
84
|
+
|
85
|
+
## Options
|
86
|
+
|
87
|
+
### highlight
|
88
|
+
|
89
|
+
Type: `function`
|
90
|
+
|
91
|
+
A function to highlight code blocks. The first example below uses async highlighting with
|
92
|
+
[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using
|
93
|
+
[highlight.js][highlight]:
|
94
|
+
|
95
|
+
```js
|
96
|
+
var marked = require('marked');
|
97
|
+
|
98
|
+
var markdownString = '```js\n console.log("hello"); \n```';
|
99
|
+
|
100
|
+
// Async highlighting with pygmentize-bundled
|
101
|
+
marked.setOptions({
|
102
|
+
highlight: function (code, lang, callback) {
|
103
|
+
require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) {
|
104
|
+
callback(err, result.toString());
|
105
|
+
});
|
106
|
+
}
|
107
|
+
});
|
108
|
+
|
109
|
+
// Using async version of marked
|
110
|
+
marked(markdownString, function (err, content) {
|
111
|
+
if (err) throw err;
|
112
|
+
console.log(content);
|
113
|
+
});
|
114
|
+
|
115
|
+
// Synchronous highlighting with highlight.js
|
116
|
+
marked.setOptions({
|
117
|
+
highlight: function (code) {
|
118
|
+
return require('highlight.js').highlightAuto(code).value;
|
119
|
+
}
|
120
|
+
});
|
121
|
+
|
122
|
+
console.log(marked(markdownString));
|
123
|
+
```
|
124
|
+
|
125
|
+
#### highlight arguments
|
126
|
+
|
127
|
+
`code`
|
128
|
+
|
129
|
+
Type: `string`
|
130
|
+
|
131
|
+
The section of code to pass to the highlighter.
|
132
|
+
|
133
|
+
`lang`
|
134
|
+
|
135
|
+
Type: `string`
|
136
|
+
|
137
|
+
The programming language specified in the code block.
|
138
|
+
|
139
|
+
`callback`
|
140
|
+
|
141
|
+
Type: `function`
|
142
|
+
|
143
|
+
The callback function to call when using an async highlighter.
|
144
|
+
|
145
|
+
### renderer
|
146
|
+
|
147
|
+
Type: `object`
|
148
|
+
Default: `new Renderer()`
|
149
|
+
|
150
|
+
An object containing functions to render tokens to HTML.
|
151
|
+
|
152
|
+
#### Overriding renderer methods
|
153
|
+
|
154
|
+
The renderer option allows you to render tokens in a custom manner. Here is an
|
155
|
+
example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub:
|
156
|
+
|
157
|
+
```javascript
|
158
|
+
var marked = require('marked');
|
159
|
+
var renderer = new marked.Renderer();
|
160
|
+
|
161
|
+
renderer.heading = function (text, level) {
|
162
|
+
var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-');
|
163
|
+
|
164
|
+
return '<h' + level + '><a name="' +
|
165
|
+
escapedText +
|
166
|
+
'" class="anchor" href="#' +
|
167
|
+
escapedText +
|
168
|
+
'"><span class="header-link"></span></a>' +
|
169
|
+
text + '</h' + level + '>';
|
170
|
+
},
|
171
|
+
|
172
|
+
console.log(marked('# heading+', { renderer: renderer }));
|
173
|
+
```
|
174
|
+
This code will output the following HTML:
|
175
|
+
```html
|
176
|
+
<h1>
|
177
|
+
<a name="heading-" class="anchor" href="#heading-">
|
178
|
+
<span class="header-link"></span>
|
179
|
+
</a>
|
180
|
+
heading+
|
181
|
+
</h1>
|
182
|
+
```
|
183
|
+
|
184
|
+
#### Block level renderer methods
|
185
|
+
|
186
|
+
- code(*string* code, *string* language)
|
187
|
+
- blockquote(*string* quote)
|
188
|
+
- html(*string* html)
|
189
|
+
- heading(*string* text, *number* level)
|
190
|
+
- hr()
|
191
|
+
- list(*string* body, *boolean* ordered)
|
192
|
+
- listitem(*string* text)
|
193
|
+
- paragraph(*string* text)
|
194
|
+
- table(*string* header, *string* body)
|
195
|
+
- tablerow(*string* content)
|
196
|
+
- tablecell(*string* content, *object* flags)
|
197
|
+
|
198
|
+
`flags` has the following properties:
|
199
|
+
|
200
|
+
```js
|
201
|
+
{
|
202
|
+
header: true || false,
|
203
|
+
align: 'center' || 'left' || 'right'
|
204
|
+
}
|
205
|
+
```
|
206
|
+
|
207
|
+
#### Inline level renderer methods
|
208
|
+
|
209
|
+
- strong(*string* text)
|
210
|
+
- em(*string* text)
|
211
|
+
- codespan(*string* code)
|
212
|
+
- br()
|
213
|
+
- del(*string* text)
|
214
|
+
- link(*string* href, *string* title, *string* text)
|
215
|
+
- image(*string* href, *string* title, *string* text)
|
216
|
+
|
217
|
+
### gfm
|
218
|
+
|
219
|
+
Type: `boolean`
|
220
|
+
Default: `true`
|
221
|
+
|
222
|
+
Enable [GitHub flavored markdown][gfm].
|
223
|
+
|
224
|
+
### tables
|
225
|
+
|
226
|
+
Type: `boolean`
|
227
|
+
Default: `true`
|
228
|
+
|
229
|
+
Enable GFM [tables][tables].
|
230
|
+
This option requires the `gfm` option to be true.
|
231
|
+
|
232
|
+
### breaks
|
233
|
+
|
234
|
+
Type: `boolean`
|
235
|
+
Default: `false`
|
236
|
+
|
237
|
+
Enable GFM [line breaks][breaks].
|
238
|
+
This option requires the `gfm` option to be true.
|
239
|
+
|
240
|
+
### pedantic
|
241
|
+
|
242
|
+
Type: `boolean`
|
243
|
+
Default: `false`
|
244
|
+
|
245
|
+
Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of
|
246
|
+
the original markdown bugs or poor behavior.
|
247
|
+
|
248
|
+
### sanitize
|
249
|
+
|
250
|
+
Type: `boolean`
|
251
|
+
Default: `false`
|
252
|
+
|
253
|
+
Sanitize the output. Ignore any HTML that has been input.
|
254
|
+
|
255
|
+
### smartLists
|
256
|
+
|
257
|
+
Type: `boolean`
|
258
|
+
Default: `true`
|
259
|
+
|
260
|
+
Use smarter list behavior than the original markdown. May eventually be
|
261
|
+
default with the old behavior moved into `pedantic`.
|
262
|
+
|
263
|
+
### smartypants
|
264
|
+
|
265
|
+
Type: `boolean`
|
266
|
+
Default: `false`
|
267
|
+
|
268
|
+
Use "smart" typograhic punctuation for things like quotes and dashes.
|
269
|
+
|
270
|
+
## Access to lexer and parser
|
271
|
+
|
272
|
+
You also have direct access to the lexer and parser if you so desire.
|
273
|
+
|
274
|
+
``` js
|
275
|
+
var tokens = marked.lexer(text, options);
|
276
|
+
console.log(marked.parser(tokens));
|
277
|
+
```
|
278
|
+
|
279
|
+
``` js
|
280
|
+
var lexer = new marked.Lexer(options);
|
281
|
+
var tokens = lexer.lex(text);
|
282
|
+
console.log(tokens);
|
283
|
+
console.log(lexer.rules);
|
284
|
+
```
|
285
|
+
|
286
|
+
## CLI
|
287
|
+
|
288
|
+
``` bash
|
289
|
+
$ marked -o hello.html
|
290
|
+
hello world
|
291
|
+
^D
|
292
|
+
$ cat hello.html
|
293
|
+
<p>hello world</p>
|
294
|
+
```
|
295
|
+
|
296
|
+
## Philosophy behind marked
|
297
|
+
|
298
|
+
The point of marked was to create a markdown compiler where it was possible to
|
299
|
+
frequently parse huge chunks of markdown without having to worry about
|
300
|
+
caching the compiled output somehow...or blocking for an unnecesarily long time.
|
301
|
+
|
302
|
+
marked is very concise and still implements all markdown features. It is also
|
303
|
+
now fully compatible with the client-side.
|
304
|
+
|
305
|
+
marked more or less passes the official markdown test suite in its
|
306
|
+
entirety. This is important because a surprising number of markdown compilers
|
307
|
+
cannot pass more than a few tests. It was very difficult to get marked as
|
308
|
+
compliant as it is. It could have cut corners in several areas for the sake
|
309
|
+
of performance, but did not in order to be exactly what you expect in terms
|
310
|
+
of a markdown rendering. In fact, this is why marked could be considered at a
|
311
|
+
disadvantage in the benchmarks above.
|
312
|
+
|
313
|
+
Along with implementing every markdown feature, marked also implements [GFM
|
314
|
+
features][gfmf].
|
315
|
+
|
316
|
+
## Benchmarks
|
317
|
+
|
318
|
+
node v0.8.x
|
319
|
+
|
320
|
+
``` bash
|
321
|
+
$ node test --bench
|
322
|
+
marked completed in 3411ms.
|
323
|
+
marked (gfm) completed in 3727ms.
|
324
|
+
marked (pedantic) completed in 3201ms.
|
325
|
+
robotskirt completed in 808ms.
|
326
|
+
showdown (reuse converter) completed in 11954ms.
|
327
|
+
showdown (new converter) completed in 17774ms.
|
328
|
+
markdown-js completed in 17191ms.
|
329
|
+
```
|
330
|
+
|
331
|
+
__Marked is now faster than Discount, which is written in C.__
|
332
|
+
|
333
|
+
For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects.
|
334
|
+
|
335
|
+
### Pro level
|
336
|
+
|
337
|
+
You also have direct access to the lexer and parser if you so desire.
|
338
|
+
|
339
|
+
``` js
|
340
|
+
var tokens = marked.lexer(text, options);
|
341
|
+
console.log(marked.parser(tokens));
|
342
|
+
```
|
343
|
+
|
344
|
+
``` js
|
345
|
+
var lexer = new marked.Lexer(options);
|
346
|
+
var tokens = lexer.lex(text);
|
347
|
+
console.log(tokens);
|
348
|
+
console.log(lexer.rules);
|
349
|
+
```
|
350
|
+
|
351
|
+
``` bash
|
352
|
+
$ node
|
353
|
+
> require('marked').lexer('> i am using marked.')
|
354
|
+
[ { type: 'blockquote_start' },
|
355
|
+
{ type: 'paragraph',
|
356
|
+
text: 'i am using marked.' },
|
357
|
+
{ type: 'blockquote_end' },
|
358
|
+
links: {} ]
|
359
|
+
```
|
360
|
+
|
361
|
+
## Running Tests & Contributing
|
362
|
+
|
363
|
+
If you want to submit a pull request, make sure your changes pass the test
|
364
|
+
suite. If you're adding a new feature, be sure to add your own test.
|
365
|
+
|
366
|
+
The marked test suite is set up slightly strangely: `test/new` is for all tests
|
367
|
+
that are not part of the original markdown.pl test suite (this is where your
|
368
|
+
test should go if you make one). `test/original` is only for the original
|
369
|
+
markdown.pl tests. `test/tests` houses both types of tests after they have been
|
370
|
+
combined and moved/generated by running `node test --fix` or `marked --test
|
371
|
+
--fix`.
|
372
|
+
|
373
|
+
In other words, if you have a test to add, add it to `test/new/` and then
|
374
|
+
regenerate the tests with `node test --fix`. Commit the result. If your test
|
375
|
+
uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you
|
376
|
+
can add `.nogfm` to the filename. So, `my-test.text` becomes
|
377
|
+
`my-test.nogfm.text`. You can do this with any marked option. Say you want
|
378
|
+
line breaks and smartypants enabled, your filename should be:
|
379
|
+
`my-test.breaks.smartypants.text`.
|
380
|
+
|
381
|
+
To run the tests:
|
382
|
+
|
383
|
+
``` bash
|
384
|
+
cd marked/
|
385
|
+
node test
|
386
|
+
```
|
387
|
+
|
388
|
+
### Contribution and License Agreement
|
389
|
+
|
390
|
+
If you contribute code to this project, you are implicitly allowing your code
|
391
|
+
to be distributed under the MIT license. You are also implicitly verifying that
|
392
|
+
all code is your original work. `</legalese>`
|
393
|
+
|
394
|
+
## License
|
395
|
+
|
396
|
+
Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License)
|
397
|
+
|
398
|
+
See LICENSE for more info.
|
399
|
+
|
400
|
+
[gfm]: https://help.github.com/articles/github-flavored-markdown
|
401
|
+
[gfmf]: http://github.github.com/github-flavored-markdown/
|
402
|
+
[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled
|
403
|
+
[highlight]: https://github.com/isagalaev/highlight.js
|
404
|
+
[badge]: http://badge.fury.io/js/marked
|
405
|
+
[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables
|
406
|
+
[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines
|