Contributing to the Docs¶
These docs are built with MkDocs and the Material for MkDocs theme. Anyone can fix a typo, improve a page, or add new content with a pull request.
Prerequisites¶
- Python 3.10+
- uv (recommended) or
pip - Git
Run the docs locally¶
Then open http://127.0.0.1:8000. The site live-reloads as you edit files under docs/.
Tip
When this docs site is merged into the main potpie repository, the same commands apply — clone that repo and run mkdocs serve from its root.
Project layout¶
mkdocs.yml # site config: theme, nav, plugins, extensions
requirements.txt # docs build dependencies (pinned)
docs/
index.md # landing page
introduction.md # what Potpie is + end-to-end scenario
quickstart.md
concepts/ # context graph, knowledge graph
cli/ # installation, commands, troubleshooting
agents/ # prebuilt + custom agents
tutorials/ # hands-on walkthroughs
api-reference/ # REST API + authentication
internals/ # auto-generated Python API (mkdocstrings)
stylesheets/ # custom CSS (brand colors)
src/potpie/ # sample module for mkdocstrings autodoc demo
Adding a new page¶
- Create the Markdown file under the appropriate folder in
docs/. - Add it to the
nav:section ofmkdocs.yml— pages not listed innavwon't appear in the sidebar. - Run
mkdocs serveand confirm it renders.
Style conventions¶
- Use admonitions for callouts:
!!! note,!!! tip,!!! warning - Use tabbed blocks for alternatives (e.g.
uvvspip) - Link between pages with relative
.mdpaths so links are checked at build time - Show real commands and their expected output, not just prose
- Do not invent product features — if something is unclear in source material, leave a
<!-- TODO: verify -->comment rather than guessing
Before you open a PR¶
Always run a strict build — this is the same check CI runs, and it fails on broken links, missing nav entries, or invalid references:
Fix every warning until it passes clean, then open your pull request.
Deployment model¶
This site uses a source-on-main, published HTML-on-gh-pages split managed by Mike:
| Branch | Contents |
|---|---|
main |
Markdown source (docs/), mkdocs.yml, requirements.txt |
gh-pages |
Versioned built site only (index.html, versions.json, v1.0/, latest/, etc.) |
Generated artifacts do not belong on main:
site/is local build output only and is git-ignoredgh-pages/is an optional local Mike worktree and is git-ignored- only Mike should write published files to the
gh-pagesbranch
CI/CD workflows¶
Two GitHub Actions workflows are expected:
- Docs CI: on every push or PR to
main, runmkdocs build --strictto validate the source docs. - Docs Release: on every push to
main, run Mike to publish the current docs version intogh-pagesand movelatestto it.
This keeps main clean while preserving every published documentation version.
Release workflow¶
Local Mike command¶
To prepare a new stable version locally and move latest to it in your local Mike state:
To publish a version without moving latest:
Key behavior:
./scripts/docs-release.sh v1.0runs a strict build, creates or updates thev1.0/version, pointslatest/at it, and keeps the root default onlatest- add a fourth argument of
trueonly when you intentionally want Mike to push thegh-pagesbranch from your local machine - older versions such as
v1.0/andv1.1/remain intact unless you explicitly delete them with Mike
GitHub Actions release behavior¶
The repository release workflow publishes automatically on every push to main:
- A PR is merged into
main - Docs Release reads
project.versionfrompyproject.toml - It publishes that version as
v<project.version>using Mike - It moves the
latestalias to that published version - Mike writes the generated static site to
gh-pages - Cloudflare Pages redeploys from
gh-pages
Recommended stable release pattern:
v1.0,v1.1,v2.0are immutable version directories once you move on to a newer version numberlatestalways points to the version published from the latest merge tomain- bump
project.versioninpyproject.tomlbefore the first merge for a new docs release line - if you merge multiple PRs without changing
project.version, Mike updates that same version directory instead of creating a new one
Cloudflare Pages¶
Cloudflare Pages should serve the published branch, not rebuild from source:
- Production branch:
gh-pages - Build command: none
- Build output directory:
/
That setup makes Cloudflare serve the exact Mike-generated output, including version folders and versions.json.
If Cloudflare is still building from main, switch it to gh-pages after the release workflow is in use.
Note
The .scratch/ folder (if present) holds read-only clones of source repos used while drafting content. It is git-ignored and never committed.