Comments (14)
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.
from apitome.
@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.
from apitome.
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.
from apitome.
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?
from apitome.
that sounds reasonable. would take a pull request. =)
from apitome.
👍
from apitome.
I'd really love to see this feature :)
from apitome.
+1
from apitome.
+1
from apitome.
This would be awesome 👍
from apitome.
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.
from apitome.
Any way to implement this multiple roots things in apitome ?
from apitome.
+1
from apitome.
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.
from apitome.
Related Issues (20)
- rails generate apitome:install fails - undefined method `assets' HOT 5
- [DOCS] Link to customization examples broken HOT 1
- non-latin characters support HOT 3
- Seeing undefined method 'simulated path' HOT 2
- Does it work with Sprockets 4? HOT 1
- JSON::ParserError in Apitome::Docs#index HOT 16
- Re-routing not working? HOT 1
- code_theme not respecting underscore
- Ruby 3.0.0 HOT 8
- Upgrade jQuery to v3
- Upgrade highlightjs HOT 1
- Translation namespace HOT 5
- Remove rspec_api_documentation from runtime dependency
- New gem version HOT 19
- Missing template apitome/docs/simulate HOT 2
- Left-navigation not highlighting correctly sometimes HOT 7
- There is no configuration option as "parent_controller"? HOT 1
- undefined local variable or method apitome `apitome' after upgrading to 0.2.0 HOT 12
- NameError: uninitialized constant Apitome HOT 8
- Sidebar disappears when placed in layout. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apitome.