Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 792abae07e | |||
| 74ce648c59 | |||
| 2686e96046 | |||
| 213e2bb432 | |||
| 79bb5c10ab | |||
| 7ea012d786 | |||
| 43591f75de | |||
| 05d82c0569 | |||
| 76c8d3206c | |||
| 00751d05b4 | |||
| b5be5df11a | |||
| 7d159273fc | |||
| 70127922ab | |||
| b95df93775 | |||
| dc06edcf5b | |||
| fdc437dcd5 | |||
| f6873c9612 | |||
| 93754ab32d | |||
| 5759334635 | |||
| f2f543b72d | |||
| 598b052be3 | |||
| a746062422 | |||
| c8868d369f |
@@ -381,10 +381,10 @@ You may imbed sequence diagrams into your wiki page (rendered by
|
|||||||
[WebSequenceDiagrams](http://www.websequencediagrams.com) by using the
|
[WebSequenceDiagrams](http://www.websequencediagrams.com) by using the
|
||||||
following syntax:
|
following syntax:
|
||||||
|
|
||||||
{{{ blue-modern
|
{{{{{{ blue-modern
|
||||||
alice->bob: Test
|
alice->bob: Test
|
||||||
bob->alice: Test response
|
bob->alice: Test response
|
||||||
}}}
|
}}}}}}
|
||||||
|
|
||||||
You can replace the string "blue-modern" with any supported style.
|
You can replace the string "blue-modern" with any supported style.
|
||||||
|
|
||||||
@@ -532,9 +532,9 @@ Your Rack middleware can pass author details to Gollum in a Hash in the session
|
|||||||
## WINDOWS FILENAME VALIDATION
|
## WINDOWS FILENAME VALIDATION
|
||||||
Note that filenames on windows must not contain any of the following characters `\ / : * ? " < > |`. See [this support article](http://support.microsoft.com/kb/177506) for details.
|
Note that filenames on windows must not contain any of the following characters `\ / : * ? " < > |`. See [this support article](http://support.microsoft.com/kb/177506) for details.
|
||||||
|
|
||||||
## LIB.SO ERROR
|
## CONFIG FILE
|
||||||
|
|
||||||
`Could not open library 'lib.so'` may be solved by installing `python-devel` on Fedora or `python-dev` on Ubuntu. Gentoo requires a rubypython [patch](https://gist.github.com/2802480) to use python2.7.
|
Gollum optionaly takes a `--config file`. See [config.rb](https://github.com/github/gollum/blob/master/config.rb) for an example.
|
||||||
|
|
||||||
## CONTRIBUTE
|
## CONTRIBUTE
|
||||||
|
|
||||||
@@ -556,6 +556,8 @@ your changes merged back into core is as follows:
|
|||||||
1. Send a pull request to the github/gollum project.
|
1. Send a pull request to the github/gollum project.
|
||||||
|
|
||||||
## RELEASING
|
## RELEASING
|
||||||
|
x.y.z
|
||||||
|
|
||||||
For z releases:
|
For z releases:
|
||||||
$ rake bump
|
$ rake bump
|
||||||
$ rake release
|
$ rake release
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# Example gollum config
|
||||||
|
# gollum ../wiki --config config.rb
|
||||||
|
#
|
||||||
|
# or run from source with
|
||||||
|
#
|
||||||
|
# bundle exec bin/gollum ../wiki/ --config config.rb
|
||||||
|
|
||||||
|
# Remove const to avoid
|
||||||
|
# warning: already initialized constant FORMAT_NAMES
|
||||||
|
#
|
||||||
|
# only remove if it's defined.
|
||||||
|
# constant Gollum::Page::FORMAT_NAMES not defined (NameError)
|
||||||
|
Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES
|
||||||
|
# limit to one format
|
||||||
|
Gollum::Page::FORMAT_NAMES = { :markdown => "Markdown" }
|
||||||
|
|
||||||
|
=begin
|
||||||
|
Valid formats are:
|
||||||
|
{ :markdown => "Markdown",
|
||||||
|
:textile => "Textile",
|
||||||
|
:rdoc => "RDoc",
|
||||||
|
:org => "Org-mode",
|
||||||
|
:creole => "Creole",
|
||||||
|
:rest => "reStructuredText",
|
||||||
|
:asciidoc => "AsciiDoc",
|
||||||
|
:mediawiki => "MediaWiki",
|
||||||
|
:pod => "Pod" }
|
||||||
|
=end
|
||||||
+3
-2
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
|
|||||||
s.required_ruby_version = ">= 1.8.7"
|
s.required_ruby_version = ">= 1.8.7"
|
||||||
|
|
||||||
s.name = 'gollum'
|
s.name = 'gollum'
|
||||||
s.version = '2.3.4'
|
s.version = '2.3.9'
|
||||||
s.date = '2012-10-28'
|
s.date = '2012-11-07'
|
||||||
s.rubyforge_project = 'gollum'
|
s.rubyforge_project = 'gollum'
|
||||||
|
|
||||||
s.summary = "A simple, Git-powered wiki."
|
s.summary = "A simple, Git-powered wiki."
|
||||||
@@ -53,6 +53,7 @@ Gem::Specification.new do |s|
|
|||||||
README.md
|
README.md
|
||||||
Rakefile
|
Rakefile
|
||||||
bin/gollum
|
bin/gollum
|
||||||
|
config.rb
|
||||||
docs/sanitization.md
|
docs/sanitization.md
|
||||||
gollum.gemspec
|
gollum.gemspec
|
||||||
lib/gollum.rb
|
lib/gollum.rb
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
|||||||
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
||||||
|
|
||||||
module Gollum
|
module Gollum
|
||||||
VERSION = '2.3.4'
|
VERSION = '2.3.9'
|
||||||
|
|
||||||
def self.assets_path
|
def self.assets_path
|
||||||
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
||||||
|
|||||||
@@ -306,7 +306,8 @@ module Precious
|
|||||||
get '/search' do
|
get '/search' do
|
||||||
@query = params[:q]
|
@query = params[:q]
|
||||||
wiki = wiki_new
|
wiki = wiki_new
|
||||||
@results = wiki.search @query
|
# Sort wiki search results by count (desc) and then by name (asc)
|
||||||
|
@results = wiki.search(@query).sort{ |a, b| (a[:count] <=> b[:count]).nonzero? || b[:name] <=> a[:name] }.reverse
|
||||||
@name = @query
|
@name = @query
|
||||||
mustache :search
|
mustache :search
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -212,4 +212,20 @@ $(document).ready(function() {
|
|||||||
$('#gollum-revert-form').submit();
|
$('#gollum-revert-form').submit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( $('#wiki-wrapper.edit').length ){
|
||||||
|
$("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
|
||||||
|
$("#gollum-editor-body").one('change', function(){
|
||||||
|
window.onbeforeunload = function(){ return "Leaving will discard all edits!" };
|
||||||
|
});
|
||||||
|
$.GollumEditor();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $('#wiki-wrapper.create').length ){
|
||||||
|
$("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
|
||||||
|
$("#gollum-editor-body").one('change', function(){
|
||||||
|
window.onbeforeunload = function(){ return "Leaving will not create a new page!" };
|
||||||
|
)};
|
||||||
|
$.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -108,8 +108,9 @@ $.save = function( commitMessage ) {
|
|||||||
var msg = defaultCommitMessage();
|
var msg = defaultCommitMessage();
|
||||||
var newLocation = baseUrl;
|
var newLocation = baseUrl;
|
||||||
|
|
||||||
|
// Remove all duplicate slashes
|
||||||
function clean( str ) {
|
function clean( str ) {
|
||||||
return str.replace(/^\/+/, '/');
|
return str.replace(/\/+/g, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'a%2Fb' => a/b
|
// 'a%2Fb' => a/b
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div id="wiki-wrapper">
|
<div id="wiki-wrapper" class="create">
|
||||||
<div id="head">
|
<div id="head">
|
||||||
<h1>Create New Page</h1>
|
<h1>Create New Page</h1>
|
||||||
</div>
|
</div>
|
||||||
@@ -8,13 +8,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
window.onbeforeunload = function(){ return "Leaving will not create a new page!" };
|
|
||||||
$("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
|
|
||||||
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
$.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{{something}}
|
{{something}}
|
||||||
|
|||||||
@@ -10,11 +10,3 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="wiki-content">{{>editor}}</div>
|
<div id="wiki-content">{{>editor}}</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
window.onbeforeunload = function(){ return "Leaving will discard all edits!" };
|
|
||||||
$("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
|
|
||||||
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
$.GollumEditor();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -488,8 +488,10 @@ module Gollum
|
|||||||
# extract lang from { .ruby } or { #stuff .ruby .indent }
|
# extract lang from { .ruby } or { #stuff .ruby .indent }
|
||||||
# see http://johnmacfarlane.net/pandoc/README.html#delimited-code-blocks
|
# see http://johnmacfarlane.net/pandoc/README.html#delimited-code-blocks
|
||||||
|
|
||||||
lang = lang.match(/\.([^}\s]+)/)
|
if lang
|
||||||
lang = lang[1] unless lang.nil?
|
lang = lang.match(/\.([^}\s]+)/)
|
||||||
|
lang = lang[1] unless lang.nil?
|
||||||
|
end
|
||||||
|
|
||||||
@codemap[id] = cached ?
|
@codemap[id] = cached ?
|
||||||
{ :output => cached } :
|
{ :output => cached } :
|
||||||
|
|||||||
+25
-20
@@ -166,26 +166,31 @@ module Gollum
|
|||||||
options[:access] = path
|
options[:access] = path
|
||||||
path = path.path
|
path = path.path
|
||||||
end
|
end
|
||||||
@path = path
|
|
||||||
@repo_is_bare = options[:repo_is_bare]
|
# Use .fetch instead of ||
|
||||||
@page_file_dir = options[:page_file_dir]
|
#
|
||||||
@access = options[:access] || GitAccess.new(path, @page_file_dir, @repo_is_bare)
|
# o = { :a => false }
|
||||||
@base_path = options[:base_path] || "/"
|
# o[:a] || true # => true
|
||||||
@page_class = options[:page_class] || self.class.page_class
|
# o.fetch :a, true # => false
|
||||||
@file_class = options[:file_class] || self.class.file_class
|
|
||||||
@markup_classes = options[:markup_classes] || self.class.markup_classes
|
@path = path
|
||||||
@repo = @access.repo
|
@repo_is_bare = options.fetch :repo_is_bare, nil
|
||||||
@ref = options[:ref] || self.class.default_ref
|
@page_file_dir = options.fetch :page_file_dir, nil
|
||||||
@sanitization = options[:sanitization] || self.class.sanitization
|
@access = options.fetch :access, GitAccess.new(path, @page_file_dir, @repo_is_bare)
|
||||||
@ws_subs = options[:ws_subs] ||
|
@base_path = options.fetch :base_path, "/"
|
||||||
self.class.default_ws_subs
|
@page_class = options.fetch :page_class, self.class.page_class
|
||||||
@history_sanitization = options[:history_sanitization] ||
|
@file_class = options.fetch :file_class, self.class.file_class
|
||||||
self.class.history_sanitization
|
@markup_classes = options.fetch :markup_classes, self.class.markup_classes
|
||||||
@live_preview = options.fetch(:live_preview, true)
|
@repo = @access.repo
|
||||||
@universal_toc = options.fetch(:universal_toc, false)
|
@ref = options.fetch :ref, self.class.default_ref
|
||||||
@mathjax = options[:mathjax] || false
|
@sanitization = options.fetch :sanitization, self.class.sanitization
|
||||||
@show_all = options[:show_all] || false
|
@ws_subs = options.fetch :ws_subs, self.class.default_ws_subs
|
||||||
@collapse_tree = options[:collapse_tree] || false
|
@history_sanitization = options.fetch :history_sanitization, self.class.history_sanitization
|
||||||
|
@live_preview = options.fetch :live_preview, true
|
||||||
|
@universal_toc = options.fetch :universal_toc, false
|
||||||
|
@mathjax = options.fetch :mathjax, false
|
||||||
|
@show_all = options.fetch :show_all, false
|
||||||
|
@collapse_tree = options.fetch :collapse_tree, false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: check whether the wiki's git repo exists on the filesystem.
|
# Public: check whether the wiki's git repo exists on the filesystem.
|
||||||
|
|||||||
+16
-3
@@ -212,7 +212,20 @@ context "Markup" do
|
|||||||
assert_equal expected, output
|
assert_equal expected, output
|
||||||
end
|
end
|
||||||
|
|
||||||
test "tilda code blocks #537" do
|
# Issue #568
|
||||||
|
test "tilde code blocks without a language" do
|
||||||
|
page = 'test_rgx'
|
||||||
|
@wiki.write_page(page, :markdown,
|
||||||
|
%Q(~~~
|
||||||
|
'hi'
|
||||||
|
~~~
|
||||||
|
), commit_details)
|
||||||
|
output = @wiki.page(page).formatted_data
|
||||||
|
expected = %Q{<div class=\"highlight\"><pre><span class=\"s\">'hi'</span>\n</pre></div>}
|
||||||
|
assert_equal expected, output
|
||||||
|
end
|
||||||
|
|
||||||
|
test "tilde code blocks #537" do
|
||||||
page = 'test_rgx'
|
page = 'test_rgx'
|
||||||
@wiki.write_page(page, :markdown,
|
@wiki.write_page(page, :markdown,
|
||||||
%Q(~~~ {.ruby}
|
%Q(~~~ {.ruby}
|
||||||
@@ -225,7 +238,7 @@ context "Markup" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Issue #537
|
# Issue #537
|
||||||
test "tilda code blocks with more than one class" do
|
test "tilde code blocks with more than one class" do
|
||||||
page = 'test_rgx'
|
page = 'test_rgx'
|
||||||
@wiki.write_page(page, :markdown,
|
@wiki.write_page(page, :markdown,
|
||||||
%Q(~~~ {#hi .ruby .sauce}
|
%Q(~~~ {#hi .ruby .sauce}
|
||||||
@@ -238,7 +251,7 @@ context "Markup" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Issue #537
|
# Issue #537
|
||||||
test "tilda code blocks with lots of tildes" do
|
test "tilde code blocks with lots of tildes" do
|
||||||
page = 'test_rgx'
|
page = 'test_rgx'
|
||||||
@wiki.write_page(page, :markdown,
|
@wiki.write_page(page, :markdown,
|
||||||
%Q(~~~~~~ {#hi .ruby .sauce}
|
%Q(~~~~~~ {#hi .ruby .sauce}
|
||||||
|
|||||||
Reference in New Issue
Block a user