reactioncommerce / redoc

redoc - generate documentation from multiple project repos.
GNU General Public License v3.0
20 stars 11 forks source link

Load toc from repository #28

Closed marceloschmidt closed 8 years ago

marceloschmidt commented 8 years ago

With this PR, Redoc will fetch the TOC from the repository folders and files structure when tocData doesn't exist, i.e., remove the tocData section from the private/redoc.json or the initialRepoData. Ex.:

{
  "repos": [{
    "org": "RocketChat",
    "repo": "Rocket.Chat.Docs",
    "label": "Rocket.Chat Docs",
    "description": "Rocket.Chat Documentation"
  }]
}

The Redoc will mirror GitHub structure. Each folder becomes a main nav item. Each .md file becomes a sub-nav item. If the folder contains a README.md, this becomes the content for the main item.

image

image

aaronjudd commented 8 years ago

:+1: looks like it should work with multiple repos as well.. we've been talking about an ignore setting as well, and @mikemurray is adding a publishing admin right now so this should work nicely with that functionality..

jshimko commented 8 years ago

:+1:

Can we maybe grab that underscorestring:underscore.string directly from NPM though? Now that we're using 1.3, we're generally trying to use NPM instead of Atmosphere whenever it's an option.

https://www.npmjs.com/package/underscore.string

marceloschmidt commented 8 years ago

Ah, nice catch! Yes, let me do this and update this PR. I'll also include restivus for auto-updating via webhooks whenever the repository changes.

marceloschmidt commented 8 years ago

With the latest commit, if configured, every time someone updates the docs repository github will make an api call to update the docs, thus removing the need for manual or crond updates.