Merge pull request #973 from hsanson/add-plantuml-opt
Add option to configure PlantUML endpoint
This commit is contained in:
+17
@@ -124,6 +124,10 @@ opts = OptionParser.new do |opts|
|
|||||||
opts.on("--h1-title", "Sets page title to value of first h1") do
|
opts.on("--h1-title", "Sets page title to value of first h1") do
|
||||||
wiki_options[:h1_title] = true
|
wiki_options[:h1_title] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("--plantuml-url [URL]", "Sets the PlantUML server endpoint.") do |url|
|
||||||
|
wiki_options[:plantuml_url] = url
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Read command line options into `options` hash
|
# Read command line options into `options` hash
|
||||||
@@ -171,6 +175,12 @@ if options['irb']
|
|||||||
if !wiki.exist? then
|
if !wiki.exist? then
|
||||||
raise Gollum::InvalidGitRepositoryError
|
raise Gollum::InvalidGitRepositoryError
|
||||||
end
|
end
|
||||||
|
if wiki_options[:plantuml_url]
|
||||||
|
Gollum::Filter::PlantUML.configure do |config|
|
||||||
|
puts "Using #{wiki_options[:plantuml_url]} as PlantUML endpoint"
|
||||||
|
config.url = wiki_options[:plantuml_url]
|
||||||
|
end
|
||||||
|
end
|
||||||
puts "Loaded Gollum wiki at #{File.expand_path(gollum_path).inspect}."
|
puts "Loaded Gollum wiki at #{File.expand_path(gollum_path).inspect}."
|
||||||
puts
|
puts
|
||||||
puts %( page = wiki.page('page-name'))
|
puts %( page = wiki.page('page-name'))
|
||||||
@@ -201,6 +211,13 @@ else
|
|||||||
require cfg
|
require cfg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if wiki_options[:plantuml_url]
|
||||||
|
Gollum::Filter::PlantUML.configure do |config|
|
||||||
|
puts "Using #{wiki_options[:plantuml_url]} as PlantUML endpoint"
|
||||||
|
config.url = wiki_options[:plantuml_url]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
base_path = wiki_options[:base_path]
|
base_path = wiki_options[:base_path]
|
||||||
|
|
||||||
if wiki_options[:base_path].nil?
|
if wiki_options[:base_path].nil?
|
||||||
|
|||||||
Reference in New Issue
Block a user