Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to use a per repository config file #15

Closed
okbreathe opened this issue Aug 16, 2010 · 5 comments
Closed

Add ability to use a per repository config file #15

okbreathe opened this issue Aug 16, 2010 · 5 comments
Labels

Comments

@okbreathe
Copy link

It would make it a bit easier to extend Gollum without having to mess with core. I'm thinking along the lines of a app.rb or config.rb file that gets added to the repo that will be read by Gollum when using the web-interface.

@mojombo
Copy link
Contributor

mojombo commented Aug 16, 2010

Can you explain what kind of customization you'd want to do with this?

@okbreathe
Copy link
Author

I'm just thinking of a plain ruby file where one could pull in additional dependencies, add routes/templates etc. to the sintra instance.

Looking at http://github.com/github/gollum/issues/#issue/13 - I think over time people will want little bits of extra functionality added here and there, and I'm not aware of a way to currently do that without maintaining your own fork (or bloating the core).

Perhaps overtime additional functional could be incorporated into a Gollum::More type package.

@andrewheiss
Copy link

Agreed. The ability to extend Jekyll made it incredibly useful—I was finally able to drop my fork and stick with the core. Some type of system that would allow basic customizations, like ToC generators or listings of all the files in the repo (like the MediaWiki enhancements listed in issue 13 above) would be fantastic.

@okbreathe
Copy link
Author

Would something like this work:

gollum --config /path/to/my/config.rb

Patch Ahead:

diff --git a/bin/gollum b/bin/gollum
index 86ac762..b2a9c37 100755
--- a/bin/gollum
+++ b/bin/gollum
@@ -35,6 +35,10 @@ opts = OptionParser.new do |opts|
     exit 0
   end

+  opts.on("--config [CONFIG]", "Path to additional configuration file") do |config|
+    options['config'] = config
+  end
+
   opts.on("--irb", "Start an irb process with gollum loaded for the current wiki.") do
     options['irb'] = true
   end
@@ -99,5 +103,10 @@ if options['irb']
 else
   require 'gollum/frontend/app'
   Precious::App.set(:gollum_path, gollum_path)
+  if cfg = options['config']
+    # If the path begins with a / it will be considered an absolute path, otherwise it will relative to the CWD
+    cfg = File.join(Dir.getwd, cfg) unless cfg.slice(0) == File::SEPARATOR 
+    require cfg
+  end
   Precious::App.run!(options)
 end

@technoweenie
Copy link
Contributor

Fixed!

dometto pushed a commit that referenced this issue Jan 8, 2023
dometto pushed a commit that referenced this issue Jan 8, 2023
New implementation of ls_tree. Fixes #15.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants