|
1 | 1 | # Read the Docs configuration file |
2 | | -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details |
| 2 | +# https://docs.readthedocs.io/en/stable/config-file/v2.html |
| 3 | +# |
| 4 | +# Pipeline: builds the docs (MkDocs Material), then runs Pagefind over the |
| 5 | +# output and copies docs/manifest.json next to it. The published artifact is |
| 6 | +# consumed by the python-openapi.org website shell, which proxies docs paths |
| 7 | +# from the shell origin to RTD and merges the per-project Pagefind bundles |
| 8 | +# in the browser at search time. See ../web/specs/001-openapi-website for |
| 9 | +# the website plan and the docs-theme-contract.md. |
3 | 10 | version: 2 |
4 | 11 |
|
5 | | -# Build documentation with Mkdocs |
6 | 12 | mkdocs: |
7 | | - configuration: mkdocs.yml |
| 13 | + configuration: mkdocs.yml |
8 | 14 |
|
9 | | -# Optionally build your docs in additional formats such as PDF and ePub |
10 | | -formats: all |
| 15 | +# HTML only — the website shell consumes HTML + manifest + Pagefind. PDF/ePub |
| 16 | +# builds are not supported by the current MkDocs plugin set. |
| 17 | +formats: [] |
11 | 18 |
|
12 | 19 | build: |
13 | 20 | os: ubuntu-24.04 |
14 | 21 | tools: |
15 | 22 | python: "3.12" |
| 23 | + nodejs: "20" |
16 | 24 | jobs: |
17 | 25 | post_system_dependencies: |
18 | 26 | - asdf plugin-add poetry |
19 | 27 | - asdf install poetry 2.2.1 |
20 | 28 | - asdf global poetry 2.2.1 |
21 | 29 | post_install: |
22 | 30 | - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --no-interaction --with docs |
| 31 | + # Replaces RTD's declarative MkDocs output: `make docs-publish` rebuilds |
| 32 | + # the docs into docs_build/, runs Pagefind into docs_build/pagefind/, and |
| 33 | + # copies docs/manifest.json into docs_build/. We then move docs_build/* |
| 34 | + # into $READTHEDOCS_OUTPUT/html/ so the published artifact contains both |
| 35 | + # the manifest and the Pagefind bundle expected by the website shell. |
| 36 | + post_build: |
| 37 | + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry run make docs-publish |
| 38 | + - mkdir -p $READTHEDOCS_OUTPUT/html && cp -r docs_build/* $READTHEDOCS_OUTPUT/html/ |
0 commit comments