Skip to main content

pi-docsite

Deterministic static documentation site generator for Markdown projects.

Renders a directory of *.md into a static HTML site with sidebar navigation, full-text search, llms.txt / llms-full.txt for LLM consumption, and a search index. No configuration file, no build config, no framework.

Vendored from myk-org/pi-config, where it generates that project's own docs.

Use

No install needed — uvx runs it in an ephemeral environment:

uvx pi-docsite --docs-dir docs --tagline "One line describing this project"

From a checkout of this repository:

uv run --package pi-docsite pi-docsite --docs-dir docs

Or add it to a project that depends on it:

uv add pi-docsite      # then: uv run pi-docsite --docs-dir docs

Everything is a flag with a derived default, so the same command works in any repo:

Flag Default
--docs-dir docs/ next to the script
--project-name the git remote's repo name
--repo-url git remote origin
--tagline empty
--badge-label pi-docsite

Identity follows --docs-dir rather than the script's own location, so pointing it at another project's docs directory renders that project's site.

--badge-label is the header badge text. It names the generator, not the project being documented, so a vendored site never shows this repo's branding. The suffix after the first - keeps the accent styling; a label without a - renders unaccented.

Adding a page

Write the .md file, add one line to docs/nav.json, rebuild. That is the entire process — the generator discovers pages from the filesystem, so a new page can never be invisible.

Each page needs exactly one H1, which becomes its title and its sidebar entry. Headings inside fenced code blocks do not count.

docs/nav.json

The sidebar layout lives in one reviewable file. Array order is display order, for groups and for pages within a group:

{
  "groups": [
    { "name": "Getting Started", "pages": ["quickstart", "configuration"] },
    { "name": "Reference", "pages": ["cli-reference", "safety-enforcements"] }
  ]
}
  • Reorder by reordering the array. Do not rename files to reorder — that churns git history and breaks links to the old path.
  • A slug in nav.json with no .md behind it is a build error. Fix the JSON.
  • A .md not listed in nav.json is still built, placed under a fallback group, and reported in the generator's output. Add it to nav.json when you see that note.

Optional frontmatter overrides it for a single page:

---
nav_group: Reference
nav_order: 30
---

# My Page Title

Precedence, highest first: frontmatter, then nav.json, then the fallback group.

Ask your LLM

A ready-made skill ships with the package at skill/SKILL.md.

The generator tells you when it is missing. Every build prints one extra line while no agent has it installed:

pi-docsite: generator skill not installed for any agent. To expose pi-docsite guidance to
your LLM, copy .../pi_docsite/skill/SKILL.md into your agent's skills directory (for
example ~/.pi/agent/skills/pi-docsite/SKILL.md).

That line is why an LLM driving a rebuild can offer the install instead of silently working from guesswork. pip has no post-install hook, so this build-output notice is the only channel that reaches whoever is actually running the tool. It disappears once SKILL.md exists under ~/.pi/agent/skills/, ~/.claude/skills/, ~/.cursor/skills/, or ~/.gemini/skills/.

To install it yourself:

uv run python -c "
import pi_docsite, pathlib, shutil
src = pathlib.Path(pi_docsite.__file__).parent / 'skill' / 'SKILL.md'
dst = pathlib.Path.home() / '.pi/agent/skills/pi-docsite'
dst.mkdir(parents=True, exist_ok=True)
shutil.copy(src, dst / 'SKILL.md')
print('installed to', dst)
"

Or point your agent at it in the repo you are working in. It documents the commands, the frontmatter contract, what gets generated, and how to debug a failure.

Output

File Purpose
<slug>.html one per .md
index.html landing page with grouped navigation
search-index.json full page text for search, fetched once by every page
llms.txt short page index for LLM consumption
llms-full.txt full page text for LLM consumption
assets/ CSS and JS

Stale <slug>.html files with no matching .md are removed. Sources (*.md) and .nojekyll are never modified.

Determinism

The same Markdown always produces the same bytes. Rendering twice and diffing should be empty, which makes a docs change reviewable and makes unrelated churn a reliable signal that something actually changed.

Search works offline

The search index is written once and fetched by every page rather than inlined, which keeps each page small. Browsers block fetch() of a local file over file://, so serve the site over HTTP for search to work; opening the generated HTML directly from disk will report that the index is unavailable.

Requirements

Python 3.14+. Runtime dependencies: markdown, jinja2, pygments.

Development

cd packages/pi-docsite
uv run --extra dev pytest tests/ -q

License

Apache-2.0

Metadata

Release files for pi-docsite 4.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pi-docsite 4.8.2
File Size Uploaded
pi_docsite-4.8.2.tar.gz 61.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pi-docsite 4.8.2
File Interpreter ABI Platform
pi_docsite-4.8.2-py3-none-any.whl Python 3 none any Details

Total release size: 116.0 kB

Release files / pi_docsite-4.8.2.tar.gz

Download URL pi_docsite-4.8.2.tar.gz
Size 61.9 kB
Tags Source
SHA-256 checksum
How to use checksums
023089bfb8393991ee072948aace440ec9ec769e4c80e0380812b7d8c9bba7a1
BLAKE2b-256 checksum
How to use checksums
5e2e31de93109f8287fb9513ec5eefab028d8eb29f974742fe201c8029a00c26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pi_docsite-4.8.2-py3-none-any.whl

Download URL pi_docsite-4.8.2-py3-none-any.whl
Size 54.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3edda2ff306c4c800b6144adf8e70d60ac17efe77049404932d5ef64ce858215
BLAKE2b-256 checksum
How to use checksums
3bb3ecb160a177d1f8a5b00301caec7c49799fcd4b288c8e3b9db61b92bd6df8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

4.10.0

2 release files

4.9.0

2 release files

4.8.5

2 release files

4.8.4

2 release files

4.8.3

2 release files

This release

4.8.2 This release

2 release files

4.8.1

2 release files

4.8.0

2 release files

4.7.3

2 release files

4.7.2

2 release files

4.7.1

2 release files

4.7.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page