gollum 2.0.0 → 2.1.0
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.
- data/README.md +44 -7
- data/Rakefile +1 -1
- data/bin/gollum +20 -1
- data/gollum.gemspec +400 -5
- data/lib/gollum.rb +2 -1
- data/lib/gollum/blob_entry.rb +13 -1
- data/lib/gollum/committer.rb +10 -1
- data/lib/gollum/file.rb +15 -2
- data/lib/gollum/file_view.rb +145 -0
- data/lib/gollum/frontend/app.rb +217 -69
- data/lib/gollum/frontend/helpers.rb +21 -0
- data/lib/gollum/frontend/public/gollum/css/_styles.css +121 -0
- data/lib/gollum/frontend/public/gollum/css/editor.css +17 -8
- data/lib/gollum/frontend/public/gollum/css/gollum.css +440 -402
- data/lib/gollum/frontend/public/gollum/css/template.css +540 -289
- data/lib/gollum/frontend/public/gollum/images/dirty-shade.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/document.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/folder-horizontal.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small-expand.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/para.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-16.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-20.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-24.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-32.png +0 -0
- data/lib/gollum/frontend/public/gollum/javascript/editor/gollum.editor.js +31 -7
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/asciidoc.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/creole.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/markdown.js +18 -6
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/org.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/pod.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/textile.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/gollum.dialog.js +3 -0
- data/lib/gollum/frontend/public/gollum/javascript/gollum.js +78 -16
- data/lib/gollum/frontend/public/gollum/javascript/jquery-1.7.2.min.js +4 -0
- data/lib/gollum/frontend/public/gollum/javascript/mousetrap.min.js +8 -0
- data/lib/gollum/frontend/public/gollum/livepreview/css/custom.css +107 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/cancel_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/lr_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/save_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/savecomment_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/index.html +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js +254 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +184 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +261 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +193 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +460 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +101 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js +124 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +327 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js +617 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js +314 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +2419 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +252 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +276 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +759 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +981 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js +2163 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +231 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +171 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +562 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +536 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +367 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +170 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +143 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +257 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +315 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +122 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +556 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +101 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +611 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +193 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +134 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +49 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +202 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +187 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +214 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +595 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +106 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +292 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +1059 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +317 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +72 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js +19 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +129 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +62 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +61 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +113 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +225 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +113 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +68 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +66 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +132 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +180 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +235 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +739 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +2756 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +603 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +68 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +342 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +154 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +227 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +72 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +135 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +104 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +110 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +9014 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +242 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +99 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +85 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +66 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +75 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +83 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +127 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +95 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +76 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +115 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +169 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +88 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +262 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +117 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +129 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +24 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +183 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +104 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +83 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java.js +25 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +144 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +471 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +225 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +88 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +99 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js +346 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +111 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +53 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +122 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +57 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +38 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +279 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +220 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +91 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +436 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +42 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +355 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +117 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +168 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +78 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +583 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +119 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +1165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +138 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +147 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +182 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +194 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +132 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +168 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js +25 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +179 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +304 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +144 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +70 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +89 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +78 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +109 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +109 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +82 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +120 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +202 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Position.js +59 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +6 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/StringLexer.js +1686 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XMLLexer.js +2993 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTLexer.js +69 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTParser.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryLexer.js +10363 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +42525 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQuerySemanticHighlighter.js +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/antlr3-all.js +6177 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery.js +55 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +158 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +64 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +70 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +354 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +158 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +163 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +762 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +171 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/definitions.js +696 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/lexer.js +598 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/options.js +61 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/parser.js +2072 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +278 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js +581 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js +230 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +170 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js +198 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +142 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js +398 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js +451 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js +886 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +472 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js +411 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js +42 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +136 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +313 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js +529 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js +13 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +85 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js +10 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +204 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/tests.html +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +118 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +119 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +151 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +149 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +182 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +45 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +102 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +48 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +133 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +137 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +146 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +148 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +150 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +131 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +130 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +47 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +160 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +162 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +141 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +162 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +219 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +142 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/unicode.js +107 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +1402 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jshint.js +4469 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jslint.js +6396 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +43 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +138 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +176 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js +2 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js +456 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/md_sundown.js +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/requirejs.min.js +35 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/sundown.js +1 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt +476 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt +9 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/gollum/LICENSE.txt +21 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt +20 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +59 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/notepages/LICENSE.txt +19 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/requirejs/LICENSE.txt +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt +359 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/sizzle/LICENSE.txt +148 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/sundown/sundown.txt +4 -0
- data/lib/gollum/frontend/public/gollum/livepreview/readme.md +44 -0
- data/lib/gollum/frontend/templates/compare.mustache +9 -9
- data/lib/gollum/frontend/templates/create.mustache +4 -1
- data/lib/gollum/frontend/templates/edit.mustache +6 -3
- data/lib/gollum/frontend/templates/editor.mustache +30 -14
- data/lib/gollum/frontend/templates/file_view.mustache +32 -0
- data/lib/gollum/frontend/templates/history.mustache +8 -8
- data/lib/gollum/frontend/templates/layout.mustache +21 -14
- data/lib/gollum/frontend/templates/page.mustache +37 -14
- data/lib/gollum/frontend/templates/pages.mustache +14 -10
- data/lib/gollum/frontend/templates/search.mustache +2 -2
- data/lib/gollum/frontend/templates/searchbar.mustache +1 -1
- data/lib/gollum/frontend/uri_encode_component.rb +172 -0
- data/lib/gollum/frontend/views/compare.rb +2 -4
- data/lib/gollum/frontend/views/create.rb +5 -0
- data/lib/gollum/frontend/views/edit.rb +12 -0
- data/lib/gollum/frontend/views/file_view.rb +19 -0
- data/lib/gollum/frontend/views/has_page.rb +15 -0
- data/lib/gollum/frontend/views/history.rb +8 -4
- data/lib/gollum/frontend/views/layout.rb +9 -1
- data/lib/gollum/frontend/views/page.rb +37 -10
- data/lib/gollum/frontend/views/pages.rb +48 -0
- data/lib/gollum/git_access.rb +2 -2
- data/lib/gollum/markup.rb +115 -19
- data/lib/gollum/page.rb +79 -9
- data/lib/gollum/tex.rb +319 -42
- data/lib/gollum/wiki.rb +92 -12
- data/licenses/css_tree_menu_thecssninja/license.txt +50 -0
- data/licenses/licenses.txt +23 -0
- data/licenses/unity_asset_pool/COPYRIGHT +286 -0
- data/test/examples/lotr.git/config +1 -1
- data/test/examples/lotr.git/logs/HEAD +4 -0
- data/test/examples/lotr.git/logs/refs/heads/master +4 -0
- data/test/examples/lotr.git/objects/0d/c9016ca928c78d5421a99a53b379b53929221e +0 -0
- data/test/examples/lotr.git/objects/1c/79ddc69707f7b164bc2ea58beb5d8965ff6bd0 +0 -0
- data/test/examples/lotr.git/objects/27/680b0fce1abfbc528e7aa53d92645852d52eb6 +0 -0
- data/test/examples/lotr.git/objects/45/3b250f979c7bd6dfb62640c944c982ae6721ee +0 -0
- data/test/examples/lotr.git/objects/45/f319ee12f2b551b901b22e72602963c366fff1 +0 -0
- data/test/examples/lotr.git/objects/46/a697caf435815bb07bbce947fc2d58be15f087 +0 -0
- data/test/examples/lotr.git/objects/4c/45c2b4e297a726c3d3f66886f35373e48fe1c5 +2 -0
- data/test/examples/lotr.git/objects/4e/023f460ce466e154ca09d8774c79ad5a53fc15 +0 -0
- data/test/examples/lotr.git/objects/62/9aa678272b017a4d136d35e77ac94d80b08dc2 +1 -0
- data/test/examples/lotr.git/objects/6e/48abfc56565574859e081ee58eae655d48cf71 +0 -0
- data/test/examples/lotr.git/objects/7b/60c5a20a501a70f2317fa0ef763e1e2ce22d6b +0 -0
- data/test/examples/lotr.git/objects/7d/981cd984ad589e3cf00d8122170c6f7d685979 +0 -0
- data/test/examples/lotr.git/objects/94/9a9cc3119b9c98817f375e976d2bb5e2a42809 +0 -0
- data/test/examples/lotr.git/objects/9b/e95b960ac388d4e7db55f610f828e9c31344e6 +0 -0
- data/test/examples/lotr.git/objects/b0/de6e794dfdc7ef3400e894225bfe23308aae5c +0 -0
- data/test/examples/lotr.git/objects/b1/6b3d9fad9d78e5a669e7f33d94c96da374eccd +0 -0
- data/test/examples/lotr.git/objects/c9/6a7645db5d4c76389e77cd103ef3ed77d81e4c +0 -0
- data/test/examples/lotr.git/objects/ca/7355dc497e9729fbaf0c0e3f424b86afef5614 +0 -0
- data/test/examples/lotr.git/objects/cf/ea406f5f77afc7fb673a43e97721234385b1bd +2 -0
- data/test/examples/lotr.git/objects/d5/29304506d37f544675244c335d85cab5d29966 +0 -0
- data/test/examples/lotr.git/objects/fb/c5dd7d807707b4a0a97c1182fecfef1eced5df +1 -0
- data/test/examples/lotr.git/objects/fc/3eee516ff72dc9099ba00d4611eb02e5c9e634 +0 -0
- data/test/examples/lotr.git/objects/ff/6f7de62644369380ba73b4e4297c1a2d6f0b66 +0 -0
- data/test/examples/lotr.git/refs/heads/master +1 -1
- data/test/examples/revert.git/COMMIT_EDITMSG +1 -1
- data/test/examples/revert.git/index +0 -0
- data/test/examples/revert.git/logs/HEAD +1 -0
- data/test/examples/revert.git/logs/refs/heads/master +1 -0
- data/test/examples/revert.git/objects/10/2685c42018f802557f05db171f44443e8dacab +0 -0
- data/test/examples/revert.git/objects/8e/83f898e5e16ae400db59dda1017acad540f3aa +0 -0
- data/test/examples/revert.git/objects/ed/6c9f63b98acf73c25b5ffbb38da557d3682023 +3 -0
- data/test/examples/revert.git/refs/heads/master +1 -1
- data/test/file_view/1_file.txt +3 -0
- data/test/file_view/1_file_1_folder.txt +8 -0
- data/test/file_view/1_folder.txt +8 -0
- data/test/file_view/2_files_2_folders.txt +12 -0
- data/test/file_view/2_files_2_folders_1_root.txt +13 -0
- data/test/file_view/nested_folders.txt +28 -0
- data/test/test_app.rb +162 -12
- data/test/test_app_helpers.rb +13 -0
- data/test/test_committer.rb +1 -1
- data/test/test_file_view.rb +102 -0
- data/test/test_git_access.rb +3 -2
- data/test/test_markup.rb +45 -12
- data/test/test_page.rb +65 -1
- data/test/test_page_revert.rb +14 -2
- data/test/test_pages_view.rb +37 -0
- data/test/test_unicode.rb +110 -0
- data/test/test_wiki.rb +51 -4
- metadata +658 -239
- data/lib/gollum/frontend/public/gollum/javascript/jquery.js +0 -7179
@@ -1,6 +1,8 @@
|
|
1
1
|
module Precious
|
2
2
|
module Views
|
3
3
|
class History < Layout
|
4
|
+
include HasPage
|
5
|
+
|
4
6
|
attr_reader :page, :page_num
|
5
7
|
|
6
8
|
def title
|
@@ -15,8 +17,8 @@ module Precious
|
|
15
17
|
:id7 => v.id[0..6],
|
16
18
|
:num => i,
|
17
19
|
:selected => @page.version.id == v.id,
|
18
|
-
:author => v.author.name,
|
19
|
-
:message => v.message,
|
20
|
+
:author => v.author.name.respond_to?(:force_encoding) ? v.author.name.force_encoding('UTF-8') : v.author.name,
|
21
|
+
:message => v.message.respond_to?(:force_encoding) ? v.message.force_encoding('UTF-8') : v.message,
|
20
22
|
:date => v.committed_date.strftime("%B %d, %Y"),
|
21
23
|
:gravatar => Digest::MD5.hexdigest(v.author.email) }
|
22
24
|
end
|
@@ -27,14 +29,16 @@ module Precious
|
|
27
29
|
if @page_num == 1
|
28
30
|
%(<span class="disabled">#{label}</span>)
|
29
31
|
else
|
30
|
-
|
32
|
+
link = url("/history/#{@page.name}?page=#{@page_num-1}")
|
33
|
+
%(<a href="#{link}" hotkey="h">#{label}</a>)
|
31
34
|
end
|
32
35
|
end
|
33
36
|
|
34
37
|
def next_link
|
35
38
|
label = "Next »"
|
36
39
|
if @versions.size == Gollum::Page.per_page
|
37
|
-
|
40
|
+
link = "/history/#{@page.name}?page=#{@page_num+1}"
|
41
|
+
%(<a href="#{link}" hotkey="l">#{label}</a>)
|
38
42
|
else
|
39
43
|
%(<span class="disabled">#{label}</span>)
|
40
44
|
end
|
@@ -6,7 +6,7 @@ module Precious
|
|
6
6
|
include Rack::Utils
|
7
7
|
alias_method :h, :escape_html
|
8
8
|
|
9
|
-
attr_reader :name
|
9
|
+
attr_reader :name, :path
|
10
10
|
|
11
11
|
def escaped_name
|
12
12
|
CGI.escape(@name)
|
@@ -15,6 +15,14 @@ module Precious
|
|
15
15
|
def title
|
16
16
|
"Home"
|
17
17
|
end
|
18
|
+
|
19
|
+
def has_path
|
20
|
+
!@path.nil?
|
21
|
+
end
|
22
|
+
|
23
|
+
def base_url
|
24
|
+
@base_url
|
25
|
+
end
|
18
26
|
end
|
19
27
|
end
|
20
28
|
end
|
@@ -1,32 +1,47 @@
|
|
1
1
|
module Precious
|
2
2
|
module Views
|
3
3
|
class Page < Layout
|
4
|
-
|
4
|
+
include HasPage
|
5
|
+
|
6
|
+
attr_reader :content, :page, :header, :footer
|
5
7
|
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
6
8
|
DEFAULT_AUTHOR = 'you'
|
7
9
|
|
8
10
|
def title
|
9
|
-
@page.
|
10
|
-
end
|
11
|
-
|
12
|
-
def format
|
13
|
-
@page.format.to_s
|
11
|
+
@page.url_path.gsub("-", " ")
|
14
12
|
end
|
15
13
|
|
16
14
|
def author
|
17
|
-
|
18
|
-
|
15
|
+
page_versions = @page.versions
|
16
|
+
first = page_versions ? page_versions.first : false
|
17
|
+
return DEFAULT_AUTHOR unless first
|
18
|
+
first.author.name.respond_to?(:force_encoding) ? first.author.name.force_encoding('UTF-8') : first.author.name
|
19
19
|
end
|
20
20
|
|
21
21
|
def date
|
22
|
-
|
23
|
-
|
22
|
+
page_versions = @page.versions
|
23
|
+
first = page_versions ? page_versions.first : false
|
24
|
+
return Time.now.strftime(DATE_FORMAT) unless first
|
25
|
+
first.authored_date.strftime(DATE_FORMAT)
|
24
26
|
end
|
25
27
|
|
26
28
|
def editable
|
27
29
|
@editable
|
28
30
|
end
|
29
31
|
|
32
|
+
def has_header
|
33
|
+
@header = (@page.header || false) if @header.nil?
|
34
|
+
!!@header
|
35
|
+
end
|
36
|
+
|
37
|
+
def header_content
|
38
|
+
has_header && @header.formatted_data
|
39
|
+
end
|
40
|
+
|
41
|
+
def header_format
|
42
|
+
has_header && @header.format.to_s
|
43
|
+
end
|
44
|
+
|
30
45
|
def has_footer
|
31
46
|
@footer = (@page.footer || false) if @footer.nil?
|
32
47
|
!!@footer
|
@@ -52,6 +67,18 @@ module Precious
|
|
52
67
|
def sidebar_format
|
53
68
|
has_sidebar && @sidebar.format.to_s
|
54
69
|
end
|
70
|
+
|
71
|
+
def has_toc
|
72
|
+
!@toc_content.nil?
|
73
|
+
end
|
74
|
+
|
75
|
+
def toc_content
|
76
|
+
@toc_content
|
77
|
+
end
|
78
|
+
|
79
|
+
def mathjax
|
80
|
+
@mathjax
|
81
|
+
end
|
55
82
|
end
|
56
83
|
end
|
57
84
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "pathname"
|
2
|
+
|
1
3
|
module Precious
|
2
4
|
module Views
|
3
5
|
class Pages < Layout
|
@@ -7,6 +9,52 @@ module Precious
|
|
7
9
|
"All pages in #{@ref}"
|
8
10
|
end
|
9
11
|
|
12
|
+
def breadcrumb
|
13
|
+
if @path
|
14
|
+
path = Pathname.new(@path)
|
15
|
+
breadcrumb = [%{<a href="#{@base_url}pages/">Home</a>}]
|
16
|
+
path.descend do |crumb|
|
17
|
+
title = crumb.basename
|
18
|
+
|
19
|
+
if title == path.basename
|
20
|
+
breadcrumb << title
|
21
|
+
else
|
22
|
+
breadcrumb << %{<a href="#{@base_url}pages/#{crumb}/">#{title}</a>}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
breadcrumb.join(" / ")
|
27
|
+
else
|
28
|
+
"Home"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def files_folders
|
33
|
+
if has_results
|
34
|
+
folder_links = []
|
35
|
+
|
36
|
+
@results.map { |page|
|
37
|
+
page_path = page.path.sub(/^#{@path}\//,'')
|
38
|
+
|
39
|
+
if page_path.include?('/')
|
40
|
+
folder = page_path.split('/').first
|
41
|
+
folder_path = @path ? "#{@path}/#{folder}" : folder
|
42
|
+
folder_link = %{<li><a href="#{@base_url}pages/#{folder_path}/" class="folder">#{folder}</a></li>}
|
43
|
+
|
44
|
+
unless folder_links.include?(folder_link)
|
45
|
+
folder_links << folder_link
|
46
|
+
|
47
|
+
folder_link
|
48
|
+
end
|
49
|
+
elsif page_path != ".gitkeep"
|
50
|
+
%{<li><a href="#{@base_url}#{page.escaped_url_path}" class="file">#{page.name}</a></li>}
|
51
|
+
end
|
52
|
+
}.compact.join("\n")
|
53
|
+
else
|
54
|
+
""
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
10
58
|
def has_results
|
11
59
|
!@results.empty?
|
12
60
|
end
|
data/lib/gollum/git_access.rb
CHANGED
@@ -9,10 +9,10 @@ module Gollum
|
|
9
9
|
# page_file_dir - String the directory in which all page files reside
|
10
10
|
#
|
11
11
|
# Returns this instance.
|
12
|
-
def initialize(path, page_file_dir = nil)
|
12
|
+
def initialize(path, page_file_dir = nil, bare = false)
|
13
13
|
@page_file_dir = page_file_dir
|
14
14
|
@path = path
|
15
|
-
@repo = Grit::Repo.new(path)
|
15
|
+
@repo = Grit::Repo.new(path, { :is_bare => bare })
|
16
16
|
clear
|
17
17
|
end
|
18
18
|
|
data/lib/gollum/markup.rb
CHANGED
@@ -6,6 +6,7 @@ require 'base64'
|
|
6
6
|
module Gollum
|
7
7
|
|
8
8
|
class Markup
|
9
|
+
attr_accessor :toc
|
9
10
|
# Initialize a new Markup object.
|
10
11
|
#
|
11
12
|
# page - The Gollum::Page.
|
@@ -17,12 +18,15 @@ module Gollum
|
|
17
18
|
@data = page.text_data
|
18
19
|
@version = page.version.id if page.version
|
19
20
|
@format = page.format
|
21
|
+
@sub_page = page.sub_page
|
22
|
+
@parent_page = page.parent_page
|
20
23
|
@dir = ::File.dirname(page.path)
|
21
24
|
@tagmap = {}
|
22
25
|
@codemap = {}
|
23
26
|
@texmap = {}
|
24
27
|
@wsdmap = {}
|
25
28
|
@premap = {}
|
29
|
+
@toc = nil
|
26
30
|
end
|
27
31
|
|
28
32
|
# Render the content with Gollum wiki syntax on top of the file's own
|
@@ -53,18 +57,61 @@ module Gollum
|
|
53
57
|
end
|
54
58
|
data = process_tags(data)
|
55
59
|
data = process_code(data, encoding)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
|
61
|
+
doc = Nokogiri::HTML::DocumentFragment.parse(data)
|
62
|
+
doc = sanitize.clean_node!(doc) if sanitize
|
63
|
+
doc,toc = process_headers(doc)
|
64
|
+
@toc = @sub_page ? ( @parent_page ? @parent_page.toc_data : "[[_TOC_]]" ) : toc
|
65
|
+
yield doc if block_given?
|
66
|
+
data = doc.to_html
|
67
|
+
|
68
|
+
data = process_toc_tags(data)
|
62
69
|
data = process_tex(data)
|
63
70
|
data = process_wsd(data)
|
64
71
|
data.gsub!(/<p><\/p>/, '')
|
65
72
|
data
|
66
73
|
end
|
67
74
|
|
75
|
+
# Inserts header anchors and creates TOC
|
76
|
+
#
|
77
|
+
# doc - Nokogiri parsed document
|
78
|
+
#
|
79
|
+
# Returns doc Document and toc String
|
80
|
+
def process_headers(doc)
|
81
|
+
toc = nil
|
82
|
+
doc.css('h1,h2,h3,h4,h5,h6').each do |h|
|
83
|
+
id = CGI::escape(h.content.gsub(' ','-'))
|
84
|
+
level = h.name.gsub(/[hH]/,'').to_i
|
85
|
+
|
86
|
+
# Add anchors
|
87
|
+
anchor = Nokogiri::XML::Node.new('a', doc)
|
88
|
+
anchor['class'] = 'anchor'
|
89
|
+
anchor['id'] = id
|
90
|
+
anchor['href'] = '#' + id
|
91
|
+
h.add_child(anchor)
|
92
|
+
|
93
|
+
# Build TOC
|
94
|
+
toc ||= Nokogiri::XML::DocumentFragment.parse('<div class="toc"><div class="toc-title">Table of Contents</div></div>')
|
95
|
+
tail ||= toc.child
|
96
|
+
tail_level ||= 0
|
97
|
+
|
98
|
+
while tail_level < level
|
99
|
+
node = Nokogiri::XML::Node.new('ul', doc)
|
100
|
+
tail = tail.add_child(node)
|
101
|
+
tail_level += 1
|
102
|
+
end
|
103
|
+
while tail_level > level
|
104
|
+
tail = tail.parent
|
105
|
+
tail_level -= 1
|
106
|
+
end
|
107
|
+
node = Nokogiri::XML::Node.new('li', doc)
|
108
|
+
node.add_child("<a href='##{id}'>#{h.content}</a>")
|
109
|
+
tail.add_child(node)
|
110
|
+
end
|
111
|
+
toc = toc.to_xhtml if toc != nil
|
112
|
+
[doc, toc]
|
113
|
+
end
|
114
|
+
|
68
115
|
#########################################################################
|
69
116
|
#
|
70
117
|
# TeX
|
@@ -99,7 +146,22 @@ module Gollum
|
|
99
146
|
def process_tex(data)
|
100
147
|
@texmap.each do |id, spec|
|
101
148
|
type, tex = *spec
|
102
|
-
|
149
|
+
|
150
|
+
# Obtain the formula with parameters
|
151
|
+
out = nil
|
152
|
+
begin
|
153
|
+
width, height, align, base64 = Gollum::Tex.render_formula(tex, true)
|
154
|
+
|
155
|
+
# TODO: Should we load the binary inside the html?
|
156
|
+
#out = %{<img width="#{width}" height="#{height}" style="vertical-align: #{align}px;" src="data:image/png;base64,\n#{base64}" alt="#{CGI.escapeHTML(tex)}" />}
|
157
|
+
|
158
|
+
# Use the alignment values from the formula rendering but still use the call to '_tex.png'. Although it will call render_formula()
|
159
|
+
# again, it will use the already cached formula and it might have some advantages from the point of view of browser caching (really not sure here).
|
160
|
+
out = %{<img width="#{width}" height="#{height}" style="vertical-align: #{align}px;" src="#{::File.join(@wiki.base_path, '_tex.png')}?type=#{type}&data=#{Base64.encode64(tex).chomp}" alt="#{CGI.escapeHTML(tex)}" />}
|
161
|
+
rescue # In case of error
|
162
|
+
out = CGI.escapeHTML(tex)
|
163
|
+
end
|
164
|
+
|
103
165
|
data.gsub!(id, out)
|
104
166
|
end
|
105
167
|
data
|
@@ -153,11 +215,29 @@ module Gollum
|
|
153
215
|
# Returns the marked up String data.
|
154
216
|
def process_tags(data)
|
155
217
|
@tagmap.each do |id, tag|
|
156
|
-
|
218
|
+
# If it's preformatted, just put the tag back
|
219
|
+
if is_preformatted?(data, id)
|
220
|
+
data.gsub!(id, "[[#{tag}]]")
|
221
|
+
else
|
222
|
+
data.gsub!(id, process_tag(tag))
|
223
|
+
end
|
157
224
|
end
|
158
225
|
data
|
159
226
|
end
|
160
227
|
|
228
|
+
# Find `id` within `data` and determine if it's within
|
229
|
+
# preformatted tags.
|
230
|
+
#
|
231
|
+
# data - The String data (with placeholders).
|
232
|
+
# id - The String SHA1 hash.
|
233
|
+
PREFORMATTED_TAGS = %w(code tt)
|
234
|
+
def is_preformatted?(data, id)
|
235
|
+
doc = Nokogiri::HTML::DocumentFragment.parse(data)
|
236
|
+
node = doc.search("[text()*='#{id}']").first
|
237
|
+
node && (PREFORMATTED_TAGS.include?(node.name) ||
|
238
|
+
node.ancestors.any? { |a| PREFORMATTED_TAGS.include?(a.name) })
|
239
|
+
end
|
240
|
+
|
161
241
|
# Process a single tag into its final HTML form.
|
162
242
|
#
|
163
243
|
# tag - The String tag contents (the stuff inside the double
|
@@ -165,7 +245,9 @@ module Gollum
|
|
165
245
|
#
|
166
246
|
# Returns the String HTML version of the tag.
|
167
247
|
def process_tag(tag)
|
168
|
-
if
|
248
|
+
if tag =~ /^_TOC_$/
|
249
|
+
%{[[#{tag}]]}
|
250
|
+
elsif html = process_image_tag(tag)
|
169
251
|
html
|
170
252
|
elsif html = process_file_link_tag(tag)
|
171
253
|
html
|
@@ -322,6 +404,17 @@ module Gollum
|
|
322
404
|
end
|
323
405
|
end
|
324
406
|
|
407
|
+
|
408
|
+
# Process the special table of contents tag [[_TOC_]]
|
409
|
+
#
|
410
|
+
# data - The String data (with placeholders).
|
411
|
+
#
|
412
|
+
# Returns the marked up String data.
|
413
|
+
def process_toc_tags(data)
|
414
|
+
data.gsub!("[[_TOC_]]", @toc.nil? ? '' : @toc)
|
415
|
+
data
|
416
|
+
end
|
417
|
+
|
325
418
|
# Find the given file in the repo.
|
326
419
|
#
|
327
420
|
# name - The String absolute or relative path of the file.
|
@@ -366,11 +459,12 @@ module Gollum
|
|
366
459
|
# Returns the placeholder'd String data.
|
367
460
|
def extract_code(data)
|
368
461
|
data.gsub!(/^([ \t]*)``` ?([^\r\n]+)?\r?\n(.+?)\r?\n\1```\r?$/m) do
|
369
|
-
|
462
|
+
lang = $2 ? $2.strip : nil
|
463
|
+
id = Digest::SHA1.hexdigest("#{lang}.#{$3}")
|
370
464
|
cached = check_cache(:code, id)
|
371
465
|
@codemap[id] = cached ?
|
372
466
|
{ :output => cached } :
|
373
|
-
{ :lang =>
|
467
|
+
{ :lang => lang, :code => $3, :indent => $1 }
|
374
468
|
"#{$1}#{id}" # print the SHA1 ID with the proper indentation
|
375
469
|
end
|
376
470
|
data
|
@@ -410,15 +504,17 @@ module Gollum
|
|
410
504
|
blocks << [spec[:lang], code]
|
411
505
|
end
|
412
506
|
|
413
|
-
highlighted =
|
507
|
+
highlighted = []
|
508
|
+
blocks.each do |lang, code|
|
414
509
|
encoding ||= 'utf-8'
|
415
|
-
|
416
|
-
Pygments.highlight(code, :lexer => lang, :options => {:encoding => encoding.to_s})
|
417
|
-
|
418
|
-
|
419
|
-
|
510
|
+
begin
|
511
|
+
hl_code = Pygments.highlight(code, :lexer => lang, :options => {:encoding => encoding.to_s})
|
512
|
+
rescue ::RubyPython::PythonError
|
513
|
+
hl_code = code
|
514
|
+
end
|
515
|
+
highlighted << hl_code
|
420
516
|
end
|
421
|
-
|
517
|
+
|
422
518
|
@codemap.each do |id, spec|
|
423
519
|
body = spec[:output] || begin
|
424
520
|
if (body = highlighted.shift.to_s).size > 0
|
@@ -447,7 +543,7 @@ module Gollum
|
|
447
543
|
#
|
448
544
|
# Returns the placeholder'd String data.
|
449
545
|
def extract_wsd(data)
|
450
|
-
data.gsub(/^\{\{\{ ?(.+?)\r?\n(.+?)\r?\n\}\}\}\r?$/m) do
|
546
|
+
data.gsub(/^\{\{\{\{\{\{ ?(.+?)\r?\n(.+?)\r?\n\}\}\}\}\}\}\r?$/m) do
|
451
547
|
id = Digest::SHA1.hexdigest($2)
|
452
548
|
@wsdmap[id] = { :style => $1, :code => $2 }
|
453
549
|
id
|
data/lib/gollum/page.rb
CHANGED
@@ -20,6 +20,11 @@ module Gollum
|
|
20
20
|
# Returns nothing.
|
21
21
|
attr_writer :historical
|
22
22
|
|
23
|
+
# Parent page if this is a sub page
|
24
|
+
#
|
25
|
+
# Returns a Page
|
26
|
+
attr_accessor :parent_page
|
27
|
+
|
23
28
|
# Checks if a filename has a valid extension understood by GitHub::Markup.
|
24
29
|
#
|
25
30
|
# filename - String filename, like "Home.md".
|
@@ -99,7 +104,9 @@ module Gollum
|
|
99
104
|
# Returns a newly initialized Gollum::Page.
|
100
105
|
def initialize(wiki)
|
101
106
|
@wiki = wiki
|
102
|
-
@blob = @footer = @sidebar = nil
|
107
|
+
@blob = @header = @footer = @sidebar = nil
|
108
|
+
@doc = nil
|
109
|
+
@parent_page = nil
|
103
110
|
end
|
104
111
|
|
105
112
|
# Public: The on-disk filename of the page including extension.
|
@@ -130,7 +137,15 @@ module Gollum
|
|
130
137
|
#
|
131
138
|
# Returns the fully sanitized String title.
|
132
139
|
def title
|
133
|
-
|
140
|
+
Sanitize.clean(name).strip
|
141
|
+
end
|
142
|
+
|
143
|
+
# Public: Determines if this is a sub-page
|
144
|
+
# Sub-pages have filenames beginning with an underscore
|
145
|
+
#
|
146
|
+
# Returns true or false.
|
147
|
+
def sub_page
|
148
|
+
filename =~ /^_/
|
134
149
|
end
|
135
150
|
|
136
151
|
# Public: The path of the page within the repo.
|
@@ -138,6 +153,27 @@ module Gollum
|
|
138
153
|
# Returns the String path.
|
139
154
|
attr_reader :path
|
140
155
|
|
156
|
+
# Public: The url path required to reach this page within the repo.
|
157
|
+
#
|
158
|
+
# Returns the String url_path
|
159
|
+
def url_path
|
160
|
+
path = if self.path.include?('/')
|
161
|
+
self.path.sub(/\/[^\/]+$/, '/')
|
162
|
+
else
|
163
|
+
''
|
164
|
+
end
|
165
|
+
|
166
|
+
path << Page.cname(self.name, '-', '-')
|
167
|
+
path
|
168
|
+
end
|
169
|
+
|
170
|
+
# Public: The url_path, but CGI escaped.
|
171
|
+
#
|
172
|
+
# Returns the String url_path
|
173
|
+
def escaped_url_path
|
174
|
+
CGI.escape(self.url_path).gsub('%2F','/')
|
175
|
+
end
|
176
|
+
|
141
177
|
# Public: The raw contents of the page.
|
142
178
|
#
|
143
179
|
# Returns the String data.
|
@@ -164,7 +200,21 @@ module Gollum
|
|
164
200
|
#
|
165
201
|
# Returns the String data.
|
166
202
|
def formatted_data(encoding = nil, &block)
|
167
|
-
@blob && markup_class.render(historical?, encoding
|
203
|
+
@blob && markup_class.render(historical?, encoding) do |doc|
|
204
|
+
@doc = doc
|
205
|
+
yield doc if block_given?
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# Public: The table of contents of the page.
|
210
|
+
#
|
211
|
+
# formatted_data - page already marked up in html.
|
212
|
+
#
|
213
|
+
# Returns the String data.
|
214
|
+
def toc_data()
|
215
|
+
return @parent_page.toc_data if @parent_page and @sub_page
|
216
|
+
formatted_data if markup_class.toc == nil
|
217
|
+
markup_class.toc
|
168
218
|
end
|
169
219
|
|
170
220
|
# Public: The format of the page.
|
@@ -209,6 +259,20 @@ module Gollum
|
|
209
259
|
end
|
210
260
|
end
|
211
261
|
|
262
|
+
# Public: The first 7 characters of the current version.
|
263
|
+
#
|
264
|
+
# Returns the first 7 characters of the current version.
|
265
|
+
def version_short
|
266
|
+
version.to_s[0,7]
|
267
|
+
end
|
268
|
+
|
269
|
+
# Public: The header Page.
|
270
|
+
#
|
271
|
+
# Returns the header Page or nil if none exists.
|
272
|
+
def header
|
273
|
+
@header ||= find_sub_page(:header)
|
274
|
+
end
|
275
|
+
|
212
276
|
# Public: The footer Page.
|
213
277
|
#
|
214
278
|
# Returns the footer Page or nil if none exists.
|
@@ -300,9 +364,9 @@ module Gollum
|
|
300
364
|
# version - The String version ID to find.
|
301
365
|
#
|
302
366
|
# Returns a Gollum::Page or nil if the page could not be found.
|
303
|
-
def find(name, version)
|
367
|
+
def find(name, version, dir = nil)
|
304
368
|
map = @wiki.tree_map_for(version.to_s)
|
305
|
-
if page = find_page_in_tree(map, name)
|
369
|
+
if page = find_page_in_tree(map, name, dir)
|
306
370
|
page.version = version.is_a?(Grit::Commit) ?
|
307
371
|
version : @wiki.commit_for(version)
|
308
372
|
page.historical = page.version.to_s == version.to_s
|
@@ -376,8 +440,10 @@ module Gollum
|
|
376
440
|
false
|
377
441
|
end
|
378
442
|
|
379
|
-
# Loads a sub page. Sub page
|
380
|
-
# an underscore to distinguish them from other Pages.
|
443
|
+
# Loads a sub page. Sub page names (footers, headers, sidebars) are prefixed with
|
444
|
+
# an underscore to distinguish them from other Pages. If there is not one within
|
445
|
+
# the current directory, starts walking up the directory tree to try and find one
|
446
|
+
# within parent directories.
|
381
447
|
#
|
382
448
|
# name - String page name.
|
383
449
|
#
|
@@ -390,15 +456,19 @@ module Gollum
|
|
390
456
|
|
391
457
|
dirs = self.path.split('/')
|
392
458
|
dirs.pop
|
393
|
-
map = @wiki.tree_map_for(
|
459
|
+
map = @wiki.tree_map_for(@wiki.ref, true)
|
394
460
|
while !dirs.empty?
|
395
461
|
if page = find_page_in_tree(map, name, dirs.join('/'))
|
462
|
+
page.parent_page = self
|
396
463
|
return page
|
397
464
|
end
|
398
465
|
dirs.pop
|
399
466
|
end
|
400
467
|
|
401
|
-
find_page_in_tree(map, name, '')
|
468
|
+
if page = find_page_in_tree(map, name, '')
|
469
|
+
page.parent_page = self
|
470
|
+
end
|
471
|
+
page
|
402
472
|
end
|
403
473
|
|
404
474
|
def inspect
|