From c0614ca3fc1c596a431878ea37482a22c4172637 Mon Sep 17 00:00:00 2001 From: Florent Pollet Date: Sun, 8 Nov 2026 15:11:13 -0500 Subject: [PATCH] Configure Read the Docs hosting and documentation references --- .github/workflows/docs.yml | 4 ++-- .readthedocs.yaml | 17 ++++++++++++++++ README.md | 6 ++++-- docs/index.md | 40 ++++++++++++++++++++++++++++++++++---- mkdocs.yml | 2 +- pyproject.toml | 2 +- 6 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 .readthedocs.yaml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7ac54c1..7b5acdb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,7 +1,7 @@ name: Docs -# Builds the documentation site on every pull request (strict: warnings fail the build) and publishes it to -# GitHub Pages on pushes to main. Publishing requires Pages to be enabled with "GitHub Actions" as source. +# Checks the documentation on every pull request. GitHub Pages publishing remains enabled during the +# Read the Docs transition; see docs/index.md for the cutover and old-URL redirect steps. on: pull_request: diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..bf253d2 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +version: 2 + +build: + os: ubuntu-24.04 + tools: + python: "3.12" + +python: + install: + - method: uv + command: sync + groups: + - docs + +mkdocs: + configuration: mkdocs.yml + fail_on_warning: true diff --git a/README.md b/README.md index 80027b5..4b0dafe 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Python 3.11+](https://img.shields.io/badge/Python-3.11%2B-blue?logo=python&logoColor=white)](https://www.python.org/downloads/) [![PyPI](https://img.shields.io/pypi/v/meds-algorithm)](https://pypi.org/project/meds-algorithm/) [![Tests and code quality](https://github.com/McDermottHealthAI/meds-algorithm/actions/workflows/ci.yml/badge.svg)](https://github.com/McDermottHealthAI/meds-algorithm/actions/workflows/ci.yml) -[![Documentation](https://img.shields.io/badge/docs-MEDS_algorithms-blue)](https://mcdermotthealthai.github.io/meds-algorithm/) +[![Documentation](https://readthedocs.org/projects/meds-algorithm/badge/?version=latest)](https://meds-algorithm.readthedocs.io/en/latest/) [![Contributors](https://img.shields.io/github/contributors/McDermottHealthAI/meds-algorithm)](https://github.com/McDermottHealthAI/meds-algorithm/graphs/contributors) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](https://github.com/McDermottHealthAI/meds-algorithm/pulls) [![License: MIT](https://img.shields.io/badge/License-MIT-green)](https://github.com/McDermottHealthAI/meds-algorithm/blob/main/LICENSE) @@ -18,7 +18,7 @@ Algorithm architectures, tokenizers, training objectives and task-specific logic See the [architecture and UML diagrams](https://github.com/McDermottHealthAI/meds-algorithm/blob/main/ARCHITECTURE.md) for the profile hierarchy, typed requests, algorithm-owned configuration, artifact references and shared execution path. -Browse the [algorithm catalogue](https://mcdermotthealthai.github.io/meds-algorithm/implemented-algorithms/) +Browse the [algorithm catalogue](https://meds-algorithm.readthedocs.io/en/latest/implemented-algorithms/) for implementations, reviewed installation commands and validation evidence. Register or update an entry through `catalogue/algorithms.yaml`; documentation builds and release observations are independent of the runtime package and never query private source repositories. See @@ -142,6 +142,8 @@ training. Keep each algorithm's data-access and cluster approval rules in its ow ### Unreleased +- Configure Read the Docs hosting with the existing MkDocs theme and docs dependency group; update + documentation links and document the transition from GitHub Pages. - Host the algorithm catalogue and its release-observation workflow in this ecosystem repository. - Add independently built documentation; catalogue metadata and tooling are excluded from Python distributions. diff --git a/docs/index.md b/docs/index.md index 5137646..32d709f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -28,7 +28,39 @@ the [catalogue test inventory](catalogue-testing.md). Runtime tests remain under inventory remains in the packaged [TESTING.md](https://github.com/McDermottHealthAI/meds-algorithm/blob/main/src/meds_algorithm/TESTING.md). -GitHub Actions builds and checks the site on PRs and deploys pushes to `main`. For the first deployment, -configure **Settings → Pages → Build and deployment → Source: GitHub Actions**. The weekly catalogue -workflow additionally needs permission for Actions to create pull requests; its registration guide -documents the setting and the report-artifact fallback. No private-repository credentials are required. +### Read the Docs hosting + +The repository-root `.readthedocs.yaml` builds this site with Python 3.12, the existing `docs` +dependency group and MkDocs Material. It uses uv to install dependencies from `pyproject.toml` and +`uv.lock`, and fails on documentation warnings. GitHub Actions continues running catalogue tests, +validation, lint and the strict documentation build independently of the hosting service. + +To enable hosting: + +1. Import `McDermottHealthAI/meds-algorithm` into Read the Docs and use `meds-algorithm` as the project + slug. If a different slug is needed, update the README badge and links, `pyproject.toml` documentation + URL and the fallback `site_url` in `mkdocs.yml` together. +2. Set the default branch to `main`, build its `latest` version, and use `latest` as the default + documentation version initially. Older release tags do not contain this hosting configuration. +3. Verify the build and the catalogue at + , and enable pull request builds if desired. + +MkDocs reads `READTHEDOCS_CANONICAL_URL` during hosted builds so canonical links use the appropriate +version URL. Local builds fall back to the `latest` URL. The source pages, navigation and theme are +shared between local builds and hosting; no second copy of the documentation is needed. + +### GitHub Pages transition + +The existing GitHub Pages deployment remains active until Read the Docs has built successfully. +After verifying the new site, replace the Pages publication with a small redirect site that preserves +the old page paths and fragments at . Keep those +redirects hosted on Pages so existing links continue working; Read the Docs cannot redirect requests +made to the old GitHub Pages domain. Retain the GitHub Actions documentation checks when replacing +the old full-site deployment. + +This change only moves hosting for this repository. The algorithm template's documentation remains +at its existing GitHub Pages URL. + +The weekly catalogue workflow additionally needs permission for Actions to create pull requests; its +registration guide documents the setting and the report-artifact fallback. No private-repository +credentials are required. diff --git a/mkdocs.yml b/mkdocs.yml index c5d438a..d039559 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,6 @@ site_name: MEDS algorithms site_description: Shared MEDS algorithm infrastructure and implementation catalogue. -site_url: https://mcdermotthealthai.github.io/meds-algorithm/ +site_url: !ENV [READTHEDOCS_CANONICAL_URL, "https://meds-algorithm.readthedocs.io/en/latest/"] repo_url: https://github.com/McDermottHealthAI/meds-algorithm repo_name: McDermottHealthAI/meds-algorithm edit_uri: edit/main/docs/ diff --git a/pyproject.toml b/pyproject.toml index 44f6add..61e4da9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ markers = [ [project.urls] Repository = "https://github.com/McDermottHealthAI/meds-algorithm" -Documentation = "https://mcdermotthealthai.github.io/meds-algorithm/" +Documentation = "https://meds-algorithm.readthedocs.io/en/latest/" [dependency-groups] dev = ["ruff"]