Skip to content

Auto-generate API reference site with pdoc and publish via GitHub Pages - #14

Merged
mullinmax merged 2 commits into
mainfrom
claude/api-docs-pydoc-cicd-9fef9v
Jul 16, 2026
Merged

Auto-generate API reference site with pdoc and publish via GitHub Pages#14
mullinmax merged 2 commits into
mainfrom
claude/api-docs-pydoc-cicd-9fef9v

Conversation

@mullinmax

Copy link
Copy Markdown
Contributor

Summary

Adds CI/CD that auto-generates the full API reference (every public module, class, method, and function) from the source docstrings and publishes it as a static pdoc website on GitHub Pages.

Once Pages is enabled it will live at https://warped-pinball.github.io/python-library/ and rebuild on every push to main.

What's included

  • scripts/gen_docs.py — builds the pdoc site. It walks the warpedpinball package and passes pdoc an explicit module list. This is necessary because pdoc's automatic submodule discovery honours a package's __all__, and ours lists the public API names (connect, Machine, the exception classes, …) rather than submodule names — so a bare pdoc warpedpinball renders only the top-level page and skips machine, models, cli, the transports, etc. The script picks up new modules automatically.
  • .github/workflows/docs.yml — builds the docs on every push and pull request (so broken docs are caught) and deploys to GitHub Pages from main only, using the official upload-pages-artifact / deploy-pages actions with OIDC.
  • pyproject.toml — new docs optional-dependency extra (pdoc>=14), also folded into dev.
  • Docstrings — filled in the previously-undocumented public API: the terse Machine route wrappers, the models dataclasses and their from_raw classmethods, and the cli subcommand functions, so the generated pages are complete.
  • docs/api-reference.md — how to build the site locally and the one-time steps to enable Pages; linked from the README and the docs index.

Enabling GitHub Pages (one time, needs a repo admin)

The workflow is committed and ready; Pages just needs to be turned on:

  1. Repo Settings → Pages.
  2. Under Build and deployment → Source, choose GitHub Actions (not "Deploy from a branch").
  3. Push to main (or run the Docs workflow manually) — the deploy job publishes the site.

Full details and notes (permissions, private-repo caveats, custom domains) are in docs/api-reference.md.

Build & test

  • python scripts/gen_docs.py builds all 10 modules into 11 HTML pages with 0 warnings.
  • ruff check . passes; the existing test suite passes unchanged.

Test plan

  • ruff check .
  • python -m pytest
  • python scripts/gen_docs.py --output site (clean build, spot-checked rendered docstrings)
  • Enable Pages and confirm the first deploy publishes the site

🤖 Generated with Claude Code

https://claude.ai/code/session_012C5JXr99B8vLSXgXc55XaB


Generated by Claude Code

Add a CI/CD pipeline that renders the full API reference from source
docstrings and publishes it to GitHub Pages.

- scripts/gen_docs.py: builds the pdoc site. It walks the package and
  passes pdoc an explicit module list because pdoc's auto-discovery honours
  __all__, which lists API names rather than submodules; without this only
  the top-level page would render.
- .github/workflows/docs.yml: builds the docs on every push and PR, and
  deploys to GitHub Pages from main via the official Pages actions.
- pyproject.toml: add a "docs" extra (pdoc) and include it in dev.
- docs/api-reference.md: how to build locally and the one-time steps to
  enable Pages; linked from the README and docs index.
- Fill in docstrings on the public API (Machine route wrappers, model
  dataclasses and their from_raw, CLI commands) so the generated pages are
  complete.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012C5JXr99B8vLSXgXc55XaB
@github-actions

Copy link
Copy Markdown

Coverage report

Total coverage: 100.00% (0.00% vs base 100.00%)

@mullinmax
mullinmax marked this pull request as ready for review July 16, 2026 19:48
@mullinmax
mullinmax merged commit 1e673a4 into main Jul 16, 2026
10 checks passed
@mullinmax
mullinmax deleted the claude/api-docs-pydoc-cicd-9fef9v branch July 16, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants