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

Two document roots? #16

Open
curtisolson opened this issue Apr 28, 2014 · 14 comments
Open

Two document roots? #16

curtisolson opened this issue Apr 28, 2014 · 14 comments

Comments

@curtisolson
Copy link

RAD allows you to create groups and send those Examples to different folders. I'd like to be able to support a Public and a Private folder with a separate README.md for each. Is that possible?

@jejacks0n
Copy link
Owner

No, it didn't take that into account. So, configuration would need to change to have groupings, and then the controller would need to pull out the "group" from the url. This isn't that hard technically, but there's probably a decent amount of code for it.. not a trivial pull request.

I do something very much like this for Teaspoon, so I know what's involved. Sorry I didn't think about it, but I'd be happy to take a pull request.

@corbanb
Copy link

corbanb commented Jul 22, 2014

@curtisolson did you happen to think through this? I am looking to do the same but for 2 versions of the api and potentially a public and private for the version 2 of the api.

@curtisolson
Copy link
Author

Just getting back to this. What I did was use apitome for my public documentation and then just generated my other documentation in HTML format. I used groups to generate multiple groups and only 1 is in json format.

My group structure. My HTML docs will include all versions of the API. Public/private and all versions of the API. This will be a good check to know when a new change breaks a previous version of the API.

public - json
publisher v2 - html (just a copy of public. see versioning comment below)
publisher v3 - html
terminal v2 - html
terminal v3 - html

Sample group statements in spec_helper.rb

config.define_group :public do |config|
  config.format = [:json]
  config.filter = :public
end
config.define_group :publisher_v2 do |config|
  config.format = [:html]
  config.filter = :publisher_v2
end

In my examples, I have

:document => [:public, :publisher_v2]
and
:document => [:publisher_v3]

When we are ready to publish V3 of the API, I'll just move the public tag to the V3 calls.

I am seeing weirdness with the sorting. I originally wanted to control the orders of the calls, but the multiple groups seems to introduce a bug with sorting. I'm now using alphabetical sorting, but now what I wanted.

@einSelbst
Copy link

Would it be possible to base this feature on the RAD variable config.api_name if this would be specifically set in a way like this:

  config.define_group :v1 do |config|
    config.filter = :v1
    config.docs_dir = Rails.root.join("doc", "api", "v1")
    config.api_name = "API V1"
  end

  config.define_group :v2 do |config|
    config.filter = :v2
    config.docs_dir = Rails.root.join("doc", "api", "v2")
    config.api_name = "API V2"
  end

Maybe this way one wouldn't need to pull out the "group" from the url?

@jejacks0n
Copy link
Owner

that sounds reasonable. would take a pull request. =)

@kevintraver
Copy link
Contributor

👍

@rpocklin
Copy link
Contributor

I'd really love to see this feature :)

@ceritium
Copy link

+1

1 similar comment
@openface
Copy link

+1

@acrogenesis
Copy link
Contributor

This would be awesome 👍

@andyhite
Copy link

I've submitted a pull request that addresses this, but in a slightly different way than recommended in this comment.

Here's the pull request: #65, with instructions in the description.

@lovishchoudhary
Copy link

Any way to implement this multiple roots things in apitome ?

@RaviAsnani
Copy link

+1

@andyhite
Copy link

The pull request I linked previously contains a way to do this, but it seems like no PRs are being merged any time soon...if you absolutely need it, you can use my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests