docusaurus-plugin-react-docgen-typescript
docusaurus-plugin-react-docgen-typescript copied to clipboard
Auto-generate routes for components
Fixes #5.
I set an addRoute to create a route for each component, plus an index route.
These routes are wrapped by some layout components:
- ReactDocLayout, which is basically a simplified copy of DocPageContent, that adds the navbar and a custom sidebar (I was unable to embed the routes into the existing sidebar automatically)
- ReactComponentPage, which is the root route, calling the layout and rendering the children properly
- ReactComponentItem, which is the component docs itself
The user can enable this behavior with a createRoutes flag, and also set a baseRoute route, in which the routes/links will be created.
Some screenshots of a local execution:
React docs home page:

React component docs:

@atomicpages, could you help me on how to proceed with global or route flags? I implemented the createRoutes behavior only on the else branch (no global and no route).
Hello there! I saw this MR and it's exactly what I need to document an SDK that my team is working on.
Are there any plans on merging this one?
cc @atomicpages
👋 howdy, I'll dig into this more later in the week
I think this PR deserve a merge :+1: