From c0b5f30bee102194e0f69a39cb9b932071f1065d Mon Sep 17 00:00:00 2001 From: Dominique Lasserre Date: Sat, 4 Jan 2025 18:08:53 +0100 Subject: [PATCH] Initial readthedocs config --- .readthedocs.yaml | 18 ++++++++++++++++++ Makefile | 4 +++- docs/akkudoktoreos/serverapi.md | 2 +- docs/develop/CONTRIBUTING.md | 2 +- docs/develop/getting_started.md | 2 +- 5 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..75ab0839 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,18 @@ +version: 2 + +build: + os: ubuntu-24.04 + tools: + python: "3.12" + jobs: + post_install: + # Install package so the auto generation in eval-sh can access package imports + - pip install -e . + +sphinx: + configuration: docs/conf.py + +python: + install: + - requirements: requirements-dev.txt + diff --git a/Makefile b/Makefile index 9bde50cc..161dfcbd 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,9 @@ dist: pip # Target to generate HTML documentation docs: pip-dev - .venv/bin/sphinx-build -M html docs build/docs + . .venv/bin/activate; \ + pip install -e .; \ + sphinx-build -M html docs build/docs @echo "Documentation generated to build/docs/html/." # Target to read the HTML documentation diff --git a/docs/akkudoktoreos/serverapi.md b/docs/akkudoktoreos/serverapi.md index 39011eb4..cf9cbf0d 100644 --- a/docs/akkudoktoreos/serverapi.md +++ b/docs/akkudoktoreos/serverapi.md @@ -3,5 +3,5 @@ # Server API ```{eval-sh} -./scripts/generate_openapi_md.py | ./scripts/extract_markdown.py --input-stdin --start-line "**Version**:" +python ${READTHEDOCS_REPOSITORY_PATH:-.}/scripts/generate_openapi_md.py | python ${READTHEDOCS_REPOSITORY_PATH:-.}/scripts/extract_markdown.py --input-stdin --start-line "**Version**:" ``` diff --git a/docs/develop/CONTRIBUTING.md b/docs/develop/CONTRIBUTING.md index 3c75cc3b..9af2252b 100644 --- a/docs/develop/CONTRIBUTING.md +++ b/docs/develop/CONTRIBUTING.md @@ -1,3 +1,3 @@ ```{eval-sh} -./scripts/extract_markdown.py --input-file CONTRIBUTING.md +python ${READTHEDOCS_REPOSITORY_PATH:-.}/scripts/extract_markdown.py --input-file ${READTHEDOCS_REPOSITORY_PATH:-.}/CONTRIBUTING.md ``` diff --git a/docs/develop/getting_started.md b/docs/develop/getting_started.md index 6e55472d..f6e6cdb3 100644 --- a/docs/develop/getting_started.md +++ b/docs/develop/getting_started.md @@ -1,5 +1,5 @@ # Getting Started ```{eval-sh} -./scripts/extract_markdown.py --input-file README.md --start-line "## Getting Involved" +python ${READTHEDOCS_REPOSITORY_PATH:-.}/scripts/extract_markdown.py --input-file ${READTHEDOCS_REPOSITORY_PATH:-.}/README.md --start-line "## Getting Involved" ```