Building, running, and deploying the docs¶
This page is for contributors who edit the catalogue itself. The runtime users of Mongoose Plugins can skip it.
Stack¶
| Component | Version | Purpose |
|---|---|---|
| MkDocs | 1.6.x | Static site generator |
| Material for MkDocs | 9.5.x | Theme + grid-cards + tabs |
| pymdown-extensions | 10.14.x | Tabbed code, admonitions, etc. |
| Pygments | 2.18.x | Syntax highlighting |
| Python | 3.10+ | Build runtime |
All locked in docs-requirements.txt.
One-shot local build¶
From the repo root:
python3 -m venv .venv
source .venv/bin/activate
pip install -r docs-requirements.txt
mkdocs build --strict
The site lands in site/. Open site/index.html to inspect, or serve it (next section).
--strict turns broken-link / nav-mismatch warnings into errors — same flag CI uses.
Live-reload dev server¶
Then browse to http://127.0.0.1:8000. The server watches docs/, mkdocs.yml, and docs/stylesheets/extra.css — saves re-render the page in your browser within a second.
Bind to a different port or host:
Repository layout¶
mongoose-plugins/
├── mkdocs.yml ← site config + nav tree
├── docs-requirements.txt ← pinned Python deps
├── docs/
│ ├── index.md ← landing
│ ├── getting-started.md
│ ├── architecture.md
│ ├── operations.md
│ ├── contributing-docs.md ← this page
│ ├── stylesheets/
│ │ └── extra.css ← cards, tags, hero styling
│ ├── connectors/
│ │ ├── index.md
│ │ ├── aeron.md
│ │ ├── chronicle.md
│ │ ├── file.md
│ │ ├── kafka.md
│ │ └── multicast.md
│ ├── services/
│ │ ├── index.md
│ │ ├── admin-rest.md
│ │ ├── admin-telnet.md
│ │ ├── admin-web.md
│ │ ├── cache.md
│ │ ├── jdbc.md
│ │ ├── loader-yaml.md
│ │ └── loader-spring.md
│ └── libraries/
│ ├── index.md
│ └── jsonserialiser.md
├── site/ ← build output (gitignored)
└── .github/workflows/docs.yml ← CI deploy
Editorial conventions¶
- One page per plugin. Mirror the structure of
docs/connectors/aeron.md: tag bar, dependency snippet, samples in tabs, config table, operational notes, source link. - Tags are stylable classes — pick from
source,sink,service,library,lowlat,replay,broker,persist. Add new ones toextra.cssif you need them. - Code samples use fenced blocks with explicit language hints (
```yaml,```java,```bash). - Tabbed alternates (YAML / Java / Spring XML for the same config) use
pymdownx.tabbed: - Admonitions (
!!! tip,!!! warning) are sparing — only when the reader is likely to make a mistake.
Adding a new plugin to the catalogue¶
- Drop a new page under
docs/connectors/<name>.md(orservices/,libraries/). - Register it in the nav tree in
mkdocs.ymlunder the matching section. - Add a card to
docs/index.mdunder the right<div class="grid cards">block. - Add a card to the category index page (
docs/connectors/index.mdetc.). - Run
mkdocs build --strictto confirm no broken links.
Deploying to GitHub Pages¶
Automated (CI)¶
Every push to main that touches docs/, mkdocs.yml, or the workflow itself triggers .github/workflows/docs.yml. It:
- Checks out the repo with full history (needed by
mkdocs gh-deploy). - Sets up Python 3, caches
pipagainstdocs-requirements.txt. - Installs deps.
- Runs
mkdocs build --strictto fail-fast on any link/nav error. - Runs
mkdocs gh-deploy --forceto push the built site to thegh-pagesbranch.
GitHub Pages serves the gh-pages branch automatically — make sure that branch is selected in Settings → Pages → Source for the repo.
The workflow uses permissions: contents: write (no PAT needed) and runs on ubuntu-latest.
Manual deploy¶
If you need to push the site immediately, from the repo root:
This builds the site, commits it to the gh-pages branch, and pushes. You'll need write access to the repo.
--force overwrites the gh-pages branch history; the source main branch is unaffected.
First-time setup¶
When deploying to a fresh repo:
- Push the
mkdocs.yml,docs/, and workflow tomain. - Either let the CI run, or run
mkdocs gh-deploy --forceonce locally to seed thegh-pagesbranch. - In GitHub: Settings → Pages → Source → Deploy from a branch →
gh-pages// (root). - Wait ~30 s for the first build. The catalogue lands at
https://<org>.github.io/<repo>/.
For a custom domain, add a docs/CNAME file containing the domain name; mkdocs gh-deploy will copy it through.
Troubleshooting¶
AttributeError: 'NoneType' object has no attribute 'replace'¶
Pygments / pymdown-extensions version skew. Reinstall from the pinned docs-requirements.txt:
mkdocs build --strict fails on broken link¶
Usually a stale entry in mkdocs.yml nav, or a [link](target.md) whose target you've renamed. Run without --strict to see all warnings at once:
Fix each warning, then re-run with --strict.
CSS edits don't appear in dev server¶
The dev server caches the CSS — hard-refresh the browser (Cmd-Shift-R on macOS, Ctrl-Shift-R elsewhere) or restart mkdocs serve.
Build is slow¶
Disable the search plugin in mkdocs.yml while iterating — it indexes every page on every save. Re-enable before committing.