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.

Files changed (454) hide show
  1. data/README.md +44 -7
  2. data/Rakefile +1 -1
  3. data/bin/gollum +20 -1
  4. data/gollum.gemspec +400 -5
  5. data/lib/gollum.rb +2 -1
  6. data/lib/gollum/blob_entry.rb +13 -1
  7. data/lib/gollum/committer.rb +10 -1
  8. data/lib/gollum/file.rb +15 -2
  9. data/lib/gollum/file_view.rb +145 -0
  10. data/lib/gollum/frontend/app.rb +217 -69
  11. data/lib/gollum/frontend/helpers.rb +21 -0
  12. data/lib/gollum/frontend/public/gollum/css/_styles.css +121 -0
  13. data/lib/gollum/frontend/public/gollum/css/editor.css +17 -8
  14. data/lib/gollum/frontend/public/gollum/css/gollum.css +440 -402
  15. data/lib/gollum/frontend/public/gollum/css/template.css +540 -289
  16. data/lib/gollum/frontend/public/gollum/images/dirty-shade.png +0 -0
  17. data/lib/gollum/frontend/public/gollum/images/fileview/document.png +0 -0
  18. data/lib/gollum/frontend/public/gollum/images/fileview/folder-horizontal.png +0 -0
  19. data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small-expand.png +0 -0
  20. data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small.png +0 -0
  21. data/lib/gollum/frontend/public/gollum/images/para.png +0 -0
  22. data/lib/gollum/frontend/public/gollum/images/pin-16.png +0 -0
  23. data/lib/gollum/frontend/public/gollum/images/pin-20.png +0 -0
  24. data/lib/gollum/frontend/public/gollum/images/pin-24.png +0 -0
  25. data/lib/gollum/frontend/public/gollum/images/pin-32.png +0 -0
  26. data/lib/gollum/frontend/public/gollum/javascript/editor/gollum.editor.js +31 -7
  27. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/asciidoc.js +2 -1
  28. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/creole.js +2 -1
  29. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/markdown.js +18 -6
  30. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/org.js +2 -1
  31. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/pod.js +2 -1
  32. data/lib/gollum/frontend/public/gollum/javascript/editor/langs/textile.js +2 -1
  33. data/lib/gollum/frontend/public/gollum/javascript/gollum.dialog.js +3 -0
  34. data/lib/gollum/frontend/public/gollum/javascript/gollum.js +78 -16
  35. data/lib/gollum/frontend/public/gollum/javascript/jquery-1.7.2.min.js +4 -0
  36. data/lib/gollum/frontend/public/gollum/javascript/mousetrap.min.js +8 -0
  37. data/lib/gollum/frontend/public/gollum/livepreview/css/custom.css +107 -0
  38. data/lib/gollum/frontend/public/gollum/livepreview/images/cancel_24.png +0 -0
  39. data/lib/gollum/frontend/public/gollum/livepreview/images/lr_24.png +0 -0
  40. data/lib/gollum/frontend/public/gollum/livepreview/images/save_24.png +0 -0
  41. data/lib/gollum/frontend/public/gollum/livepreview/images/savecomment_24.png +0 -0
  42. data/lib/gollum/frontend/public/gollum/livepreview/index.html +46 -0
  43. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js +103 -0
  44. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js +254 -0
  45. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +184 -0
  46. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +261 -0
  47. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +92 -0
  48. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +121 -0
  49. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +193 -0
  50. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +460 -0
  51. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +101 -0
  52. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js +124 -0
  53. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png +0 -0
  54. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +327 -0
  55. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png +0 -0
  56. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js +617 -0
  57. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js +314 -0
  58. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +2419 -0
  59. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +252 -0
  60. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +116 -0
  61. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +276 -0
  62. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +759 -0
  63. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +981 -0
  64. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js +2163 -0
  65. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +195 -0
  66. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +231 -0
  67. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +171 -0
  68. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +562 -0
  69. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +22 -0
  70. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +98 -0
  71. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +81 -0
  72. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +536 -0
  73. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +367 -0
  74. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +170 -0
  75. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +143 -0
  76. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +257 -0
  77. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +315 -0
  78. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +122 -0
  79. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +556 -0
  80. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +101 -0
  81. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +611 -0
  82. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +193 -0
  83. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +134 -0
  84. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +49 -0
  85. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +202 -0
  86. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +187 -0
  87. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +214 -0
  88. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +595 -0
  89. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +106 -0
  90. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +105 -0
  91. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +292 -0
  92. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +1059 -0
  93. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +317 -0
  94. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +121 -0
  95. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +72 -0
  96. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js +19 -0
  97. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +129 -0
  98. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +164 -0
  99. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +62 -0
  100. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +61 -0
  101. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +113 -0
  102. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +105 -0
  103. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +98 -0
  104. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +225 -0
  105. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +98 -0
  106. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +113 -0
  107. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +68 -0
  108. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +74 -0
  109. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +66 -0
  110. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +132 -0
  111. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +180 -0
  112. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +121 -0
  113. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +235 -0
  114. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +121 -0
  115. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +63 -0
  116. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +100 -0
  117. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +739 -0
  118. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +2756 -0
  119. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +603 -0
  120. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +68 -0
  121. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +342 -0
  122. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +154 -0
  123. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +227 -0
  124. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +72 -0
  125. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +92 -0
  126. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +71 -0
  127. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +135 -0
  128. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +74 -0
  129. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +58 -0
  130. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +104 -0
  131. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +110 -0
  132. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +9014 -0
  133. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +242 -0
  134. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +99 -0
  135. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +85 -0
  136. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +66 -0
  137. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +75 -0
  138. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +58 -0
  139. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +108 -0
  140. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +93 -0
  141. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +83 -0
  142. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +127 -0
  143. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +108 -0
  144. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +95 -0
  145. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +92 -0
  146. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +76 -0
  147. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +115 -0
  148. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +86 -0
  149. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +169 -0
  150. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +88 -0
  151. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +65 -0
  152. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +105 -0
  153. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +262 -0
  154. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +117 -0
  155. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +81 -0
  156. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +129 -0
  157. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +24 -0
  158. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +183 -0
  159. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +58 -0
  160. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +104 -0
  161. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +83 -0
  162. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +159 -0
  163. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +93 -0
  164. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +74 -0
  165. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java.js +25 -0
  166. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +144 -0
  167. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +164 -0
  168. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +471 -0
  169. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +225 -0
  170. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +165 -0
  171. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +88 -0
  172. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +99 -0
  173. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +100 -0
  174. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js +346 -0
  175. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +111 -0
  176. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +103 -0
  177. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +108 -0
  178. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +53 -0
  179. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +122 -0
  180. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +57 -0
  181. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +38 -0
  182. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +87 -0
  183. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +279 -0
  184. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +116 -0
  185. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +220 -0
  186. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +91 -0
  187. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +87 -0
  188. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +436 -0
  189. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +22 -0
  190. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +42 -0
  191. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +81 -0
  192. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +195 -0
  193. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +81 -0
  194. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +81 -0
  195. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +103 -0
  196. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +355 -0
  197. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +117 -0
  198. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +168 -0
  199. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +78 -0
  200. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +583 -0
  201. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +119 -0
  202. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +1165 -0
  203. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +58 -0
  204. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +138 -0
  205. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +147 -0
  206. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +182 -0
  207. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +86 -0
  208. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +116 -0
  209. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +194 -0
  210. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +116 -0
  211. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +132 -0
  212. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +168 -0
  213. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js +25 -0
  214. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +179 -0
  215. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +86 -0
  216. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +304 -0
  217. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +144 -0
  218. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +145 -0
  219. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +70 -0
  220. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +89 -0
  221. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +78 -0
  222. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +71 -0
  223. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +159 -0
  224. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +109 -0
  225. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +71 -0
  226. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +73 -0
  227. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +100 -0
  228. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +65 -0
  229. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +109 -0
  230. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +103 -0
  231. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +82 -0
  232. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +120 -0
  233. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +202 -0
  234. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Position.js +59 -0
  235. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +6 -0
  236. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/StringLexer.js +1686 -0
  237. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XMLLexer.js +2993 -0
  238. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTLexer.js +69 -0
  239. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTParser.js +63 -0
  240. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryLexer.js +10363 -0
  241. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +42525 -0
  242. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQuerySemanticHighlighter.js +165 -0
  243. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/antlr3-all.js +6177 -0
  244. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery.js +55 -0
  245. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +158 -0
  246. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +86 -0
  247. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +64 -0
  248. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +116 -0
  249. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +70 -0
  250. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +73 -0
  251. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +354 -0
  252. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +105 -0
  253. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +71 -0
  254. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +140 -0
  255. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +158 -0
  256. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +163 -0
  257. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +762 -0
  258. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +171 -0
  259. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/definitions.js +696 -0
  260. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/lexer.js +598 -0
  261. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/options.js +61 -0
  262. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/parser.js +2072 -0
  263. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +278 -0
  264. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +164 -0
  265. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js +581 -0
  266. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js +230 -0
  267. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +170 -0
  268. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js +198 -0
  269. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +93 -0
  270. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +58 -0
  271. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +142 -0
  272. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js +398 -0
  273. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +87 -0
  274. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js +451 -0
  275. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js +886 -0
  276. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +472 -0
  277. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js +411 -0
  278. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js +42 -0
  279. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +136 -0
  280. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +63 -0
  281. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +313 -0
  282. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js +529 -0
  283. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js +13 -0
  284. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js +195 -0
  285. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js +65 -0
  286. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +85 -0
  287. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js +10 -0
  288. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +204 -0
  289. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/tests.html +46 -0
  290. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +159 -0
  291. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +46 -0
  292. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +118 -0
  293. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +46 -0
  294. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +119 -0
  295. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +46 -0
  296. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +145 -0
  297. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +46 -0
  298. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +151 -0
  299. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +46 -0
  300. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +149 -0
  301. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +46 -0
  302. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +182 -0
  303. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +45 -0
  304. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +102 -0
  305. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +48 -0
  306. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +133 -0
  307. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +46 -0
  308. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +137 -0
  309. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +46 -0
  310. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +140 -0
  311. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +46 -0
  312. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +140 -0
  313. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +46 -0
  314. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +146 -0
  315. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +46 -0
  316. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +148 -0
  317. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +46 -0
  318. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +145 -0
  319. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +46 -0
  320. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +150 -0
  321. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +46 -0
  322. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +131 -0
  323. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +46 -0
  324. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +130 -0
  325. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +46 -0
  326. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +165 -0
  327. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +47 -0
  328. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +164 -0
  329. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +46 -0
  330. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +164 -0
  331. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +46 -0
  332. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +164 -0
  333. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +46 -0
  334. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +164 -0
  335. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +46 -0
  336. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +160 -0
  337. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +46 -0
  338. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +162 -0
  339. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +46 -0
  340. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +141 -0
  341. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +46 -0
  342. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +162 -0
  343. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +219 -0
  344. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +195 -0
  345. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +142 -0
  346. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/unicode.js +107 -0
  347. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +1402 -0
  348. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +93 -0
  349. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jshint.js +4469 -0
  350. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jslint.js +6396 -0
  351. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +43 -0
  352. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +138 -0
  353. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +176 -0
  354. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js +73 -0
  355. data/lib/gollum/frontend/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js +2 -0
  356. data/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js +456 -0
  357. data/lib/gollum/frontend/public/gollum/livepreview/js/md_sundown.js +22 -0
  358. data/lib/gollum/frontend/public/gollum/livepreview/js/requirejs.min.js +35 -0
  359. data/lib/gollum/frontend/public/gollum/livepreview/js/sundown.js +1 -0
  360. data/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt +476 -0
  361. data/lib/gollum/frontend/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt +9 -0
  362. data/lib/gollum/frontend/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt +22 -0
  363. data/lib/gollum/frontend/public/gollum/livepreview/licenses/gollum/LICENSE.txt +21 -0
  364. data/lib/gollum/frontend/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt +20 -0
  365. data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +59 -0
  366. data/lib/gollum/frontend/public/gollum/livepreview/licenses/notepages/LICENSE.txt +19 -0
  367. data/lib/gollum/frontend/public/gollum/livepreview/licenses/requirejs/LICENSE.txt +58 -0
  368. data/lib/gollum/frontend/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt +359 -0
  369. data/lib/gollum/frontend/public/gollum/livepreview/licenses/sizzle/LICENSE.txt +148 -0
  370. data/lib/gollum/frontend/public/gollum/livepreview/licenses/sundown/sundown.txt +4 -0
  371. data/lib/gollum/frontend/public/gollum/livepreview/readme.md +44 -0
  372. data/lib/gollum/frontend/templates/compare.mustache +9 -9
  373. data/lib/gollum/frontend/templates/create.mustache +4 -1
  374. data/lib/gollum/frontend/templates/edit.mustache +6 -3
  375. data/lib/gollum/frontend/templates/editor.mustache +30 -14
  376. data/lib/gollum/frontend/templates/file_view.mustache +32 -0
  377. data/lib/gollum/frontend/templates/history.mustache +8 -8
  378. data/lib/gollum/frontend/templates/layout.mustache +21 -14
  379. data/lib/gollum/frontend/templates/page.mustache +37 -14
  380. data/lib/gollum/frontend/templates/pages.mustache +14 -10
  381. data/lib/gollum/frontend/templates/search.mustache +2 -2
  382. data/lib/gollum/frontend/templates/searchbar.mustache +1 -1
  383. data/lib/gollum/frontend/uri_encode_component.rb +172 -0
  384. data/lib/gollum/frontend/views/compare.rb +2 -4
  385. data/lib/gollum/frontend/views/create.rb +5 -0
  386. data/lib/gollum/frontend/views/edit.rb +12 -0
  387. data/lib/gollum/frontend/views/file_view.rb +19 -0
  388. data/lib/gollum/frontend/views/has_page.rb +15 -0
  389. data/lib/gollum/frontend/views/history.rb +8 -4
  390. data/lib/gollum/frontend/views/layout.rb +9 -1
  391. data/lib/gollum/frontend/views/page.rb +37 -10
  392. data/lib/gollum/frontend/views/pages.rb +48 -0
  393. data/lib/gollum/git_access.rb +2 -2
  394. data/lib/gollum/markup.rb +115 -19
  395. data/lib/gollum/page.rb +79 -9
  396. data/lib/gollum/tex.rb +319 -42
  397. data/lib/gollum/wiki.rb +92 -12
  398. data/licenses/css_tree_menu_thecssninja/license.txt +50 -0
  399. data/licenses/licenses.txt +23 -0
  400. data/licenses/unity_asset_pool/COPYRIGHT +286 -0
  401. data/test/examples/lotr.git/config +1 -1
  402. data/test/examples/lotr.git/logs/HEAD +4 -0
  403. data/test/examples/lotr.git/logs/refs/heads/master +4 -0
  404. data/test/examples/lotr.git/objects/0d/c9016ca928c78d5421a99a53b379b53929221e +0 -0
  405. data/test/examples/lotr.git/objects/1c/79ddc69707f7b164bc2ea58beb5d8965ff6bd0 +0 -0
  406. data/test/examples/lotr.git/objects/27/680b0fce1abfbc528e7aa53d92645852d52eb6 +0 -0
  407. data/test/examples/lotr.git/objects/45/3b250f979c7bd6dfb62640c944c982ae6721ee +0 -0
  408. data/test/examples/lotr.git/objects/45/f319ee12f2b551b901b22e72602963c366fff1 +0 -0
  409. data/test/examples/lotr.git/objects/46/a697caf435815bb07bbce947fc2d58be15f087 +0 -0
  410. data/test/examples/lotr.git/objects/4c/45c2b4e297a726c3d3f66886f35373e48fe1c5 +2 -0
  411. data/test/examples/lotr.git/objects/4e/023f460ce466e154ca09d8774c79ad5a53fc15 +0 -0
  412. data/test/examples/lotr.git/objects/62/9aa678272b017a4d136d35e77ac94d80b08dc2 +1 -0
  413. data/test/examples/lotr.git/objects/6e/48abfc56565574859e081ee58eae655d48cf71 +0 -0
  414. data/test/examples/lotr.git/objects/7b/60c5a20a501a70f2317fa0ef763e1e2ce22d6b +0 -0
  415. data/test/examples/lotr.git/objects/7d/981cd984ad589e3cf00d8122170c6f7d685979 +0 -0
  416. data/test/examples/lotr.git/objects/94/9a9cc3119b9c98817f375e976d2bb5e2a42809 +0 -0
  417. data/test/examples/lotr.git/objects/9b/e95b960ac388d4e7db55f610f828e9c31344e6 +0 -0
  418. data/test/examples/lotr.git/objects/b0/de6e794dfdc7ef3400e894225bfe23308aae5c +0 -0
  419. data/test/examples/lotr.git/objects/b1/6b3d9fad9d78e5a669e7f33d94c96da374eccd +0 -0
  420. data/test/examples/lotr.git/objects/c9/6a7645db5d4c76389e77cd103ef3ed77d81e4c +0 -0
  421. data/test/examples/lotr.git/objects/ca/7355dc497e9729fbaf0c0e3f424b86afef5614 +0 -0
  422. data/test/examples/lotr.git/objects/cf/ea406f5f77afc7fb673a43e97721234385b1bd +2 -0
  423. data/test/examples/lotr.git/objects/d5/29304506d37f544675244c335d85cab5d29966 +0 -0
  424. data/test/examples/lotr.git/objects/fb/c5dd7d807707b4a0a97c1182fecfef1eced5df +1 -0
  425. data/test/examples/lotr.git/objects/fc/3eee516ff72dc9099ba00d4611eb02e5c9e634 +0 -0
  426. data/test/examples/lotr.git/objects/ff/6f7de62644369380ba73b4e4297c1a2d6f0b66 +0 -0
  427. data/test/examples/lotr.git/refs/heads/master +1 -1
  428. data/test/examples/revert.git/COMMIT_EDITMSG +1 -1
  429. data/test/examples/revert.git/index +0 -0
  430. data/test/examples/revert.git/logs/HEAD +1 -0
  431. data/test/examples/revert.git/logs/refs/heads/master +1 -0
  432. data/test/examples/revert.git/objects/10/2685c42018f802557f05db171f44443e8dacab +0 -0
  433. data/test/examples/revert.git/objects/8e/83f898e5e16ae400db59dda1017acad540f3aa +0 -0
  434. data/test/examples/revert.git/objects/ed/6c9f63b98acf73c25b5ffbb38da557d3682023 +3 -0
  435. data/test/examples/revert.git/refs/heads/master +1 -1
  436. data/test/file_view/1_file.txt +3 -0
  437. data/test/file_view/1_file_1_folder.txt +8 -0
  438. data/test/file_view/1_folder.txt +8 -0
  439. data/test/file_view/2_files_2_folders.txt +12 -0
  440. data/test/file_view/2_files_2_folders_1_root.txt +13 -0
  441. data/test/file_view/nested_folders.txt +28 -0
  442. data/test/test_app.rb +162 -12
  443. data/test/test_app_helpers.rb +13 -0
  444. data/test/test_committer.rb +1 -1
  445. data/test/test_file_view.rb +102 -0
  446. data/test/test_git_access.rb +3 -2
  447. data/test/test_markup.rb +45 -12
  448. data/test/test_page.rb +65 -1
  449. data/test/test_page_revert.rb +14 -2
  450. data/test/test_pages_view.rb +37 -0
  451. data/test/test_unicode.rb +110 -0
  452. data/test/test_wiki.rb +51 -4
  453. metadata +658 -239
  454. 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
- %(<a href="/history/#{@page.name}?page=#{@page_num-1}" hotkey="h">#{label}</a>)
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 &raquo;"
36
39
  if @versions.size == Gollum::Page.per_page
37
- %(<a href="/history/#{@page.name}?page=#{@page_num+1}" hotkey="l">#{label}</a>)
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
- attr_reader :content, :page, :footer
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.title
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
- return DEFAULT_AUTHOR unless @page.version
18
- @page.version.author.name
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
- return Time.now.strftime(DATE_FORMAT) unless @page.version
23
- @page.version.authored_date.strftime(DATE_FORMAT)
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
@@ -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
- if sanitize || block_given?
57
- doc = Nokogiri::HTML::DocumentFragment.parse(data)
58
- doc = sanitize.clean_node!(doc) if sanitize
59
- yield doc if block_given?
60
- data = doc.to_html
61
- end
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
- out = %{<img src="#{::File.join(@wiki.base_path, '_tex.png')}?type=#{type}&data=#{Base64.encode64(tex).chomp}" alt="#{CGI.escapeHTML(tex)}">}
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
- data.gsub!(id, process_tag(tag))
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 html = process_image_tag(tag)
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
- id = Digest::SHA1.hexdigest("#{$2}.#{$3}")
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 => $2, :code => $3, :indent => $1 }
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 = begin
507
+ highlighted = []
508
+ blocks.each do |lang, code|
414
509
  encoding ||= 'utf-8'
415
- blocks.map { |lang, code|
416
- Pygments.highlight(code, :lexer => lang, :options => {:encoding => encoding.to_s})
417
- }
418
- rescue ::RubyPython::PythonError
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
- header = Sanitize.clean(name).strip
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, &block)
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 nanes (footers) are prefixed with
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(self.version.id)
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