From 1cceb7d4b444c0b117430e6579837c430a72080b Mon Sep 17 00:00:00 2001 From: Horacio Sanson Date: Thu, 5 Feb 2015 01:05:30 +0900 Subject: [PATCH] Add option to configure PlantUML endpoint --- bin/gollum | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/gollum b/bin/gollum index 9a5f32cc..9eb55f75 100755 --- a/bin/gollum +++ b/bin/gollum @@ -120,6 +120,10 @@ opts = OptionParser.new do |opts| opts.on("--h1-title", "Sets page title to value of first h1") do wiki_options[:h1_title] = true end + + opts.on("--plantuml-url [URL]", "Sets the PlantUML server endpoint.") do |url| + wiki_options[:plantuml_url] = url + end end # Read command line options into `options` hash @@ -167,6 +171,12 @@ if options['irb'] if !wiki.exist? then raise Gollum::InvalidGitRepositoryError 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 puts %( page = wiki.page('page-name')) @@ -197,6 +207,13 @@ else require cfg 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] if wiki_options[:base_path].nil?