gollum 2.4.11 → 2.4.12
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gollum might be problematic. Click here for more details.
- checksums.yaml +15 -0
- data/Gemfile +1 -1
- data/HISTORY.md +4 -0
- data/README.md +205 -110
- data/bin/gollum +6 -1
- data/gollum.gemspec +491 -516
- data/lib/gollum.rb +3 -14
- data/lib/gollum/{frontend/app.rb → app.rb} +64 -22
- data/lib/gollum/{frontend/helpers.rb → helpers.rb} +6 -6
- data/lib/gollum/{frontend/public → public}/gollum/css/_styles.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/css/dialog.css +12 -2
- data/lib/gollum/{frontend/public → public}/gollum/css/editor.css +1 -1
- data/lib/gollum/{frontend/public → public}/gollum/css/gollum.css +26 -10
- data/lib/gollum/{frontend/public → public}/gollum/css/ie7.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/css/template.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/dirty-shade.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/fileview/document.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/fileview/folder-horizontal.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/fileview/toggle-small-expand.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/fileview/toggle-small.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/icon-sprite.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/man_24.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/para.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/pin-16.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/pin-20.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/pin-24.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/images/pin-32.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/editor/gollum.editor.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/editor/langs/asciidoc.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/editor/langs/creole.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/editor/langs/markdown.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/editor/langs/org.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/editor/langs/pod.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/editor/langs/rdoc.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/editor/langs/textile.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/gollum.dialog.js +4 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/gollum.js +83 -19
- data/lib/gollum/{frontend/public → public}/gollum/javascript/gollum.placeholder.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/identicon_canvas.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/jquery-1.7.2.min.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/jquery.color.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/javascript/mousetrap.min.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/css/custom.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/images/cancel_24.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/images/globe_24.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/images/lr_24.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/images/save_24.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/images/savecomment_24.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/index.html +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/ace.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/anchor.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/anchor_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/config.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/config_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/css/editor.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/document.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/document_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/edit_session.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/editor.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/ext/static.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/layer/marker.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/layer/text.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/dom.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/event.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/keys.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/lang.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/net.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/oop.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/abap.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/css.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/dart.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/diff.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/glsl.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/golang.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/haml.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/html.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/jade.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/java.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/json.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/jsp.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/latex.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/less.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/lisp.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/lua.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/lucene.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/makefile.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/perl.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/php.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/python.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/r.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/scad.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/scala.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/scss.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/sh.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/sql.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/stylus.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/svg.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/tcl.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/tex.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/text.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/textile.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/typescript.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xml.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xquery/JSONParseTreeHandler.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/model/editor.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/multi_select.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/placeholder.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/range.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/range_list.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/range_list_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/range_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/renderloop.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/scrollbar.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/search.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/search_highlight.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/search_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/selection.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/selection_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/split.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/all.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/assertions.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/mockdom.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/test/tests.html +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/github.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/github.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/xcode.css +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/theme/xcode.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/token_iterator.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/tokenizer.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/undomanager.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/unicode.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/worker/worker.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/livepreview.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/md_sundown.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/requirejs.min.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/js/sundown.js +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/ace/LICENSE.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/gollum/LICENSE.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/licenses.txt +13 -13
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/notepages/LICENSE.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/requirejs/LICENSE.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/sizzle/LICENSE.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/sundown/sundown.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/licenses/templarian_windowsicons/license.txt +0 -0
- data/lib/gollum/{frontend/public → public}/gollum/livepreview/readme.md +1 -1
- data/lib/gollum/{frontend/templates → templates}/compare.mustache +0 -0
- data/lib/gollum/{frontend/templates → templates}/create.mustache +1 -1
- data/lib/gollum/{frontend/templates → templates}/edit.mustache +0 -0
- data/lib/gollum/{frontend/templates → templates}/editor.mustache +0 -0
- data/lib/gollum/{frontend/templates → templates}/error.mustache +0 -0
- data/lib/gollum/{frontend/templates → templates}/file_view.mustache +2 -1
- data/lib/gollum/{frontend/templates → templates}/history.mustache +1 -1
- data/lib/gollum/{frontend/templates → templates}/history_authors/gravatar.mustache +0 -0
- data/lib/gollum/{frontend/templates → templates}/history_authors/identicon.mustache +0 -0
- data/lib/gollum/{frontend/templates → templates}/history_authors/none.mustache +0 -0
- data/lib/gollum/{frontend/templates → templates}/layout.mustache +9 -3
- data/lib/gollum/{frontend/templates → templates}/page.mustache +12 -7
- data/lib/gollum/{frontend/templates → templates}/pages.mustache +2 -2
- data/lib/gollum/{frontend/templates → templates}/search.mustache +1 -1
- data/lib/gollum/{frontend/templates → templates}/searchbar.mustache +0 -0
- data/lib/gollum/{frontend/uri_encode_component.rb → uri_encode_component.rb} +0 -0
- data/lib/gollum/{frontend/views → views}/compare.rb +0 -0
- data/lib/gollum/{frontend/views → views}/create.rb +0 -0
- data/lib/gollum/{frontend/views → views}/edit.rb +0 -0
- data/lib/gollum/{frontend/views → views}/editable.rb +2 -2
- data/lib/gollum/{frontend/views → views}/error.rb +0 -0
- data/lib/gollum/{frontend/views → views}/file_view.rb +0 -0
- data/lib/gollum/{frontend/views → views}/has_page.rb +0 -0
- data/lib/gollum/{frontend/views → views}/history.rb +1 -0
- data/lib/gollum/{frontend/views → views}/layout.rb +4 -0
- data/lib/gollum/{frontend/views → views}/page.rb +8 -3
- data/lib/gollum/{frontend/views → views}/pages.rb +0 -0
- data/lib/gollum/{frontend/views → views}/search.rb +0 -0
- data/licenses/licenses.txt +7 -7
- metadata +498 -724
- data/lib/gollum/blob_entry.rb +0 -91
- data/lib/gollum/committer.rb +0 -236
- data/lib/gollum/file.rb +0 -94
- data/lib/gollum/file_view.rb +0 -155
- data/lib/gollum/git_access.rb +0 -249
- data/lib/gollum/gitcode.rb +0 -48
- data/lib/gollum/markup.rb +0 -664
- data/lib/gollum/page.rb +0 -510
- data/lib/gollum/pagination.rb +0 -62
- data/lib/gollum/sanitization.rb +0 -176
- data/lib/gollum/web_sequence_diagram.rb +0 -44
- data/lib/gollum/wiki.rb +0 -762
data/lib/gollum/git_access.rb
DELETED
@@ -1,249 +0,0 @@
|
|
1
|
-
# ~*~ encoding: utf-8 ~*~
|
2
|
-
module Gollum
|
3
|
-
# Controls all access to the Git objects from Gollum. Extend this class to
|
4
|
-
# add custom caching for special cases.
|
5
|
-
class GitAccess
|
6
|
-
# Initializes the GitAccess instance.
|
7
|
-
#
|
8
|
-
# path - The String path to the Git repository that holds the
|
9
|
-
# Gollum site.
|
10
|
-
# page_file_dir - String the directory in which all page files reside
|
11
|
-
#
|
12
|
-
# Returns this instance.
|
13
|
-
def initialize(path, page_file_dir = nil, bare = false)
|
14
|
-
@page_file_dir = page_file_dir
|
15
|
-
@path = path
|
16
|
-
@repo = Grit::Repo.new(path, { :is_bare => bare })
|
17
|
-
clear
|
18
|
-
end
|
19
|
-
|
20
|
-
# Public: Determines whether the Git repository exists on disk.
|
21
|
-
#
|
22
|
-
# Returns true if it exists, or false.
|
23
|
-
def exist?
|
24
|
-
@repo.git.exist?
|
25
|
-
end
|
26
|
-
|
27
|
-
# Public: Converts a given Git reference to a SHA, using the cache if
|
28
|
-
# available.
|
29
|
-
#
|
30
|
-
# ref - a String Git reference (ex: "master")
|
31
|
-
#
|
32
|
-
# Returns a String, or nil if the ref isn't found.
|
33
|
-
def ref_to_sha(ref)
|
34
|
-
ref = ref.to_s
|
35
|
-
return if ref.empty?
|
36
|
-
sha =
|
37
|
-
if sha?(ref)
|
38
|
-
ref
|
39
|
-
else
|
40
|
-
get_cache(:ref, ref) { ref_to_sha!(ref) }
|
41
|
-
end.to_s
|
42
|
-
sha.empty? ? nil : sha
|
43
|
-
end
|
44
|
-
|
45
|
-
# Public: Gets a recursive list of Git blobs for the whole tree at the
|
46
|
-
# given commit.
|
47
|
-
#
|
48
|
-
# ref - A String Git reference or Git SHA to a commit.
|
49
|
-
#
|
50
|
-
# Returns an Array of BlobEntry instances.
|
51
|
-
def tree(ref)
|
52
|
-
if sha = ref_to_sha(ref)
|
53
|
-
get_cache(:tree, sha) { tree!(sha) }
|
54
|
-
else
|
55
|
-
[]
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# Public: Fetches the contents of the Git blob at the given SHA.
|
60
|
-
#
|
61
|
-
# sha - A String Git SHA.
|
62
|
-
#
|
63
|
-
# Returns the String content of the blob.
|
64
|
-
def blob(sha)
|
65
|
-
cat_file!(sha)
|
66
|
-
end
|
67
|
-
|
68
|
-
# Public: Looks up the Git commit using the given Git SHA or ref.
|
69
|
-
#
|
70
|
-
# ref - A String Git SHA or ref.
|
71
|
-
#
|
72
|
-
# Returns a Grit::Commit.
|
73
|
-
def commit(ref)
|
74
|
-
if sha?(ref)
|
75
|
-
get_cache(:commit, ref) { commit!(ref) }
|
76
|
-
else
|
77
|
-
if sha = get_cache(:ref, ref)
|
78
|
-
commit(sha)
|
79
|
-
else
|
80
|
-
if cm = commit!(ref)
|
81
|
-
set_cache(:ref, ref, cm.id)
|
82
|
-
set_cache(:commit, cm.id, cm)
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
# Public: Clears all of the cached data that this GitAccess is tracking.
|
89
|
-
#
|
90
|
-
# Returns nothing.
|
91
|
-
def clear
|
92
|
-
@ref_map = {}
|
93
|
-
@tree_map = {}
|
94
|
-
@commit_map = {}
|
95
|
-
end
|
96
|
-
|
97
|
-
# Public: Refreshes just the cached Git reference data. This should
|
98
|
-
# be called after every Gollum update.
|
99
|
-
#
|
100
|
-
# Returns nothing.
|
101
|
-
def refresh
|
102
|
-
@ref_map.clear
|
103
|
-
end
|
104
|
-
|
105
|
-
#########################################################################
|
106
|
-
#
|
107
|
-
# Internal Methods
|
108
|
-
#
|
109
|
-
#########################################################################
|
110
|
-
|
111
|
-
# Gets the String path to the Git repository.
|
112
|
-
attr_reader :path
|
113
|
-
|
114
|
-
# Gets the Grit::Repo instance for the Git repository.
|
115
|
-
attr_reader :repo
|
116
|
-
|
117
|
-
# Gets a Hash cache of refs to commit SHAs.
|
118
|
-
#
|
119
|
-
# {"master" => "abc123", ...}
|
120
|
-
#
|
121
|
-
attr_reader :ref_map
|
122
|
-
|
123
|
-
# Gets a Hash cache of commit SHAs to a recursive tree of blobs.
|
124
|
-
#
|
125
|
-
# {"abc123" => [<BlobEntry>, <BlobEntry>]}
|
126
|
-
#
|
127
|
-
attr_reader :tree_map
|
128
|
-
|
129
|
-
# Gets a Hash cache of commit SHAs to the Grit::Commit instance.
|
130
|
-
#
|
131
|
-
# {"abcd123" => <Grit::Commit>}
|
132
|
-
#
|
133
|
-
attr_reader :commit_map
|
134
|
-
|
135
|
-
# Checks to see if the given String is a 40 character hex SHA.
|
136
|
-
#
|
137
|
-
# str - Possible String SHA.
|
138
|
-
#
|
139
|
-
# Returns true if the String is a SHA, or false.
|
140
|
-
def sha?(str)
|
141
|
-
!!(str =~ /^[0-9a-f]{40}$/)
|
142
|
-
end
|
143
|
-
|
144
|
-
# Looks up the Git SHA for the given Git ref.
|
145
|
-
#
|
146
|
-
# ref - String Git ref.
|
147
|
-
#
|
148
|
-
# Returns a String SHA.
|
149
|
-
def ref_to_sha!(ref)
|
150
|
-
@repo.git.rev_list({:max_count=>1}, ref)
|
151
|
-
rescue Grit::GitRuby::Repository::NoSuchShaFound
|
152
|
-
end
|
153
|
-
|
154
|
-
# Looks up the Git blobs for a given commit.
|
155
|
-
#
|
156
|
-
# sha - String commit SHA.
|
157
|
-
#
|
158
|
-
# Returns an Array of BlobEntry instances.
|
159
|
-
def tree!(sha)
|
160
|
-
tree = @repo.git.native(:ls_tree,
|
161
|
-
{:r => true, :l => true, :z => true}, sha)
|
162
|
-
if tree.respond_to?(:force_encoding)
|
163
|
-
tree.force_encoding("UTF-8")
|
164
|
-
end
|
165
|
-
items = tree.split("\0").inject([]) do |memo, line|
|
166
|
-
memo << parse_tree_line(line)
|
167
|
-
end
|
168
|
-
|
169
|
-
if dir = @page_file_dir
|
170
|
-
regex = /^#{dir}\//
|
171
|
-
items.select { |i| i.path =~ regex }
|
172
|
-
else
|
173
|
-
items
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
# Reads the content from the Git db at the given SHA.
|
178
|
-
#
|
179
|
-
# sha - The String SHA.
|
180
|
-
#
|
181
|
-
# Returns the String content of the Git object.
|
182
|
-
def cat_file!(sha)
|
183
|
-
@repo.git.cat_file({:p => true}, sha)
|
184
|
-
end
|
185
|
-
|
186
|
-
# Reads a Git commit.
|
187
|
-
#
|
188
|
-
# sha - The string SHA of the Git commit.
|
189
|
-
#
|
190
|
-
# Returns a Grit::Commit.
|
191
|
-
def commit!(sha)
|
192
|
-
@repo.commit(sha)
|
193
|
-
end
|
194
|
-
|
195
|
-
# Attempts to get the given data from a cache. If it doesn't exist, it'll
|
196
|
-
# pass the results of the yielded block to the cache for future accesses.
|
197
|
-
#
|
198
|
-
# name - The cache prefix used in building the full cache key.
|
199
|
-
# key - The unique cache key suffix, usually a String Git SHA.
|
200
|
-
#
|
201
|
-
# Yields a block to pass to the cache.
|
202
|
-
# Returns the cached result.
|
203
|
-
def get_cache(name, key)
|
204
|
-
cache = instance_variable_get("@#{name}_map")
|
205
|
-
value = cache[key]
|
206
|
-
if value.nil? && block_given?
|
207
|
-
set_cache(name, key, value = yield)
|
208
|
-
end
|
209
|
-
value == :_nil ? nil : value
|
210
|
-
end
|
211
|
-
|
212
|
-
# Writes some data to the internal cache.
|
213
|
-
#
|
214
|
-
# name - The cache prefix used in building the full cache key.
|
215
|
-
# key - The unique cache key suffix, usually a String Git SHA.
|
216
|
-
# value - The value to write to the cache.
|
217
|
-
#
|
218
|
-
# Returns nothing.
|
219
|
-
def set_cache(name, key, value)
|
220
|
-
cache = instance_variable_get("@#{name}_map")
|
221
|
-
cache[key] = value || :_nil
|
222
|
-
end
|
223
|
-
|
224
|
-
# Parses a line of output from the `ls-tree` command.
|
225
|
-
#
|
226
|
-
# line - A String line of output:
|
227
|
-
# "100644 blob 839c2291b30495b9a882c17d08254d3c90d8fb53 Home.md"
|
228
|
-
#
|
229
|
-
# Returns an Array of BlobEntry instances.
|
230
|
-
def parse_tree_line(line)
|
231
|
-
mode, type, sha, size, *name = line.split(/\s+/)
|
232
|
-
BlobEntry.new(sha, name.join(' '), size.to_i)
|
233
|
-
end
|
234
|
-
|
235
|
-
# Decode octal sequences (\NNN) in tree path names.
|
236
|
-
#
|
237
|
-
# path - String path name.
|
238
|
-
#
|
239
|
-
# Returns a decoded String.
|
240
|
-
def decode_git_path(path)
|
241
|
-
if path[0] == ?" && path[-1] == ?"
|
242
|
-
path = path[1...-1]
|
243
|
-
path.gsub!(/\\\d{3}/) { |m| m[1..-1].to_i(8).chr }
|
244
|
-
end
|
245
|
-
path.gsub!(/\\[rn"\\]/) { |m| eval(%("#{m.to_s}")) }
|
246
|
-
path
|
247
|
-
end
|
248
|
-
end
|
249
|
-
end
|
data/lib/gollum/gitcode.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# ~*~ encoding: utf-8 ~*~
|
2
|
-
require 'net/http'
|
3
|
-
require 'net/https' # ruby 1.8.7 fix, remove at upgrade
|
4
|
-
require 'uri'
|
5
|
-
require 'open-uri'
|
6
|
-
|
7
|
-
module Gollum
|
8
|
-
class Gitcode
|
9
|
-
def initialize path
|
10
|
-
raise(ArgumentError, 'path is nil or empty') if path.nil? or path.empty?
|
11
|
-
|
12
|
-
@uri = URI::HTTP.build({
|
13
|
-
:path => self.unchomp(path),
|
14
|
-
:host => 'raw.github.com',
|
15
|
-
:scheme => 'https',
|
16
|
-
:port => 443 })
|
17
|
-
end
|
18
|
-
|
19
|
-
def contents
|
20
|
-
@contents ||= self.req @uri
|
21
|
-
end
|
22
|
-
|
23
|
-
def unchomp p
|
24
|
-
return p if p.nil?
|
25
|
-
p[0] == '/' ? p : ('/' + p)
|
26
|
-
end
|
27
|
-
|
28
|
-
def req uri, cut = 1
|
29
|
-
return "Too many redirects or retries" if cut >= 10
|
30
|
-
http = Net::HTTP.new uri.host, uri.port
|
31
|
-
http.use_ssl = true
|
32
|
-
resp = http.get uri.path, {
|
33
|
-
'Accept' => 'text/plain',
|
34
|
-
'Cache-Control' => 'no-cache',
|
35
|
-
'Connection' => 'keep-alive',
|
36
|
-
'Host' => uri.host,
|
37
|
-
'User-Agent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0'
|
38
|
-
}
|
39
|
-
code = resp.code.to_i
|
40
|
-
return resp.body if code == 200
|
41
|
-
return "Not Found" if code == 404
|
42
|
-
return "Unhandled Response Code #{code}" unless code == 304 or not resp.header['location'].nil?
|
43
|
-
loc = URI.parse resp.header['location']
|
44
|
-
uri2 = loc.relative?() ? (uri + loc) : loc # overloads (+)
|
45
|
-
return req uri2, (cut + 1)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
data/lib/gollum/markup.rb
DELETED
@@ -1,664 +0,0 @@
|
|
1
|
-
# ~*~ encoding: utf-8 ~*~
|
2
|
-
require 'digest/sha1'
|
3
|
-
require 'cgi'
|
4
|
-
require 'pygments'
|
5
|
-
require 'base64'
|
6
|
-
|
7
|
-
require File.expand_path '../frontend/helpers', __FILE__
|
8
|
-
require File.expand_path '../gitcode', __FILE__
|
9
|
-
|
10
|
-
# initialize Pygments
|
11
|
-
Pygments.start
|
12
|
-
|
13
|
-
module Gollum
|
14
|
-
|
15
|
-
class Markup
|
16
|
-
include Precious::Helpers
|
17
|
-
|
18
|
-
attr_accessor :toc
|
19
|
-
attr_reader :metadata
|
20
|
-
|
21
|
-
# Initialize a new Markup object.
|
22
|
-
#
|
23
|
-
# page - The Gollum::Page.
|
24
|
-
#
|
25
|
-
# Returns a new Gollum::Markup object, ready for rendering.
|
26
|
-
def initialize(page)
|
27
|
-
@wiki = page.wiki
|
28
|
-
@name = page.filename
|
29
|
-
@data = page.text_data
|
30
|
-
@version = page.version.id if page.version
|
31
|
-
@format = page.format
|
32
|
-
@sub_page = page.sub_page
|
33
|
-
@parent_page = page.parent_page
|
34
|
-
@dir = ::File.dirname(page.path)
|
35
|
-
@tagmap = {}
|
36
|
-
@codemap = {}
|
37
|
-
@wsdmap = {}
|
38
|
-
@premap = {}
|
39
|
-
@toc = nil
|
40
|
-
@metadata = nil
|
41
|
-
@to_xml = { :save_with => Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML ^ 1, :indent => 0, :encoding => 'UTF-8' }
|
42
|
-
end
|
43
|
-
|
44
|
-
# Render the content with Gollum wiki syntax on top of the file's own
|
45
|
-
# markup language.
|
46
|
-
#
|
47
|
-
# no_follow - Boolean that determines if rel="nofollow" is added to all
|
48
|
-
# <a> tags.
|
49
|
-
# encoding - Encoding Constant or String.
|
50
|
-
#
|
51
|
-
# Returns the formatted String content.
|
52
|
-
def render(no_follow = false, encoding = nil)
|
53
|
-
sanitize = no_follow ?
|
54
|
-
@wiki.history_sanitizer :
|
55
|
-
@wiki.sanitizer
|
56
|
-
|
57
|
-
data = @data.dup
|
58
|
-
data = extract_metadata(data)
|
59
|
-
data = extract_gitcode(data)
|
60
|
-
data = extract_code(data)
|
61
|
-
data = extract_wsd(data)
|
62
|
-
data = extract_tags(data)
|
63
|
-
begin
|
64
|
-
data = GitHub::Markup.render(@name, data)
|
65
|
-
if data.nil?
|
66
|
-
raise "There was an error converting #{@name} to HTML."
|
67
|
-
end
|
68
|
-
rescue Object => e
|
69
|
-
data = %{<p class="gollum-error">#{e.message}</p>}
|
70
|
-
end
|
71
|
-
data = process_tags(data)
|
72
|
-
data = process_code(data, encoding)
|
73
|
-
|
74
|
-
doc = Nokogiri::HTML::DocumentFragment.parse(data)
|
75
|
-
doc = sanitize.clean_node!(doc) if sanitize
|
76
|
-
doc,toc = process_headers(doc)
|
77
|
-
@toc = @sub_page ? ( @parent_page ? @parent_page.toc_data : "[[_TOC_]]" ) : toc
|
78
|
-
yield doc if block_given?
|
79
|
-
# nokogiri's save options are ored together. FORMAT has a value of 1 so ^ 1 removes it.
|
80
|
-
# formatting will create extra spaces in pre tags.
|
81
|
-
# https://github.com/sparklemotion/nokogiri/issues/782
|
82
|
-
# DEFAULT_HTML encodes unicode so XHTML is used for proper unicode support in href.
|
83
|
-
data = doc.to_xml( @to_xml )
|
84
|
-
|
85
|
-
data = process_toc_tags(data)
|
86
|
-
data = process_wsd(data)
|
87
|
-
data.gsub!(/<p><\/p>/) do
|
88
|
-
''
|
89
|
-
end
|
90
|
-
|
91
|
-
data
|
92
|
-
end
|
93
|
-
|
94
|
-
# Inserts header anchors and creates TOC
|
95
|
-
#
|
96
|
-
# doc - Nokogiri parsed document
|
97
|
-
#
|
98
|
-
# Returns doc Document and toc String
|
99
|
-
def process_headers(doc)
|
100
|
-
toc = nil
|
101
|
-
doc.css('h1,h2,h3,h4,h5,h6').each do |h|
|
102
|
-
# must escape "
|
103
|
-
h_name = h.content.gsub(' ','-').gsub('"','%22')
|
104
|
-
|
105
|
-
level = h.name.gsub(/[hH]/,'').to_i
|
106
|
-
|
107
|
-
# Add anchors
|
108
|
-
h.add_child(%Q{<a class="anchor" id="#{h_name}" href="##{h_name}"></a>})
|
109
|
-
|
110
|
-
# Build TOC
|
111
|
-
toc ||= Nokogiri::XML::DocumentFragment.parse('<div class="toc"><div class="toc-title">Table of Contents</div></div>')
|
112
|
-
tail ||= toc.child
|
113
|
-
tail_level ||= 0
|
114
|
-
|
115
|
-
while tail_level < level
|
116
|
-
node = Nokogiri::XML::Node.new('ul', doc)
|
117
|
-
tail = tail.add_child(node)
|
118
|
-
tail_level += 1
|
119
|
-
end
|
120
|
-
while tail_level > level
|
121
|
-
tail = tail.parent
|
122
|
-
tail_level -= 1
|
123
|
-
end
|
124
|
-
node = Nokogiri::XML::Node.new('li', doc)
|
125
|
-
# % -> %25 so anchors work on Firefox. See issue #475
|
126
|
-
node.add_child(%Q{<a href="##{h_name}">#{h.content}</a>})
|
127
|
-
tail.add_child(node)
|
128
|
-
end
|
129
|
-
toc = toc.to_xml(@to_xml) if toc != nil
|
130
|
-
[doc, toc]
|
131
|
-
end
|
132
|
-
|
133
|
-
#########################################################################
|
134
|
-
#
|
135
|
-
# Tags
|
136
|
-
#
|
137
|
-
#########################################################################
|
138
|
-
|
139
|
-
# Extract all tags into the tagmap and replace with placeholders.
|
140
|
-
#
|
141
|
-
# data - The raw String data.
|
142
|
-
#
|
143
|
-
# Returns the placeholder'd String data.
|
144
|
-
def extract_tags(data)
|
145
|
-
if @format == :asciidoc
|
146
|
-
return data
|
147
|
-
end
|
148
|
-
data.gsub!(/(.?)\[\[(.+?)\]\]([^\[]?)/m) do
|
149
|
-
if $1 == "'" && $3 != "'"
|
150
|
-
"[[#{$2}]]#{$3}"
|
151
|
-
elsif $2.include?('][')
|
152
|
-
if $2[0..4] == 'file:'
|
153
|
-
pre = $1
|
154
|
-
post = $3
|
155
|
-
parts = $2.split('][')
|
156
|
-
parts[0][0..4] = ""
|
157
|
-
link = "#{parts[1]}|#{parts[0].sub(/\.org/,'')}"
|
158
|
-
id = Digest::SHA1.hexdigest(link)
|
159
|
-
@tagmap[id] = link
|
160
|
-
"#{pre}#{id}#{post}"
|
161
|
-
else
|
162
|
-
$&
|
163
|
-
end
|
164
|
-
else
|
165
|
-
id = Digest::SHA1.hexdigest($2)
|
166
|
-
@tagmap[id] = $2
|
167
|
-
"#{$1}#{id}#{$3}"
|
168
|
-
end
|
169
|
-
end
|
170
|
-
data
|
171
|
-
end
|
172
|
-
|
173
|
-
# Process all tags from the tagmap and replace the placeholders with the
|
174
|
-
# final markup.
|
175
|
-
#
|
176
|
-
# data - The String data (with placeholders).
|
177
|
-
#
|
178
|
-
# Returns the marked up String data.
|
179
|
-
def process_tags(data)
|
180
|
-
@tagmap.each do |id, tag|
|
181
|
-
# If it's preformatted, just put the tag back
|
182
|
-
if is_preformatted?(data, id)
|
183
|
-
data.gsub!(id) do
|
184
|
-
"[[#{tag}]]"
|
185
|
-
end
|
186
|
-
else
|
187
|
-
data.gsub!(id) do
|
188
|
-
process_tag(tag).gsub('%2F', '/')
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|
192
|
-
data
|
193
|
-
end
|
194
|
-
|
195
|
-
# Find `id` within `data` and determine if it's within
|
196
|
-
# preformatted tags.
|
197
|
-
#
|
198
|
-
# data - The String data (with placeholders).
|
199
|
-
# id - The String SHA1 hash.
|
200
|
-
PREFORMATTED_TAGS = %w(code tt)
|
201
|
-
def is_preformatted?(data, id)
|
202
|
-
doc = Nokogiri::HTML::DocumentFragment.parse(data)
|
203
|
-
node = doc.search("[text()*='#{id}']").first
|
204
|
-
node && (PREFORMATTED_TAGS.include?(node.name) ||
|
205
|
-
node.ancestors.any? { |a| PREFORMATTED_TAGS.include?(a.name) })
|
206
|
-
end
|
207
|
-
|
208
|
-
# Process a single tag into its final HTML form.
|
209
|
-
#
|
210
|
-
# tag - The String tag contents (the stuff inside the double
|
211
|
-
# brackets).
|
212
|
-
#
|
213
|
-
# Returns the String HTML version of the tag.
|
214
|
-
def process_tag(tag)
|
215
|
-
if tag =~ /^_TOC_$/
|
216
|
-
%{[[#{tag}]]}
|
217
|
-
elsif html = process_image_tag(tag)
|
218
|
-
html
|
219
|
-
elsif html = process_file_link_tag(tag)
|
220
|
-
html
|
221
|
-
else
|
222
|
-
process_page_link_tag(tag)
|
223
|
-
end
|
224
|
-
end
|
225
|
-
|
226
|
-
# Attempt to process the tag as an image tag.
|
227
|
-
#
|
228
|
-
# tag - The String tag contents (the stuff inside the double brackets).
|
229
|
-
#
|
230
|
-
# Returns the String HTML if the tag is a valid image tag or nil
|
231
|
-
# if it is not.
|
232
|
-
def process_image_tag(tag)
|
233
|
-
parts = tag.split('|')
|
234
|
-
return if parts.size.zero?
|
235
|
-
|
236
|
-
name = parts[0].strip
|
237
|
-
path = if file = find_file(name)
|
238
|
-
::File.join @wiki.base_path, file.path
|
239
|
-
elsif name =~ /^https?:\/\/.+(jpg|png|gif|svg|bmp)$/i
|
240
|
-
name
|
241
|
-
end
|
242
|
-
|
243
|
-
if path
|
244
|
-
opts = parse_image_tag_options(tag)
|
245
|
-
|
246
|
-
containered = false
|
247
|
-
|
248
|
-
classes = [] # applied to whatever the outermost container is
|
249
|
-
attrs = [] # applied to the image
|
250
|
-
|
251
|
-
align = opts['align']
|
252
|
-
if opts['float']
|
253
|
-
containered = true
|
254
|
-
align ||= 'left'
|
255
|
-
if %w{left right}.include?(align)
|
256
|
-
classes << "float-#{align}"
|
257
|
-
end
|
258
|
-
elsif %w{top texttop middle absmiddle bottom absbottom baseline}.include?(align)
|
259
|
-
attrs << %{align="#{align}"}
|
260
|
-
elsif align
|
261
|
-
if %w{left center right}.include?(align)
|
262
|
-
containered = true
|
263
|
-
classes << "align-#{align}"
|
264
|
-
end
|
265
|
-
end
|
266
|
-
|
267
|
-
if width = opts['width']
|
268
|
-
if width =~ /^\d+(\.\d+)?(em|px)$/
|
269
|
-
attrs << %{width="#{width}"}
|
270
|
-
end
|
271
|
-
end
|
272
|
-
|
273
|
-
if height = opts['height']
|
274
|
-
if height =~ /^\d+(\.\d+)?(em|px)$/
|
275
|
-
attrs << %{height="#{height}"}
|
276
|
-
end
|
277
|
-
end
|
278
|
-
|
279
|
-
if alt = opts['alt']
|
280
|
-
attrs << %{alt="#{alt}"}
|
281
|
-
end
|
282
|
-
|
283
|
-
attr_string = attrs.size > 0 ? attrs.join(' ') + ' ' : ''
|
284
|
-
|
285
|
-
if opts['frame'] || containered
|
286
|
-
classes << 'frame' if opts['frame']
|
287
|
-
%{<span class="#{classes.join(' ')}">} +
|
288
|
-
%{<span>} +
|
289
|
-
%{<img src="#{path}" #{attr_string}/>} +
|
290
|
-
(alt ? %{<span>#{alt}</span>} : '') +
|
291
|
-
%{</span>} +
|
292
|
-
%{</span>}
|
293
|
-
else
|
294
|
-
%{<img src="#{path}" #{attr_string}/>}
|
295
|
-
end
|
296
|
-
end
|
297
|
-
end
|
298
|
-
|
299
|
-
# Parse any options present on the image tag and extract them into a
|
300
|
-
# Hash of option names and values.
|
301
|
-
#
|
302
|
-
# tag - The String tag contents (the stuff inside the double brackets).
|
303
|
-
#
|
304
|
-
# Returns the options Hash:
|
305
|
-
# key - The String option name.
|
306
|
-
# val - The String option value or true if it is a binary option.
|
307
|
-
def parse_image_tag_options(tag)
|
308
|
-
tag.split('|')[1..-1].inject({}) do |memo, attr|
|
309
|
-
parts = attr.split('=').map { |x| x.strip }
|
310
|
-
memo[parts[0]] = (parts.size == 1 ? true : parts[1])
|
311
|
-
memo
|
312
|
-
end
|
313
|
-
end
|
314
|
-
|
315
|
-
# Attempt to process the tag as a file link tag.
|
316
|
-
#
|
317
|
-
# tag - The String tag contents (the stuff inside the double
|
318
|
-
# brackets).
|
319
|
-
#
|
320
|
-
# Returns the String HTML if the tag is a valid file link tag or nil
|
321
|
-
# if it is not.
|
322
|
-
def process_file_link_tag(tag)
|
323
|
-
parts = tag.split('|')
|
324
|
-
return if parts.size.zero?
|
325
|
-
|
326
|
-
name = parts[0].strip
|
327
|
-
path = parts[1] && parts[1].strip
|
328
|
-
path = if path && file = find_file(path)
|
329
|
-
::File.join @wiki.base_path, file.path
|
330
|
-
elsif path =~ %r{^https?://}
|
331
|
-
path
|
332
|
-
else
|
333
|
-
nil
|
334
|
-
end
|
335
|
-
|
336
|
-
if name && path && file
|
337
|
-
%{<a href="#{::File.join @wiki.base_path, file.path}">#{name}</a>}
|
338
|
-
elsif name && path
|
339
|
-
%{<a href="#{path}">#{name}</a>}
|
340
|
-
else
|
341
|
-
nil
|
342
|
-
end
|
343
|
-
end
|
344
|
-
|
345
|
-
# Attempt to process the tag as a page link tag.
|
346
|
-
#
|
347
|
-
# tag - The String tag contents (the stuff inside the double
|
348
|
-
# brackets).
|
349
|
-
#
|
350
|
-
# Returns the String HTML if the tag is a valid page link tag or nil
|
351
|
-
# if it is not.
|
352
|
-
def process_page_link_tag(tag)
|
353
|
-
parts = tag.split('|')
|
354
|
-
parts.reverse! if @format == :mediawiki
|
355
|
-
|
356
|
-
name, page_name = *parts.compact.map(&:strip)
|
357
|
-
cname = @wiki.page_class.cname(page_name || name)
|
358
|
-
|
359
|
-
if name =~ %r{^https?://} && page_name.nil?
|
360
|
-
%{<a href="#{name}">#{name}</a>}
|
361
|
-
else
|
362
|
-
presence = "absent"
|
363
|
-
link_name = cname
|
364
|
-
page, extra = find_page_from_name(cname)
|
365
|
-
if page
|
366
|
-
link_name = @wiki.page_class.cname(page.name)
|
367
|
-
presence = "present"
|
368
|
-
end
|
369
|
-
link = ::File.join(@wiki.base_path, page ? page.escaped_url_path : CGI.escape(link_name))
|
370
|
-
|
371
|
-
# //page is invalid
|
372
|
-
# strip all duplicate forward slashes using helpers.rb trim_leading_slash
|
373
|
-
# //page => /page
|
374
|
-
link = trim_leading_slash link
|
375
|
-
|
376
|
-
%{<a class="internal #{presence}" href="#{link}#{extra}">#{name}</a>}
|
377
|
-
end
|
378
|
-
end
|
379
|
-
|
380
|
-
|
381
|
-
# Process the special table of contents tag [[_TOC_]]
|
382
|
-
#
|
383
|
-
# data - The String data (with placeholders).
|
384
|
-
#
|
385
|
-
# Returns the marked up String data.
|
386
|
-
def process_toc_tags(data)
|
387
|
-
data.gsub!("[[_TOC_]]") do
|
388
|
-
@toc.nil? ? '' : @toc
|
389
|
-
end
|
390
|
-
data
|
391
|
-
end
|
392
|
-
|
393
|
-
# Find the given file in the repo.
|
394
|
-
#
|
395
|
-
# name - The String absolute or relative path of the file.
|
396
|
-
#
|
397
|
-
# Returns the Gollum::File or nil if none was found.
|
398
|
-
def find_file(name, version=@version)
|
399
|
-
if name =~ /^\//
|
400
|
-
@wiki.file(name[1..-1], version)
|
401
|
-
else
|
402
|
-
path = @dir == '.' ? name : ::File.join(@dir, name)
|
403
|
-
@wiki.file(path, version)
|
404
|
-
end
|
405
|
-
end
|
406
|
-
|
407
|
-
# Find a page from a given cname. If the page has an anchor (#) and has
|
408
|
-
# no match, strip the anchor and try again.
|
409
|
-
#
|
410
|
-
# cname - The String canonical page name including path.
|
411
|
-
#
|
412
|
-
# Returns a Gollum::Page instance if a page is found, or an Array of
|
413
|
-
# [Gollum::Page, String extra] if a page without the extra anchor data
|
414
|
-
# is found.
|
415
|
-
def find_page_from_name(cname)
|
416
|
-
slash = cname.rindex('/')
|
417
|
-
|
418
|
-
unless slash.nil?
|
419
|
-
name = cname[slash+1..-1]
|
420
|
-
path = cname[0..slash]
|
421
|
-
page = @wiki.paged(name, path)
|
422
|
-
else
|
423
|
-
page = @wiki.paged(cname, '/') || @wiki.page(cname)
|
424
|
-
end
|
425
|
-
|
426
|
-
if page
|
427
|
-
return page
|
428
|
-
end
|
429
|
-
if pos = cname.index('#')
|
430
|
-
[@wiki.page(cname[0...pos]), cname[pos..-1]]
|
431
|
-
end
|
432
|
-
end
|
433
|
-
|
434
|
-
#########################################################################
|
435
|
-
#
|
436
|
-
# Gitcode - fetch code from github search path and replace the contents
|
437
|
-
# to a code-block that gets run the next parse.
|
438
|
-
# Acceptable formats:
|
439
|
-
# ```language:local-file.ext```
|
440
|
-
# ```language:/abs/other-file.ext```
|
441
|
-
# ```language:github/gollum/master/somefile.txt```
|
442
|
-
#
|
443
|
-
#########################################################################
|
444
|
-
|
445
|
-
def extract_gitcode data
|
446
|
-
data.gsub /^[ \t]*``` ?([^:\n\r]+):([^`\n\r]+)```/ do
|
447
|
-
contents = ''
|
448
|
-
# Use empty string if $2 is nil.
|
449
|
-
uri = $2 || ''
|
450
|
-
# Detect local file.
|
451
|
-
if uri[0..6] != 'github/'
|
452
|
-
if file = self.find_file(uri, @wiki.ref)
|
453
|
-
contents = file.raw_data
|
454
|
-
else
|
455
|
-
# How do we communicate a render error?
|
456
|
-
next "File not found: #{Rack::Utils::escape_html(uri)}"
|
457
|
-
end
|
458
|
-
else
|
459
|
-
contents = Gollum::Gitcode.new(uri).contents
|
460
|
-
end
|
461
|
-
|
462
|
-
"```#{$1}\n#{contents}\n```\n"
|
463
|
-
end
|
464
|
-
end
|
465
|
-
|
466
|
-
#########################################################################
|
467
|
-
#
|
468
|
-
# Code
|
469
|
-
#
|
470
|
-
#########################################################################
|
471
|
-
|
472
|
-
# Extract all code blocks into the codemap and replace with placeholders.
|
473
|
-
#
|
474
|
-
# data - The raw String data.
|
475
|
-
#
|
476
|
-
# Returns the placeholder'd String data.
|
477
|
-
def extract_code(data)
|
478
|
-
data.gsub!(/^([ \t]*)(~~~+) ?([^\r\n]+)?\r?\n(.+?)\r?\n\1(~~~+)[ \t\r]*$/m) do
|
479
|
-
m_indent = $1
|
480
|
-
m_start = $2 # ~~~
|
481
|
-
m_lang = $3
|
482
|
-
m_code = $4
|
483
|
-
m_end = $5 # ~~~
|
484
|
-
|
485
|
-
# start and finish tilde fence must be the same length
|
486
|
-
return '' if m_start.length != m_end.length
|
487
|
-
|
488
|
-
lang = m_lang ? m_lang.strip : nil
|
489
|
-
id = Digest::SHA1.hexdigest("#{lang}.#{m_code}")
|
490
|
-
cached = check_cache(:code, id)
|
491
|
-
|
492
|
-
# extract lang from { .ruby } or { #stuff .ruby .indent }
|
493
|
-
# see http://johnmacfarlane.net/pandoc/README.html#delimited-code-blocks
|
494
|
-
|
495
|
-
if lang
|
496
|
-
lang = lang.match(/\.([^}\s]+)/)
|
497
|
-
lang = lang[1] unless lang.nil?
|
498
|
-
end
|
499
|
-
|
500
|
-
@codemap[id] = cached ?
|
501
|
-
{ :output => cached } :
|
502
|
-
{ :lang => lang, :code => m_code, :indent => m_indent }
|
503
|
-
|
504
|
-
"#{m_indent}#{id}" # print the SHA1 ID with the proper indentation
|
505
|
-
end
|
506
|
-
|
507
|
-
data.gsub!(/^([ \t]*)``` ?([^\r\n]+)?\r?\n(.+?)\r?\n\1```[ \t]*\r?$/m) do
|
508
|
-
lang = $2 ? $2.strip : nil
|
509
|
-
id = Digest::SHA1.hexdigest("#{lang}.#{$3}")
|
510
|
-
cached = check_cache(:code, id)
|
511
|
-
@codemap[id] = cached ?
|
512
|
-
{ :output => cached } :
|
513
|
-
{ :lang => lang, :code => $3, :indent => $1 }
|
514
|
-
"#{$1}#{id}" # print the SHA1 ID with the proper indentation
|
515
|
-
end
|
516
|
-
data
|
517
|
-
end
|
518
|
-
|
519
|
-
# Remove the leading space from a code block. Leading space
|
520
|
-
# is only removed if every single line in the block has leading
|
521
|
-
# whitespace.
|
522
|
-
#
|
523
|
-
# code - The code block to remove spaces from
|
524
|
-
# regex - A regex to match whitespace
|
525
|
-
def remove_leading_space(code, regex)
|
526
|
-
if code.lines.all? { |line| line =~ /\A\r?\n\Z/ || line =~ regex }
|
527
|
-
code.gsub!(regex) do
|
528
|
-
''
|
529
|
-
end
|
530
|
-
end
|
531
|
-
end
|
532
|
-
|
533
|
-
# Process all code from the codemap and replace the placeholders with the
|
534
|
-
# final HTML.
|
535
|
-
#
|
536
|
-
# data - The String data (with placeholders).
|
537
|
-
# encoding - Encoding Constant or String.
|
538
|
-
#
|
539
|
-
# Returns the marked up String data.
|
540
|
-
def process_code(data, encoding = nil)
|
541
|
-
return data if data.nil? || data.size.zero? || @codemap.size.zero?
|
542
|
-
|
543
|
-
blocks = []
|
544
|
-
@codemap.each do |id, spec|
|
545
|
-
next if spec[:output] # cached
|
546
|
-
|
547
|
-
code = spec[:code]
|
548
|
-
|
549
|
-
remove_leading_space(code, /^#{spec[:indent]}/m)
|
550
|
-
remove_leading_space(code, /^( |\t)/m)
|
551
|
-
|
552
|
-
blocks << [spec[:lang], code]
|
553
|
-
end
|
554
|
-
|
555
|
-
highlighted = []
|
556
|
-
blocks.each do |lang, code|
|
557
|
-
encoding ||= 'utf-8'
|
558
|
-
begin
|
559
|
-
# must set startinline to true for php to be highlighted without <?
|
560
|
-
# http://pygments.org/docs/lexers/
|
561
|
-
hl_code = Pygments.highlight(code, :lexer => lang, :options => {:encoding => encoding.to_s, :startinline => true})
|
562
|
-
rescue
|
563
|
-
hl_code = code
|
564
|
-
end
|
565
|
-
highlighted << hl_code
|
566
|
-
end
|
567
|
-
|
568
|
-
@codemap.each do |id, spec|
|
569
|
-
body = spec[:output] || begin
|
570
|
-
if (body = highlighted.shift.to_s).size > 0
|
571
|
-
update_cache(:code, id, body)
|
572
|
-
body
|
573
|
-
else
|
574
|
-
"<pre><code>#{CGI.escapeHTML(spec[:code])}</code></pre>"
|
575
|
-
end
|
576
|
-
end
|
577
|
-
data.gsub!(id) do
|
578
|
-
body
|
579
|
-
end
|
580
|
-
end
|
581
|
-
|
582
|
-
data
|
583
|
-
end
|
584
|
-
|
585
|
-
#########################################################################
|
586
|
-
#
|
587
|
-
# Sequence Diagrams
|
588
|
-
#
|
589
|
-
#########################################################################
|
590
|
-
|
591
|
-
# Extract all sequence diagram blocks into the wsdmap and replace with
|
592
|
-
# placeholders.
|
593
|
-
#
|
594
|
-
# data - The raw String data.
|
595
|
-
#
|
596
|
-
# Returns the placeholder'd String data.
|
597
|
-
def extract_wsd(data)
|
598
|
-
data.gsub(/^\{\{\{\{\{\{ ?(.+?)\r?\n(.+?)\r?\n\}\}\}\}\}\}\r?$/m) do
|
599
|
-
id = Digest::SHA1.hexdigest($2)
|
600
|
-
@wsdmap[id] = { :style => $1, :code => $2 }
|
601
|
-
id
|
602
|
-
end
|
603
|
-
end
|
604
|
-
|
605
|
-
# Process all diagrams from the wsdmap and replace the placeholders with
|
606
|
-
# the final HTML.
|
607
|
-
#
|
608
|
-
# data - The String data (with placeholders).
|
609
|
-
#
|
610
|
-
# Returns the marked up String data.
|
611
|
-
def process_wsd(data)
|
612
|
-
@wsdmap.each do |id, spec|
|
613
|
-
style = spec[:style]
|
614
|
-
code = spec[:code]
|
615
|
-
data.gsub!(id) do
|
616
|
-
Gollum::WebSequenceDiagram.new(code, style).to_tag
|
617
|
-
end
|
618
|
-
end
|
619
|
-
data
|
620
|
-
end
|
621
|
-
|
622
|
-
#########################################################################
|
623
|
-
#
|
624
|
-
# Metadata
|
625
|
-
#
|
626
|
-
#########################################################################
|
627
|
-
|
628
|
-
# Extract metadata for data and build metadata table. Metadata
|
629
|
-
# is content found between markers, and must
|
630
|
-
# be a valid YAML mapping.
|
631
|
-
#
|
632
|
-
# Because ri and ruby 1.8.7 are awesome, the markers can't
|
633
|
-
# be included in this documentation without triggering
|
634
|
-
# `Unhandled special: Special: type=17`
|
635
|
-
# Please read the source code for the exact markers
|
636
|
-
#
|
637
|
-
# Returns the String of formatted data with metadata removed.
|
638
|
-
def extract_metadata(data)
|
639
|
-
@metadata = {}
|
640
|
-
data
|
641
|
-
end
|
642
|
-
|
643
|
-
# Hook for getting the formatted value of extracted tag data.
|
644
|
-
#
|
645
|
-
# type - Symbol value identifying what type of data is being extracted.
|
646
|
-
# id - String SHA1 hash of original extracted tag data.
|
647
|
-
#
|
648
|
-
# Returns the String cached formatted data, or nil.
|
649
|
-
def check_cache(type, id)
|
650
|
-
end
|
651
|
-
|
652
|
-
# Hook for caching the formatted value of extracted tag data.
|
653
|
-
#
|
654
|
-
# type - Symbol value identifying what type of data is being extracted.
|
655
|
-
# id - String SHA1 hash of original extracted tag data.
|
656
|
-
# data - The String formatted value to be cached.
|
657
|
-
#
|
658
|
-
# Returns nothing.
|
659
|
-
def update_cache(type, id, data)
|
660
|
-
end
|
661
|
-
end
|
662
|
-
|
663
|
-
MarkupGFM = Markup
|
664
|
-
end
|