Conversation
Did a full pass on styling, not because I want to finalize our styles, but to convince ourselves the setup here was workable. At least for this simple test case, the code is a little gnarly, but I'm pretty pleased with what's possible, and to me this is actually looking quite good. I think at this point this PR is ready for review and merging! |
'Getting Started': ['Introduction', 'Overview'], | ||
API: [ | ||
'Summary', | ||
{ | ||
label: 'HelloWorldClass', | ||
href: './generated/hello_project.HelloWorldClass', | ||
}, | ||
{ label: 'hello_world', href: './generated/hello_project.hello_world' }, | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to automatically populate the api members here yeah? I see a lot of value in being able to customize the sidebar but perhaps the default behavior could be the same list members that appear in the api.fjson
file
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/carbonplan/test-docs-project/5oh2paPKEUkAxC2ck5v1L2274U8T |
This PR adds a basic next setup to the docs site with routing, etc. The routes
/summary
and/generated/<class>
render contents from thefjson
files generated by Sphinx, all of which I've nested under the "API" category in the sidenav. The routes/index
/overview
and/introduction
just render markdown files under the "Getting Started" category. It's working well! And feels like a pattern many doc sites could follow.Striking out my notes below as they described an earlier version of the approach.
A couple notes/api
is a special reserved page fornext
and there is not yet an option to disable that (see here), but I like the simple url, so, I've named the routeapi-reference
and added a rewrite to render that at/api
. It works, but annoying that we'll have to do that in every docs site. If support for disabling that route ever emerges, we can switch to that and avoid the rewrite.I'm currently rendering thebody
from thefjson
files via<div dangerouslySetInnerHTML={{ __html: body }} />
. Not ideal, but it works. My immediate next step is to find a way to extract that into a form that uses our theme (similar to MDX). Also on my list is adding a basic section nav. Will continue doing those things on this PR until it gets merged.