From 0777dedf1e0ab642bb9eefa10d4d93d12248993c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 12 Nov 2026 06:38:04 +0000 Subject: [PATCH] update readthedocs process --- docs/mkdocs.zensical.yml | 4 +++- readthedocs.yml | 24 +++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/mkdocs.zensical.yml b/docs/mkdocs.zensical.yml index 850455b37e..5ff65217e5 100644 --- a/docs/mkdocs.zensical.yml +++ b/docs/mkdocs.zensical.yml @@ -4,9 +4,11 @@ # macros on_error_fail. The mermaid2, simple-hooks and git-revision-date # plugins are not supported by Zensical (silently ignored). # Post-build checks (hooks.on_post_build) are run separately by "invoke build-docs". +# site_url is taken from READTHEDOCS_CANONICAL_URL when building on ReadTheDocs +# (the mkdocs on_config hook which used to set it is not run by Zensical). # Project -site_url: https://inventree.readthedocs.io +site_url: !ENV [READTHEDOCS_CANONICAL_URL, 'https://inventree.readthedocs.io/'] site_name: InvenTree Documentation site_description: InvenTree - Open Source Inventory Management site_author: InvenTree diff --git a/readthedocs.yml b/readthedocs.yml index 1d72620cfe..cea8b58f4b 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -1,19 +1,17 @@ version: 2 -mkdocs: - configuration: docs/mkdocs.yml - -python: - install: - - requirements: docs/requirements.txt - - requirements: src/backend/requirements.txt - +# The documentation is built with Zensical, which ReadTheDocs does not support +# natively, so a custom build is used. The output must be placed in +# $READTHEDOCS_OUTPUT/html (see https://docs.readthedocs.com/platform/stable/build-customization.html) build: os: "ubuntu-24.04" tools: python: "3.12" - jobs: - post_install: - - pip install -U invoke - - echo "Generating API schema file" - - invoke build-docs + commands: + - pip install -r docs/requirements.txt + - pip install -r src/backend/requirements.txt + - pip install -U invoke + # Generate the API schema and settings definitions, build the site and run the post-build checks + - invoke build-docs --build + - mkdir -p $READTHEDOCS_OUTPUT/html + - cp -r docs/site/. $READTHEDOCS_OUTPUT/html/