Skip to content

docs: switch to a MkDocs Material site - #139

Merged
uniqueg merged 8 commits into
devfrom
docs/mkdocs
Oct 21, 2026
Merged

uniqueg merged 8 commits into
devfrom
docs/mkdocs

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Switches Read the Docs from the Sphinx code docs (docs/api/) to a MkDocs Material site, named Cloud Registry, modelled on FOCA's: same theme features, palette, markdown extensions, mkdocstrings for the Python API reference, and the same validation settings, so mkdocs build --strict fails on broken links, anchors and references. It runs on Read the Docs (fail_on_warning: true) and in a new CI job, Build documentation, which publish now also needs.

Pages: Home, Getting started, Configuration, API, Access control, Deployment, Operations, Upgrading, Development, API reference, Changelog (with the 0.3.0 release notes).

Where the README content went:

Old README section New place
Synopsis, Description README (synopsis section), included in Home
Contents Site navigation; the README links the docs once
Installation, Requirements, Deployment (Docker Compose) README quick start, included in Getting started, plus the rest of Getting started
Kubernetes Getting started (intro); the chart's README is the Deployment page
Usage README quick start (URL, curl), Getting started (Usage), API (Swagger UI and spec)
API API (Registrations, Errors)
Authentication, Access control Access control (Authentication, Roles on services, Roles of groups, Admins, Current user)
Access control: audit logs; Permissions API Operations
Service info Configuration (Service info); the removed POST /service-info in Upgrading
Duplicate services, Verified services API; the startup check of stored services in Upgrading
Configuration, Public URLs, Request size limit, Server Configuration; the old api_path meaning in Upgrading
Development, Contributing, Versioning and releases Development (the Sphinx build steps replaced by MkDocs ones)
License, Contact Home

docs/releases/<version>.md stays where the release workflow reads it. The notes are now also pages of the docs (under Changelog in mkdocs.yml; the build fails if a notes file is missing from nav). They refer to docs pages by name, not by relative links, because they are also published as GitHub release notes.

How the includes work, so that nothing is written twice:

  • The home and getting started pages include the README's synopsis and quick start through pymdownx.snippets section markers (HTML comments in the README, with check_paths: true).
  • The deployment page is deployment/README.md, which stays next to the chart. A small MkDocs hook (docs/hooks.py) includes it. Only inline links outside plain fenced code blocks are adapted (documented in the hook, and tested in tests/test_docs_hooks.py). Its links to docs pages (../docs/<page>.md, which also work on GitHub) become checked links within the site, and its links to other repository files become GitHub links. Plain pymdownx.snippets would have left those relative links broken in the site.

Other changes:

  • site_url is read from Read the Docs' READTHEDOCS_CANONICAL_URL (which includes the version path, e.g., /en/latest/), with a fallback for local builds. Otherwise the canonical links and the 404 page's assets point to paths that don't exist on Read the Docs. FOCA's mkdocs.yml has the same problem.
  • Docs requirements are pinned in requirements_docs.txt, the repo's convention for requirements_dev.txt. FOCA, a library, uses a docs extra with ranges instead. griffelib and pymdown-extensions are pinned too, because their new releases can add warnings that fail the strict build. Dependabot now updates them from / in a docs-dependencies group of their own, replacing the /docs/api entry.
  • The docs need mkdocstrings 1.0.8: older versions break with pymdown-extensions 12, and 1.0.8 requires Python 3.11 or later. So the docs build on Python 3.12, both on Read the Docs and in CI, like the image.
  • Added cloud_registry/service_models/__init__.py, because griffe does not find namespace subpackages. Also fixed a docstring indentation that griffe warned about.
  • References to README sections elsewhere now point to the docs. This covers comments, the API specification (409 description), the startup error for invalid stored services (now a docs URL) and the pyproject.toml project URLs.
  • Unrelated fix (separate commit): links in cloud_registry/config.yaml to FOCA's old Sphinx model pages returned 404. They now point to FOCA's configuration pages.

Verification

  • mkdocs build --strict (Python 3.12, requirements_docs.txt): passes. Negative checks: a broken page link, a missing anchor in a link of deployment/README.md, a broken link in a README snippet and a missing snippet section each fail the build.
  • Content check: a script splits the old README.md and deployment/README.md (at origin/dev) into sentences, normalizes the Markdown (link targets, headings, fences, admonitions) and counts each sentence in README.md, deployment/README.md and docs/*.md.
    • 559 sentences checked; none occurs more often than before.
    • 44 are not found verbatim. These are reworded cross-references (e.g., "see the deployment instructions" now names the target section), sentences split across new headings or bullets turned into sections, and text left out on purpose: the README's table of contents and the "API documentation is available here" line (replaced by the site navigation), "That's it! You should now be able to use the API" (filler), the summary list of the chart README's topics (the page's own TOC) and the Sphinx build commands (replaced).
  • pytest (721 passed, including the hook tests; coverage of cloud_registry 100%), mypy, ruff check, ruff format --check, ast-grep scan/test, and semgrep with .semgrep/: all pass. gitleaks was not run locally; CI runs it.
  • CI: all checks pass (run 39634985804), including the new Build documentation job, after one fix: check-yaml can't load MkDocs' !ENV tag, so it now skips mkdocs.yml, which the docs build checks instead. The last push passes too, including the Read the Docs pull request build of the MkDocs site (docs/readthedocs.org:cloud-registry).
  • Sourcery: one finding. GitHub links on the Deployment page should match the docs version. Fixed: on Read the Docs they now point to the commit of the build. Sourcery then approved.

Declined review findings

  • Move the docs requirements into a FOCA-style docs extra in pyproject.toml. Declined: this repo pins its requirements in requirements_*.txt files, and the app is not a library.
  • Generate the Changelog nav from docs/releases/ automatically. Declined: a missing entry fails the strict build. The step is documented in mkdocs.yml, in docs/development.md and in a comment in release.yaml.
  • Set the Deployment page's edit URL to deployment/README.md. Declined: edit buttons are off (no content.action.edit, as in FOCA).
  • Handle nested or mixed code fences and other link forms in the hook. Declined: none occur in deployment/README.md; the limitation is documented, and other link forms fail the strict build.
  • Wrap long curl lines in code samples, and change the link style for repository files. Declined: both are carried over unchanged from the README.

Open questions

None.

Closes #132.

🤖 Generated with Claude Code

Summary by Sourcery

Publish the project documentation as a strict, version-aware MkDocs Material site and integrate its build into Read the Docs and CI.

New Features:

  • Replace the Sphinx code documentation with a Cloud Registry MkDocs Material site covering user, deployment, operational, development, release, and Python API reference content.
  • Add strict documentation validation and shared content inclusion for README and Helm chart documentation.

Bug Fixes:

  • Correct documentation URLs for Read the Docs version paths and update stale FOCA configuration links.
  • Update application, configuration, chart, and release references to point to the new documentation.

Enhancements:

  • Organize the existing project guidance into dedicated documentation pages and publish release notes within the site.
  • Add a documentation-specific dependency set with Python 3.12 support and MkDocs API reference generation.

Build:

  • Configure MkDocs Material, mkdocstrings, Markdown extensions, navigation, and strict link validation.
  • Switch Read the Docs from Sphinx to MkDocs and add pinned documentation dependencies.

CI:

  • Add a strict documentation build job and require it before publishing images.
  • Adjust YAML pre-commit validation to accommodate MkDocs configuration.

Documentation:

  • Consolidate README and Helm deployment guidance into the new Cloud Registry documentation site, including the 0.3.0 changelog.

Tests:

  • Add tests for documentation link adaptation and Helm README inclusion.

Chores:

  • Add the service models package marker required for generated API documentation.

uniqueg and others added 5 commits October 21, 2026 17:58
Replace the Sphinx code docs (docs/api/) with a MkDocs Material site
modelled on FOCA's (theme features, palette, markdown extensions,
mkdocstrings for the API reference, link validation), built by Read the
Docs and in a new CI job with `mkdocs build --strict`, so that broken
links, anchors and references fail the build.

Move the content of README.md into pages (getting started,
configuration, API, access control, operations, upgrading,
development, changelog); the README keeps the badges, the synopsis, a
quick start and links to the pages, and the home and getting started
pages include its synopsis and quick start (pymdownx.snippets), so
that nothing is written twice. The deployment page includes the
chart's deployment/README.md via a hook, which turns its links to
docs pages into checked links and its links to other files into
GitHub links.

Docs requirements are pinned in requirements_docs.txt, updated by
Dependabot in a group of their own; mkdocstrings 1.0.8 is needed for
pymdown-extensions 12 and Python 3.11+, so the docs build on 3.12.
Add `cloud_registry/service_models/__init__.py`, as griffe does not
find namespace subpackages.

Closes #132

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comments, the API specification and the error on startup for invalid
stored services referred to sections of the README that moved to the
docs; refer to the docs pages instead, and add the docs to the project
URLs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
FOCA's docs moved to MkDocs, so links to its Sphinx model pages
(modules/foca.models.html) return 404; link the configuration pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Set `site_url` from Read the Docs' canonical URL, which includes the
  version path (`/en/latest/`), so that canonical links and the 404
  page work there.
- Pin griffelib and pymdown-extensions too, whose new releases can add
  warnings that fail the strict build, and group them with the docs.
- Skip plain fenced code blocks in the chart README's links, take the
  GitHub URL from `repo_url`, and test the hook.
- Link the docs from the README once, instead of repeating the page
  list of the home page.
- Note the Python version for local builds, and the `nav` entry for
  curated release notes in the release workflow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name the docs site Cloud Registry, and its project ELIXIR On-Cloud in
the site description and copyright.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (31dd4f2) to head (732d13a).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #139   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          737       737           
=========================================
  Hits           737       737           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The PR replaces the Sphinx code-docs setup with a strictly validated MkDocs Material site, rehomes and deduplicates project guidance across reusable documentation pages, generates the Python API reference with mkdocstrings, adapts the Helm chart README through a tested MkDocs hook, and wires the build into pinned dependencies, Read the Docs, CI, publishing, and related project references.

Sequence diagram for the strict documentation build and publication

sequenceDiagram
    participant CI as CI checks
    participant MkDocs
    participant ReadTheDocs
    participant Publish

    CI->>MkDocs: mkdocs build --strict
    MkDocs-->>CI: Validate links, anchors, references
    CI->>Publish: Allow publish after docs succeeds
    ReadTheDocs->>MkDocs: Build mkdocs.yml
    MkDocs-->>ReadTheDocs: Fail on warnings
    ReadTheDocs-->>Publish: Serve versioned documentation
Loading

Flow diagram for adapting Helm chart documentation links

flowchart TD
    START[deployment/README.md include request]
    READ[Read chart README]
    FENCE{Inside fenced code block?}
    DOC[Convert ../docs/page.md to checked site link]
    REPO[Convert repository file link to GitHub link]
    KEEP[Keep anchor or absolute URL unchanged]
    OUTPUT[Insert adapted Markdown into Deployment page]

    START --> READ --> FENCE
    FENCE -->|Yes| KEEP
    FENCE -->|No| DOC
    FENCE -->|No| REPO
    DOC --> OUTPUT
    REPO --> OUTPUT
    KEEP --> OUTPUT
Loading

File-Level Changes

Change Details Files
Replace the Sphinx/Read the Docs code-documentation site with a structured MkDocs Material site covering user, deployment, operational, development, API, generated reference, and release-note content.
  • Add the MkDocs configuration, navigation, Material theme, Markdown extensions, strict validation, mkdocstrings settings, and version-aware Read the Docs canonical URL.
  • Reorganize README content into concise overview and quick-start sections, with snippet markers reused by the Home and Getting started pages.
  • Add documentation pages for configuration, API behavior, access control, deployment, operations, upgrades, development, API reference, changelog, and 0.3.0 notes.
  • Generate the Python API reference from docstrings and add the package marker and docstring fix required by griffe.
mkdocs.yml
.readthedocs.yaml
README.md
docs/index.md
docs/getting-started.md
docs/configuration.md
docs/api.md
docs/access-control.md
docs/deployment.md
docs/operations.md
docs/upgrading.md
docs/development.md
docs/reference.md
docs/changelog.md
docs/releases/0.3.0.md
cloud_registry/service_models/__init__.py
cloud_registry/ga4gh/registry/service.py
docs/api/
Implement reusable documentation inclusion and link adaptation for the Helm chart README while preserving GitHub usability.
  • Add an MkDocs page hook that includes deployment/README.md and rewrites documentation links to site-relative paths or repository links.
  • Limit link rewriting to inline links outside simple fenced code blocks and document those constraints.
  • Add focused tests for link classification, fence handling, inclusion, and no-op behavior.
docs/hooks.py
tests/test_docs_hooks.py
deployment/README.md
Integrate strict documentation validation into dependency management, CI, publishing, and Read the Docs.
  • Pin documentation dependencies, including mkdocstrings-compatible Python 3.12 tooling, and move Dependabot updates into the main pip configuration.
  • Add a Build documentation CI job running mkdocs build --strict and make image publishing depend on it.
  • Configure Read the Docs for MkDocs, Python 3.12, and warning failures.
  • Exclude mkdocs.yml from generic YAML validation because it contains MkDocs' !ENV tag.
requirements_docs.txt
.github/dependabot.yml
.github/workflows/checks.yaml
.github/workflows/release.yaml
.readthedocs.yaml
.pre-commit-config.yaml
.gitignore
Update project, application, chart, and release references from the old README/Sphinx structure to the new documentation site, while correcting stale FOCA links.
  • Point API descriptions, startup errors, tests, project metadata, chart documentation, Docker Compose comments, and release notes to the relevant documentation pages.
  • Update FOCA configuration comments to current configuration URLs.
  • Document the requirement to add release-note pages to MkDocs navigation.
cloud_registry/api/additions.openapi.yaml
cloud_registry/config.yaml
cloud_registry/ga4gh/registry/service.py
deployment/Chart.yaml
deployment/README.md
docker-compose.yaml
docs/releases/0.3.0.md
pyproject.toml
tests/test_app.py

Assessment against linked issues

Issue Objective Addressed Explanation
#132 Replace the Sphinx Read the Docs build with a MkDocs Material site, generate the API reference with mkdocstrings, and make strict documentation validation a required CI check. ✅
#132 Create navigable documentation pages covering getting started, configuration, API, access control, deployment, operations, upgrading, API reference, and release notes, while moving the existing README content into the site. ✅
#132 Slim the README to an overview and quick start, and include the chart’s existing deployment README in the deployment page without maintaining a second copy. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

check-yaml cannot load the `!ENV` tag that `site_url` uses; the docs
build loads and checks `mkdocs.yml` instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg marked this pull request as ready for review October 21, 2026 16:32

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/hooks.py" line_range="48" />
<code_context>
+        path = target.removeprefix("../")
+    else:
+        path = f"deployment/{target}"
+    return f"{repo_url.rstrip('/')}/blob/dev/{path}"
+
+
</code_context>
<issue_to_address>
**Older docs link to current source**

When a reader views a non-latest Read the Docs version and follows a repository-file link on the Deployment page, `adapt_link` rewrites repository-file links to the `dev` branch regardless of the documentation version, so readers of an older Read the Docs release follow links to potentially incompatible files.

Use the source ref corresponding to the Read the Docs version when constructing GitHub links, or link to versioned source through another mechanism.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: docs/hooks.py:48


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/hooks.py Resolved
On Read the Docs, links of the chart README to files of the repository
point to the commit of the build (READTHEDOCS_GIT_COMMIT_HASH), so that
older versions of the docs link to matching files; otherwise to `dev`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sourcery-ai sourcery-ai Bot 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.

Sourcery assessment

Approved.

@uniqueg
uniqueg merged commit 5e95450 into dev Oct 21, 2026
13 checks passed
@uniqueg
uniqueg deleted the docs/mkdocs branch October 21, 2026 17:11
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.

docs: add MkDocs Material site like FOCA

1 participant