Skip to content

Add a documentation site on GitHub Pages and shorten the README - #20

Merged
seba2390 merged 1 commit into
mainfrom
docs/sphinx-site
Sep 30, 2026
Merged

seba2390 merged 1 commit into
mainfrom
docs/sphinx-site

Conversation

@seba2390

Copy link
Copy Markdown
Owner

What does this change?

Adds a documentation site at https://seba2390.github.io/ExecutionTimer/, hosted free on GitHub Pages. The site goes live after this merges and the new Docs workflow has run.

The site uses Sphinx with the Furo theme, with pages written in Markdown. It uses the stopwatch from the logo, the logo's indigo colors, and light and dark modes.

  • Home: a short pitch, an example with its output, why to use the package, and install instructions.
  • Getting started: a five-minute tour covering install, sections, nesting, reading the report, decorators, categories and exports.
  • User guide: timing code, counters and flattening, categories, reports and export, threads/asyncio/generators, long-running processes, and overhead.
  • Reference: an API reference generated from the docstrings, plus the changelog and the contributing guide pulled in from the repo.

Docstrings. The public functions and types now document their parameters, return values and exceptions, so the API reference has real content. Only docstrings changed; no behavior did.

Keeping it correct

  • tests/docs_examples_test.py runs every Python example in the README and the docs, 38 blocks across 10 pages. Each page runs in a fresh interpreter with warnings as errors, so an example can't silently go stale. The asserts in the examples check structure only, never how long a sleep took, so Windows' coarse timer can't make them flaky.
  • A new CI job, Build documentation, builds the site on every PR with warnings as errors, including broken cross-references. It's part of the CI passed check, so branch protection needs no changes.
  • The example outputs shown on the pages are real output from running them.

Deployment. .github/workflows/docs.yml builds and deploys to Pages on every push to main. It follows the same conventions as the other workflows:

  • Actions are pinned to exact commits: upload-pages-artifact v5.0.0 and deploy-pages v5.0.1.
  • Checkout credentials aren't persisted.
  • There's no dependency cache on the publishing path, the same as publish.yml.
  • Only the deploy job gets pages: write / id-token: write.
  • The github-pages environment already only allows deploys from main.

README. Cut from 298 lines to 85: logo, badges (now including a docs badge), pitch, install, quick start, a decorator example, and links into the site.

Other

  • pyproject.toml: a docs dependency group (sphinx, furo, myst-parser, sphinx-copybutton, sphinx-design), which Dependabot will keep updated. The Documentation URL now points to the site; PyPI picks that up at the next release. The sdist now includes docs/ so its tests can run the doc examples.
  • CONTRIBUTING.md: how to build and preview the docs. Its links are absolute now so they work when shown on the site.
  • CHANGELOG.md: an entry under Unreleased. No version bump, since nothing in the package changed.

Checklist

  • uv run pytest --cov passes: 112 tests, 100% statement and branch coverage. It also passes on 3.14t.
  • uv run ruff check and uv run ruff format --check pass
  • uv run basedpyright passes (0 errors, 0 warnings)
  • Behaviour changes are covered by a test (no behaviour changes; the doc examples are now tested)
  • CHANGELOG.md updated under ## [Unreleased]
  • The site builds locally with warnings as errors, in a clean environment using the exact CI commands, and I previewed it in a browser

A Sphinx site with the Furo theme, written in Markdown: a home page, a
getting-started guide, seven user-guide pages, and an API reference built
from the docstrings. Public docstrings now document parameters, return
values and exceptions.

A new workflow deploys the site to GitHub Pages on every push to main. CI
builds it on pull requests with warnings as errors, and a test runs every
Python example in the README and the docs so they cannot go stale.

The README keeps the pitch, installation and a quick start, and links to
the site for everything else.
@seba2390
seba2390 merged commit 9a376a3 into main Sep 30, 2026
19 checks passed
@seba2390
seba2390 deleted the docs/sphinx-site branch September 30, 2026 21:32
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.

1 participant