Repository navigation
Closed
Description
Our existing documentation build process is ugly, hacky and brittle, and suffers from several problems:
- It's set up in such a way that changes on release branches (
v0.34.xandv0.37.xat the moment) only get built when changes are pushed tomain. - Any changes to the build process and theme need to be backported across multiple branches, instead of being managed in a single place.
My recommendation is to split our docs build process out of the main repo into its own repo (https://github.com/cometbft/cometbft-docs), and there we would host:
- 1. Any code/config needed to build the docs (the static site generator config, theme, etc.).
- 2. Workflow(s) to build and push each version's documentation. What we ultimately want is:
https://docs.cometbft.comto redirect the user to the latest stable release's documentation (must be configurable).- We must be able to easily configure and build different versions' documentation to different subpaths at https://docs.cometbft.com, e.g.
https://docs.cometbft.com/v0.34/to host CometBFT v0.34's documentation from thev0.34.xbranch.https://docs.cometbft.com/v0.37/to host CometBFT v0.37's documentation from thev0.37.xbranch.https://docs.cometbft.com/main/to host CometBFT's documentation from themainbranch.
- 3. The config that controls which versions should be built should ideally be located in a single file (i.e. single source of truth).
- 4. We need to build the documentation from the
docs,specandrpc/openapifolders for each release's documentation, e.g.:
1.https://docs.cometbft.com/v0.34/should show the contents of thedocsfolder
2.https://docs.cometbft.com/v0.34/spec/should show the contents of thespecfolder
3.https://docs.cometbft.com/v0.34/rpc/should show the contents of therpc/openapifolder
4. All of these different docs must be available via the documentation navigation. - 5. We need a version dropdown selector on the docs site that allows users to choose which version's documentation they want to read.
- 6. We need to be able to control which versions' documentation actually appears in that dropdown selector (i.e. we may want to expose the
v0.34andv0.37docs via the version selector, but not themaindocs). - 7. We need to be able to search the documentation for each version separately (i.e. when searching while viewing the v0.34 docs, it should only return results for v0.34; when searching while viewing the v0.37 docs, it should only return results for v0.37; etc.)
- 8. There should be a way for us to trigger this rebuild in the docs repo every time we make changes to the docs in the main CometBFT repo. At the very least we could set up a cron job that executes this on a daily basis, as well as a manual workflow dispatch that would allow for manually triggering a docs site rebuild.
@aaronmw's kindly rethemed our docs site in #125, so I suspect that some of this would move across to the cometbft-docs repo if we go this route.
Reacted by Adi Seredinschi and Daniel
Metadata
Metadata
Labels
documentationImprovements or additions to documentation
Type
Projects
- StatusShow more project fieldsDone
Activity
thanethomson commentedon Jan 21, 2023
Another facet of this to consider is the OpenAPI docs. Pragmatically this currently involves copying the contents of the
/rpc/openapifolder for each branch (e.g. https://github.com/cometbft/cometbft/tree/main/rpc/openapi) somewhere accessible during the docs build process.The way it worked in the Tendermint Core repository was to copy these files into a
/rpcsubfolder for each release, e.g. https://docs.tendermint.com/v0.34/rpc/aaronmw commentedon Feb 2, 2023
@thanethomson A good bunch of the points you listed in the original description have been addressed by the new docs site, no? Can we refresh the list with remaining issues?
andynog commentedon Feb 10, 2023
I think we should put checkboxes in each item for track completion. I'll do that next week to ensure this is completed. I believe we're pretty much done with most of the items but it will be visually easier to see this way.
andynog commentedon Feb 22, 2023
Hi @thanethomson, @aaronmw and I implemented all the items specified on this issue. Not sure how you want to close this, but one idea would be to associate it with the PR #368, or you can manually close this just before we deploy the site to
docs.cometbft.com. Please let us know if you think anything is missing.thanethomson commentedon Feb 22, 2023
Cool! I'd suggest a good "definition of done" here to be that the docs are up and available at https://docs.cometbft.com/ for both v0.34.x and v0.37.x, and those docs are deployed from https://github.com/cometbft/cometbft-docs (right now you're still deploying to the staging site, right?).
Any further improvements can be tackled in follow-up issues.
andynog commentedon Feb 22, 2023
agreed, let's wait the production deploy and when https://docs.cometbft.com is live and is continually deploying we can close it.
thanethomson commentedon Feb 27, 2023
I'd consider this done now that https://docs.cometbft.com is up 👍