Documentation
The purpose of this internal documentation is to centralize our knowledge base across the Dev Team.
How to add documentation?
- Go to the
api/internal-docs/docsfolder of the source code inside theapirepository. - Add your markdown in a
dir. Each dir represents a group on the sidebar and each markdown file represents a sub-section in that group. - Make sure to add the
_category_.jsonfile inside the folder, for the section's metadata. - At the top-level of each markdown file make sure to add the
sidebar_position:to properly order the sub-sections - If you need to add
imagesto your docs, insideinternal-docs/docs/imgfolder, create a newdirfor your section and add all your images there. Inside your markdowns you can reference the images you added by their relative path.
How documentations are deployed/published?
When you open a PR that includes internal-docs/docs changes, Cloudflare will handle building the docs.
Any errors or failed builds will be flagged in the PR's preview.
Once the PR is merged to origin/main, Cloudflare will handle deployment.
Best Practice for writing internal docs for the team
- Keep documentation short and easy to read; include diagrams (flowcharts, use cases, UML, sequences, ...) using
mermaid. - If the feature you are documenting is large, divide the documentation into multiple short sections.
- You can include documentation for a feature you are working on in the same branch/PR. Once the branch is merged, the documentation will be automatically deployed.
- For features that are already merged and you need to add docs later, open a new branch/PR that only has the
internal-docschanges. Try to keep large code changes separate by function and service in theapirepository. - Don't make AI write all your documentation; try to use your own wording and simple expressions to break down technical jargon.
- Inform the Dev Team when a new documentation folder is added to share knowledge.