Repository navigation
docs: switch to a MkDocs Material site - #139
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Reviewer's GuideThe 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 publicationsequenceDiagram
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
Flow diagram for adapting Helm chart documentation linksflowchart 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
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
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]>
There was a problem hiding this comment.
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
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]>
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 samevalidationsettings, somkdocs build --strictfails on broken links, anchors and references. It runs on Read the Docs (fail_on_warning: true) and in a new CI job, Build documentation, whichpublishnow 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:
curl), Getting started (Usage), API (Swagger UI and spec)POST /service-infoin Upgradingapi_pathmeaning in Upgradingdocs/releases/<version>.mdstays where the release workflow reads it. The notes are now also pages of the docs (under Changelog inmkdocs.yml; the build fails if a notes file is missing fromnav). 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:
pymdownx.snippetssection markers (HTML comments in the README, withcheck_paths: true).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 intests/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. Plainpymdownx.snippetswould have left those relative links broken in the site.Other changes:
site_urlis 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'smkdocs.ymlhas the same problem.requirements_docs.txt, the repo's convention forrequirements_dev.txt. FOCA, a library, uses adocsextra with ranges instead.griffelibandpymdown-extensionsare pinned too, because their new releases can add warnings that fail the strict build. Dependabot now updates them from/in adocs-dependenciesgroup of their own, replacing the/docs/apientry.cloud_registry/service_models/__init__.py, because griffe does not find namespace subpackages. Also fixed a docstring indentation that griffe warned about.409description), the startup error for invalid stored services (now a docs URL) and thepyproject.tomlproject URLs.cloud_registry/config.yamlto 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 ofdeployment/README.md, a broken link in a README snippet and a missing snippet section each fail the build.README.mdanddeployment/README.md(atorigin/dev) into sentences, normalizes the Markdown (link targets, headings, fences, admonitions) and counts each sentence inREADME.md,deployment/README.mdanddocs/*.md.pytest(721 passed, including the hook tests; coverage ofcloud_registry100%),mypy,ruff check,ruff format --check,ast-grep scan/test, and semgrep with.semgrep/: all pass. gitleaks was not run locally; CI runs it.check-yamlcan't load MkDocs'!ENVtag, so it now skipsmkdocs.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).Declined review findings
docsextra inpyproject.toml. Declined: this repo pins its requirements inrequirements_*.txtfiles, and the app is not a library.navfromdocs/releases/automatically. Declined: a missing entry fails the strict build. The step is documented inmkdocs.yml, indocs/development.mdand in a comment inrelease.yaml.deployment/README.md. Declined: edit buttons are off (nocontent.action.edit, as in FOCA).deployment/README.md; the limitation is documented, and other link forms fail the strict build.curllines 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:
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests:
Chores: