Skip to content

Replace the Read the Docs site with Starlight on GitHub Pages - #141

Closed
phelma wants to merge 17 commits into
add-api-docstringsfrom
docs-starlight-site
Closed

phelma wants to merge 17 commits into
add-api-docstringsfrom
docs-starlight-site

Conversation

@phelma

@phelma phelma commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Replaces the MkDocs and Read the Docs site with an Astro and Starlight site, published to GitHub Pages at https://logicblocks.github.io/event.store/.

Spec: meta/work/2026-11-03-starlight-docs-site.md. Tickets: meta/work/2026-11-03-starlight-docs-site-tickets.md.

What's in it

  • Site in docs/: Node 24 is pinned in mise and the npm lockfile is committed. It uses Starlight's default theme, Pagefind search, the GitHub link and "Edit this page" links. starlight-links-validator fails the build on any broken internal link.
  • Content is carried over, not rewritten: Home, Getting started (the README's current async example), the "Finalising state" guide, and Changelog and Contributing pages. The last two are loaded from the root CHANGELOG.md and CONTRIBUTING.md at build time.
  • API reference is generated by a griffe-based generator in tasks/reference/, one page per public package, from __all__. Anchors are the dotted import paths, and links between packages work. The output is gitignored and regenerated by mise run docs:serve and mise run docs:build. It is covered by fixture-based unit tests in tests/unit/tasks/.
  • CI: a new Docs workflow builds with mise and deploys with actions/deploy-pages, and PR checks gain a build-only docs job.
  • Retired: mkdocs.yml, .readthedocs.yaml, the MkDocs overrides, scripts and styles, and the mkdocs dependencies. The README badge and links, the contributing guide and the PyPI Documentation URL now point to the new site. There is a changelog fragment under "Changed".

Comparing old and new

While this PR is open, the Docs workflow also deploys from docs-starlight-site, and the github-pages environment allows that branch. Read the Docs only builds main, so https://eventstore.readthedocs.io/ keeps serving the old site until this is merged.

Before and after merging

  • Remove docs-starlight-site from the on.push.branches list in .github/workflows/docs.yaml, either as the last commit before merging or straight after.
  • Check that the Docs run on main deploys successfully.
  • Remove docs-starlight-site from the github-pages environment's deployment branch policy.
  • Ask the Read the Docs administrator to redirect eventstore.readthedocs.io to the new site and disable builds.

Notes

  • logicblocks.event.utils has no __all__, so its reference page is empty. Adding one is a source change and is left for the separate docstrings effort.
  • The branch is named docs-starlight-site, not docs/starlight-site, because a docs branch already exists on the remote.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An eager import of griffe from the uninstalled docs dependency group causes invoke deps.install to fail on fresh checkouts, blocking local setup and fresh CI jobs.

1 open issue
What changed in this PR

Migrates the library’s documentation from MkDocs and Read the Docs to Astro/Starlight on GitHub Pages, bringing documentation builds into the existing mise and GitHub Actions workflow.

Changes:

  • Carries over existing guides and loads changelog and contributing content from root files.
  • Adds a griffe-based API reference generator with fixture-based unit tests.
  • Adds documentation build/deployment jobs and removes the old documentation toolchain.
File Description
uv.lock Replaces MkDocs dependencies with griffe.
tests/​unit/​tasks/​reference/​test_generator.py Tests generated pages, signatures, links, and warnings.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​surface/​widgets.py Supplies public and private object fixtures.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​surface/​tools.py Supplies exported-module fixtures.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​surface/​nested/​parts.py Supplies nested object definitions.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​surface/​nested/​__init__.py Exercises aliases and nested exports.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​surface/​helpers.py Supplies an unexported function fixture.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​surface/​extras/​__init__.py Supplies a public subpackage fixture.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​surface/​_hidden/​__init__.py Exercises private subpackage exclusion.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​surface/​__init__.py Defines public-surface fixture exports.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​signatures/​__init__.py Exercises generic and callable signatures.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​references/​reports.py Supplies method cross-reference fixtures.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​references/​__init__.py Exercises cross-package and external references.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​minimal/​__init__.py Supplies a minimal package fixture.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​docstrings/​__init__.py Exercises docstring sections and parser warnings.
tests/​unit/​tasks/​reference/​fixtures/​acme/​kit/​_internal/​__init__.py Exercises private top-level package exclusion.
tasks/​reference/​warnings.py Collects griffe parsing warnings.
tasks/​reference/​surface.py Discovers public objects and canonical paths.
tasks/​reference/​signatures.py Renders typed API signatures.
tasks/​reference/​rendering.py Assembles reference pages and anchors.
tasks/​reference/​links.py Resolves API cross-references.
tasks/​reference/​docstrings.py Renders Google-style docstring sections.
tasks/​reference/​code.py Escapes and links rendered code tokens.
tasks/​reference/​__init__.py Coordinates reference generation.
tasks/​docs.py Generates references before serving or building Astro.
README.md Updates documentation badge and links.
pyproject.toml Updates documentation dependencies, URLs, and tooling paths.
mkdocs.yml Removes MkDocs configuration.
mise.toml Pins Node and adds documentation task prerequisites.
meta/​work/​2026-11-03-starlight-docs-site.md Records migration scope and design.
meta/​work/​2026-11-03-starlight-docs-site-tickets.md Records implementation and rollout tasks.
docs/​tsconfig.json Configures Astro TypeScript support.
docs/​stylesheets/​readthedocs.css Removes Read the Docs styling.
docs/​src/​loaders.ts Loads root Markdown documents into the site.
docs/​src/​content/​docs/​index.md Adds the landing page and installation instructions.
docs/​src/​content/​docs/​guides/​finalising-state.md Carries over the finalising-state guide.
docs/​src/​content/​docs/​getting-started.md Adds the current asynchronous usage example.
docs/​src/​content.config.ts Configures documentation content and root pages.
docs/​public/​favicon.svg Adds the site favicon.
docs/​package.json Defines Astro dependencies and scripts.
docs/​overrides/​main.html Removes the MkDocs template override.
docs/​javascript/​readthedocs.js Removes Read the Docs integrations.
docs/​index.md Removes the old single-page documentation.
docs/​astro.config.mjs Configures Starlight navigation, hosting, and link validation.
CONTRIBUTING.md Updates the documentation URL.
changelog.d/​20261103_133510_phelma_docs_starlight_site.md Announces the documentation migration.
.readthedocs.yaml Removes Read the Docs build configuration.
.gitignore Ignores Astro artifacts and generated reference pages.
.github/​workflows/​pr-checks.yaml Adds a build-only documentation check.
.github/​workflows/​docs.yaml Builds and deploys documentation to GitHub Pages.

Review effort: Balanced

Comment thread tasks/docs.py Outdated
Comment on lines +6 to +25
from .reference import generate_reference

REFERENCE_DIRECTORY = Path("docs/src/content/docs/reference")
PACKAGE_ORDER = [
"store",
"types",
"projection",
"processing",
"persistence",
"query",
"sources",
"testing",
"utils",
]


@task
def reference(context: Context):
"""Generates the API reference pages from the source."""
shutil.rmtree(REFERENCE_DIRECTORY, ignore_errors=True)
@phelma
phelma force-pushed the docs-starlight-site branch from 6f6e98f to 2bcceff Compare November 4, 2026 11:26
@phelma
phelma force-pushed the docs-starlight-site branch from 2bcceff to ee13f13 Compare November 4, 2026 12:08
@phelma
phelma changed the base branch from main to add-api-docstrings November 4, 2026 12:25
@phelma
phelma added this pull request to stack #144 November 4, 2026 12:26
Pin Node 24 in mise and add an Astro and Starlight project in docs with
Home and Getting started pages carried over from the README and the
existing docs index. Point the docs invoke tasks at the Astro build, and
add a docs workflow that builds with mise and deploys to GitHub Pages on
pushes to main and docs/starlight-site. The MkDocs and Read the Docs
setup is left in place for now.
@phelma
phelma force-pushed the docs-starlight-site branch from db8e528 to 869ee44 Compare November 4, 2026 16:42
The generator wrote headings as raw HTML, which Astro does not collect,
so the "On this page" list held only Overview. It now writes Markdown
headings with {#id} attributes, keeping the dotted anchors, and the
Markdown processor is configured to accept them.
Show the values of class attributes and enum members, use the exported
name in signatures of renamed re-exports, document behavioural dunder
methods, and skip packages with nothing to document rather than
generating an empty page.
Astro components, driven by Motion, that illustrate event sourcing using
a shared shopping cart example.
Any branch can be force-pushed to it to deploy a preview, however the
changes are split across branches and PRs.
@phelma

phelma commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Closed in favour of #148, which combines the whole docs stack into one PR.

@phelma phelma closed this Nov 18, 2026
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