Skip to content

docs: A new build process #168

Closed
Closed

Description

@thanethomson

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.x and v0.37.x at the moment) only get built when changes are pushed to main.
  • 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:
    1. https://docs.cometbft.com to redirect the user to the latest stable release's documentation (must be configurable).
    2. We must be able to easily configure and build different versions' documentation to different subpaths at https://docs.cometbft.com, e.g.
      1. https://docs.cometbft.com/v0.34/ to host CometBFT v0.34's documentation from the v0.34.x branch.
      2. https://docs.cometbft.com/v0.37/ to host CometBFT v0.37's documentation from the v0.37.x branch.
      3. https://docs.cometbft.com/main/ to host CometBFT's documentation from the main branch.
  • 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, spec and rpc/openapi folders for each release's documentation, e.g.:
    1. https://docs.cometbft.com/v0.34/ should show the contents of the docs folder
    2. https://docs.cometbft.com/v0.34/spec/ should show the contents of the spec folder
    3. https://docs.cometbft.com/v0.34/rpc/ should show the contents of the rpc/openapi folder
    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.34 and v0.37 docs via the version selector, but not the main docs).
  • 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.

Activity

  1. added
    documentation
    on Jan 20, 2023
  2. thanethomson commented on Jan 21, 2023

    @thanethomson
    ContributorAuthor

    Another facet of this to consider is the OpenAPI docs. Pragmatically this currently involves copying the contents of the /rpc/openapi folder 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 /rpc subfolder for each release, e.g. https://docs.tendermint.com/v0.34/rpc/

  3. moved this from Todo to In Progress in CometBFT 2023on Jan 31, 2023
  4. aaronmw commented on Feb 2, 2023

    @aaronmw

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

  5. andynog commented on Feb 10, 2023

    @andynog
    Contributor

    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.

  6. andynog commented on Feb 22, 2023

    @andynog
    Contributor

    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.

  7. thanethomson commented on Feb 22, 2023

    @thanethomson
    ContributorAuthor

    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.

  8. andynog commented on Feb 22, 2023

    @andynog
    Contributor

    agreed, let's wait the production deploy and when https://docs.cometbft.com is live and is continually deploying we can close it.

  9. added this to the 2023-Q1 milestone on Feb 25, 2023
  10. thanethomson commented on Feb 27, 2023

    @thanethomson
    ContributorAuthor
  11. moved this from In Progress to Done in CometBFT 2023on Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentation

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions