Add universal_toc wiki option
This commit is contained in:
@@ -113,7 +113,7 @@ module Precious
|
||||
@name = "Preview"
|
||||
@page = wiki.preview_page(@name, params[:content], params[:format])
|
||||
@content = @page.formatted_data
|
||||
@toc_content = @page.toc_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
@editable = false
|
||||
mustache :page
|
||||
end
|
||||
@@ -199,7 +199,7 @@ module Precious
|
||||
@name = name
|
||||
@editable = true
|
||||
@content = page.formatted_data
|
||||
@toc_content = page.toc_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
|
||||
mustache :page
|
||||
elsif file = wiki.file(name)
|
||||
|
||||
@@ -100,6 +100,7 @@ module Gollum
|
||||
def initialize(wiki)
|
||||
@wiki = wiki
|
||||
@blob = @header = @footer = @sidebar = nil
|
||||
@doc = nil
|
||||
end
|
||||
|
||||
# Public: The on-disk filename of the page including extension.
|
||||
|
||||
@@ -133,6 +133,7 @@ module Gollum
|
||||
# path - The String path to the Git repository that holds the Gollum
|
||||
# site.
|
||||
# options - Optional Hash:
|
||||
# :universal_toc - Display table of contents on all pages. Default: false
|
||||
# :base_path - String base path for all Wiki links.
|
||||
# Default: "/"
|
||||
# :page_class - The page Class. Default: Gollum::Page
|
||||
@@ -164,6 +165,7 @@ module Gollum
|
||||
self.class.default_ws_subs
|
||||
@history_sanitization = options[:history_sanitization] ||
|
||||
self.class.history_sanitization
|
||||
@universal_toc = options[:universal_toc] || false
|
||||
end
|
||||
|
||||
# Public: check whether the wiki's git repo exists on the filesystem.
|
||||
@@ -527,6 +529,9 @@ module Gollum
|
||||
# Gets the markup class used by all instances of this Wiki.
|
||||
attr_reader :markup_classes
|
||||
|
||||
# Toggles display of universal table of contents
|
||||
attr_reader :universal_toc
|
||||
|
||||
# Normalize the data.
|
||||
#
|
||||
# data - The String data to be normalized.
|
||||
|
||||
Reference in New Issue
Block a user