Add --collapse-tree command line option
This commit is contained in:
@@ -72,6 +72,10 @@ opts = OptionParser.new do |opts|
|
|||||||
opts.on("--show-all", "Shows all files in file view. By default only valid pages are shown.") do
|
opts.on("--show-all", "Shows all files in file view. By default only valid pages are shown.") do
|
||||||
wiki_options[:show_all] = true
|
wiki_options[:show_all] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("--collapse-tree", "Collapse file view tree. By default, expanded tree is shown.") do
|
||||||
|
wiki_options[:collapse_tree] = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Read command line options into `options` hash
|
# Read command line options into `options` hash
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ module Precious
|
|||||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||||
show_all = settings.wiki_options[:show_all]
|
show_all = settings.wiki_options[:show_all]
|
||||||
# if showing all files include wiki.files
|
# if showing all files include wiki.files
|
||||||
@results = show_all ? Gollum::FileView.new(wiki.pages + wiki.files, show_all).render_files :
|
@results = show_all ? Gollum::FileView.new(wiki.pages + wiki.files, settings.wiki_options).render_files :
|
||||||
Gollum::FileView.new(wiki.pages).render_files
|
Gollum::FileView.new(wiki.pages).render_files
|
||||||
@ref = wiki.ref
|
@ref = wiki.ref
|
||||||
mustache :file_view, { :layout => false }
|
mustache :file_view, { :layout => false }
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ module Gollum
|
|||||||
# :mathjax - Set to false to disable mathjax.
|
# :mathjax - Set to false to disable mathjax.
|
||||||
# :show_all - Show all files in file view, not just valid pages.
|
# :show_all - Show all files in file view, not just valid pages.
|
||||||
# Default: false
|
# Default: false
|
||||||
|
# :collapse_tree - Start with collapsed file view. Default: false
|
||||||
#
|
#
|
||||||
# Returns a fresh Gollum::Repo.
|
# Returns a fresh Gollum::Repo.
|
||||||
def initialize(path, options = {})
|
def initialize(path, options = {})
|
||||||
@@ -183,6 +184,7 @@ module Gollum
|
|||||||
@universal_toc = options.fetch(:universal_toc, false)
|
@universal_toc = options.fetch(:universal_toc, false)
|
||||||
@mathjax = options[:mathjax] || false
|
@mathjax = options[:mathjax] || false
|
||||||
@show_all = options[:show_all] || false
|
@show_all = options[:show_all] || false
|
||||||
|
@collapse_tree = options[: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.
|
||||||
|
|||||||
Reference in New Issue
Block a user