Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f1c523aa30 | |||
| 87c08f5613 | |||
| 82913cea20 |
@@ -413,7 +413,10 @@ By default, internal wiki links are all absolute from the root. To specify a dif
|
|||||||
|
|
||||||
wiki = Gollum::Wiki.new("my-gollum-repo.git", :base_path => "/wiki")
|
wiki = Gollum::Wiki.new("my-gollum-repo.git", :base_path => "/wiki")
|
||||||
|
|
||||||
Note that base_path just modifies the links. To map gollum to a non-root location, use `map` in config.ru. See [#532](https://github.com/github/gollum/issues/532). `bin/gollum` now includes a simple map based on base path.
|
Note that base_path just modifies the links. To map gollum to a non-root location:
|
||||||
|
|
||||||
|
- Use the gollum binary: `gollum path/to/wiki --base-path mywiki`
|
||||||
|
- Define config.ru with `map`. See [#532](https://github.com/github/gollum/issues/532) for an example.
|
||||||
|
|
||||||
> :base_path - String base path for all Wiki links.
|
> :base_path - String base path for all Wiki links.
|
||||||
>
|
>
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ 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.2.8'
|
s.version = '2.2.9'
|
||||||
s.date = '2012-10-14'
|
s.date = '2012-10-14'
|
||||||
s.rubyforge_project = 'gollum'
|
s.rubyforge_project = 'gollum'
|
||||||
|
|
||||||
|
|||||||
+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.2.8'
|
VERSION = '2.2.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__))
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ module Gollum
|
|||||||
def process_headers(doc)
|
def process_headers(doc)
|
||||||
toc = nil
|
toc = nil
|
||||||
doc.css('h1,h2,h3,h4,h5,h6').each do |h|
|
doc.css('h1,h2,h3,h4,h5,h6').each do |h|
|
||||||
h_name = h.content.gsub(' ','-')
|
# must escape "
|
||||||
|
h_name = h.content.gsub(' ','-').gsub('"','%22')
|
||||||
|
|
||||||
level = h.name.gsub(/[hH]/,'').to_i
|
level = h.name.gsub(/[hH]/,'').to_i
|
||||||
|
|
||||||
|
|||||||
@@ -42,21 +42,21 @@ context "Unicode Support" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "create and read non-latin page with anchor 2" do
|
test "create and read non-latin page with anchor 2" do
|
||||||
@wiki.write_page("test", :markdown, "# La faune d'Édiacara")
|
@wiki.write_page("test", :markdown, "# \"La\" faune d'Édiacara")
|
||||||
|
|
||||||
page = @wiki.page("test")
|
page = @wiki.page("test")
|
||||||
assert_equal Gollum::Page, page.class
|
assert_equal Gollum::Page, page.class
|
||||||
assert_equal "# La faune d'Édiacara", utf8(page.raw_data)
|
assert_equal "# \"La\" faune d'Édiacara", utf8(page.raw_data)
|
||||||
|
|
||||||
# markup.rb
|
# markup.rb test: ', ", É
|
||||||
doc = Nokogiri::HTML page.formatted_data
|
doc = Nokogiri::HTML page.formatted_data
|
||||||
h1s = doc / :h1
|
h1s = doc / :h1
|
||||||
h1 = h1s.first
|
h1 = h1s.first
|
||||||
anchors = h1 / :a
|
anchors = h1 / :a
|
||||||
assert_equal 1, h1s.size
|
assert_equal 1, h1s.size
|
||||||
assert_equal 1, anchors.size
|
assert_equal 1, anchors.size
|
||||||
assert_equal %q(#La-faune-d'Édiacara), anchors[0]['href']
|
assert_equal %q(#%22La%22-faune-d'Édiacara), anchors[0]['href']
|
||||||
assert_equal %q(La-faune-d'Édiacara), anchors[0]['id']
|
assert_equal %q(%22La%22-faune-d'Édiacara), anchors[0]['id']
|
||||||
assert_equal 'anchor', anchors[0]['class']
|
assert_equal 'anchor', anchors[0]['class']
|
||||||
assert_equal '', anchors[0].text
|
assert_equal '', anchors[0].text
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user