See CONTEXT.md for project design and philosophy.
Install toolchain versions via mise:
mise installThis activates Node.js, pnpm, Python, and uv as defined in mise.toml.
Build theme assets (TypeScript + Tailwind CSS):
just build-themeOutputs _static/thdocs.css and _static/thdocs.js, consumed by the theme.
Build documentation site (one-shot):
just buildBuilds the demo site from /docs into _build/html. Requires theme assets to exist.
Live-reload dev server:
just devWatches /docs and rebuilds on file changes. Skips Pagefind (search) and PDF for speed.
Access at http://localhost:8000.
Rebuild theme on changes (when editing theme-src/src/):
Theme assets don't rebuild automatically yet. Rerun just build-theme after edits.
All tests (Python pytest + Playwright):
uv run pytestThis runs two suites:
- Static tests (
tests/test_build.py, 24 tests) — Verify build artifacts: HTML structure, CSS linking, directive rendering, toctree generation. Run offline. - Browser tests (
tests/test_browser.py, 5 tests) — Verify JS behaviors in a real Chromium instance: sidebar layout, toctree collapse persistence, scroll/focus restoration, scrollspy. Load HTML viafile://(no HTTP server).
Run one suite:
uv run pytest tests/test_build.py
uv run pytest tests/test_browser.pyRun a single test:
uv run pytest tests/test_browser.py::test_sidebar_renders_on_left -vAll tests scaffold a temporary project, build it, and validate the output.
src/thdocs/— Python package (CLI, Sphinx config, Jinja templates)theme-src/— Node.js + TypeScript (theme assets)src/main.ts— JS behaviors (sidebar tabs, scrollspy, toctree collapse, scroll/focus memory)src/main.css— Dark prose theme (Tailwind v4, unlayered rules, CSS grid layout)
docs/— Demo documentation site (teststhdocsagainst itself)index.md,getting-started.md,cli.md,theming.md,kitchen-sink.mdadr/— Architecture decision records
tests/— Python pytest + Playwright browser testsjustfile— Task runner (build, dev, build-theme)thdocs.toml— Demo site config (title, theme toggles)
just build-theme && just buildThe Tailwind theme variables in theme-src/src/main.css are vendored from shell's design system (at ~/ghq/dtinth/apiref). Edit manually as needed; there's no automated sync yet.