diff --git a/bin/gollum b/bin/gollum index d8b130bb..48440f9f 100755 --- a/bin/gollum +++ b/bin/gollum @@ -145,6 +145,9 @@ MSG "If not specified, uses the '/mathjax.config.js' file.") do |file| wiki_options[:mathjax_config] = file || 'mathjax.config.js' end + opts.on("--plantuml-url [URL]", "Sets the PlantUML server endpoint.") do |url| + wiki_options[:plantuml_url] = url + end opts.on("--template-dir [PATH]", "Specify custom mustache template directory.") do |path| wiki_options[:template_dir] = path end @@ -245,6 +248,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 base_path.nil? diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index 00ba6a74..cba879ac 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -97,6 +97,7 @@ module Precious before do settings.wiki_options[:allow_editing] = settings.wiki_options.fetch(:allow_editing, true) @allow_editing = settings.wiki_options[:allow_editing] + forbid unless @allow_editing || request.request_method == "GET" Precious::App.set(:mustache, {:templates => settings.wiki_options[:template_dir]}) if settings.wiki_options[:template_dir] @base_url = url('/', false).chomp('/')