docs: add pdoc API documentation + audit docstrings (#216)#237
Merged
Conversation
Adds pdoc as a dev dependency and a README section documenting how to view the generated docs locally. Approach inspired by elliot-100's abandoned feat/auto-doc branch (#216 — that branch was a stale fork from February that would have reverted several months of fixes including the auth2/login migration, so reimplementing on fresh main). Also a focused audit of the public-API docstrings, since pdoc renders them verbatim and any inaccuracies become user-visible: - spond/__init__.py: add a module-level docstring so pdoc has a landing page for the package. - spond/base.py: add docstrings to `login()`, `auth_headers`, and `require_authentication` — they're all part of the public surface inherited by `Spond` and `SpondClub` but were previously undocumented. - spond/spond.py `get_events`: fix `GroupId` (uppercase) → `groupId` in the docstring to match the actual `params["groupId"]` API call (line 384). Replace stray "(TO DO: probably events for which invites haven't been sent yet?)" with a concrete description of scheduled events. Reorder the parameter block so max_end/min_end/max_start/ min_start matches the function signature. - spond/club.py `get_transactions`: reorder the docstring parameter block so `club_id, skip, max_items` matches the function signature. Latent code bugs noticed but not fixed in this PR (worth separate issues): - `send_message` is missing `await` on the `_continue_chat` call (spond.py:285) and can return `False` despite a `JSONDict` annotation. - `update_event` returns `self.events` (the cached list) instead of the actual update response stored on `self.events_update` (spond.py:454-455).
Adds a workflow that runs pdoc against the local checkout and deploys the generated HTML to GitHub Pages on every push to main (and on manual workflow_dispatch). Uses the modern artifact-based Pages deployment (configure-pages + upload-pages-artifact + deploy-pages) — no gh-pages branch, no commits pushed back to main, deploys are atomic. Concurrency is serialized on the `pages` group with cancel-in-progress disabled, so a fast follow-up push doesn't race a mid-flight deploy and leave Pages in a partially-uploaded state. Both jobs are gated on `github.repository_owner == 'Olen'` so forks don't fail trying to deploy to Pages they don't control. Also updates the README with the deployed URL so users can find the hosted docs without needing to run pdoc locally.
This was referenced May 14, 2026
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #216.
Adds an API documentation generator (
pdoc) and the supporting CI to publish it to GitHub Pages on every push tomain. Also a focused audit of the public-API docstrings, since pdoc renders them verbatim — any inaccuracies become user-visible the moment we publish.Attribution / history
The original suggestion and choice of
pdoccome from @elliot-100's branch `feat/auto-doc` — but that branch was forked from main back in February 2026 and never rebased. As of today its diff against main would silently revert:So I rescued the idea onto a fresh branch from current main rather than try to rebase. The actual content the branch contributed was tiny (pdoc dev dep + a 6-line README hint); the bulk of this PR is the docstring audit and CI workflow.
What's in this PR
1. Tooling (`pyproject.toml`)
2. Where docs live and what they look like
Hosted (after merge): https://olen.github.io/Spond/ — automatically rebuilt on every push to `main` by the new workflow. URL hierarchy:
Look and feel — pdoc renders a left-nav of all public symbols (private `_`-prefixed names are auto-hidden from nav but their source is still accessible), each function/class gets its docstring rendered as Markdown plus a "View Source" link inline with the signature. Search index is built into a JS-based filter box at the top.
Locally: `poetry run pdoc ./spond` opens `http://localhost:8080\` with the same view, but live-reloads on docstring edits — useful when iterating.
3. CI workflow (`.github/workflows/publish-docs.yml`)
⚙️ One-time settings step required
Before the deploy will succeed, GitHub Pages needs to be enabled at Settings → Pages → Source = "GitHub Actions". This is a one-time toggle per repo and not configurable via the workflow file. Until that's flipped, the `Build` job will succeed but `Deploy` will fail at `actions/configure-pages`. After flipping, just re-run the workflow once via the Actions tab.
4. Docstring audit
pdoc-driven pass over the public API. Fixed:
5. Latent code bugs noticed (not fixed here)
Worth separate issues — flagging so they don't get lost:
Test plan
🤖 Generated with Claude Code