Coder Social home page Coder Social logo

Two document roots? about apitome HOT 14 OPEN

jejacks0n avatar jejacks0n commented on June 2, 2024
Two document roots?

from apitome.

Comments (14)

jejacks0n avatar jejacks0n commented on June 2, 2024

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.

corbanb avatar corbanb commented on June 2, 2024

@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.

curtisolson avatar curtisolson commented on June 2, 2024

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.

einSelbst avatar einSelbst commented on June 2, 2024

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.

jejacks0n avatar jejacks0n commented on June 2, 2024

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

from apitome.

kevintraver avatar kevintraver commented on June 2, 2024

👍

from apitome.

rpocklin avatar rpocklin commented on June 2, 2024

I'd really love to see this feature :)

from apitome.

ceritium avatar ceritium commented on June 2, 2024

+1

from apitome.

openface avatar openface commented on June 2, 2024

+1

from apitome.

acrogenesis avatar acrogenesis commented on June 2, 2024

This would be awesome 👍

from apitome.

andyhite avatar andyhite commented on June 2, 2024

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.

lovishchoudhary avatar lovishchoudhary commented on June 2, 2024

Any way to implement this multiple roots things in apitome ?

from apitome.

RaviAsnani avatar RaviAsnani commented on June 2, 2024

+1

from apitome.

andyhite avatar andyhite commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.