nirnanaaa / gollum_rails

Integrate Gollum wiki into your Rails app. Continued
GNU Affero General Public License v3.0
43 stars 21 forks source link

multiple wikis? #33

Open akshatpradhan opened 8 years ago

akshatpradhan commented 8 years ago

Can there be multiple wiki's and can multiple users access each wiki?

nirnanaaa commented 8 years ago

Hm this is a design question for a new feature. I can answer your second point with a clear YES. you can set the user and email address of a user for each commit you make to a page. I will look into multiple wikis. What do you think of using something like this?:

class Page1 < GollumRails::Page
    wiki_path '/Path/To/A/wiki.git'
end

class Page2 < GollumRails::Page
    wiki_path '/Path/To/B/wiki'
end

Also please make sure you use the 1.X branch of the gollum_rails gem!

akshatpradhan commented 8 years ago

You need a separate wiki.git for each project? hmm..

gerwitz commented 8 years ago

@akshatpradhan for what it's worth, I have maybe a similar requirement and use a single wiki (one git repository). We use directories to namespace projects, so they can each have "child" pages with similar names.

It's not how Gollum usually works, but it's possible.

nirnanaaa commented 8 years ago

Oh if that is what you need this functionality is already built in to gollum_rails. It was one of the features that took ages to realize but work quite well.

How I works:

You specify a hierarchical path on save(or using special routes for each project for example) and then specify this path while saving a page. Gollum_rails will automatically save it under the specified directory.

If you are not sure about what the hell I am talking about check out my gollum_redmine project it is a working app using the feature you are requesting here.

Sent from my iPhone

On 27 Dec 2015, at 22:06, Hans Gerwitz notifications@github.com wrote:

@akshatpradhan for what it's worth, I have maybe a similar requirement and use a single wiki (one git repository). We use directories to namespace projects, so they can each have "child" pages with similar names.

It's not how Gollum usually works, but it's possible.

— Reply to this email directly or view it on GitHub.

fkasper commented 8 years ago

@akshatpradhan @gerwitz Especially this part is important:

    Page.create!(name: join_params)
    ....
    def join_params
        fn = params[:page][:title]
        File.join(params[:folder]||"", params[:page][:title]).gsub(/^\//, '')
    end

where params[:page][:title] may be "some page name" and folder may be "project-a".