This commit is contained in:
Tom van Woudenberg 2025-02-14 17:19:00 +01:00
parent 908e017a40
commit def4fb764b
2 changed files with 15 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -9,6 +9,8 @@ When using the [deploy-book-workflow](../external/deploy-book-workflow/README.md
Read the docs is not recommended for final versions of your book because of the advertisement in the free version.
This workflow does not work if you have local sphinx extensions in your book (extensions in `book/_ext` like [](./apa.md)).
## Setting up building of pull-requests
### Add configuration file to your repository
@ -24,11 +26,13 @@ build:
python: "3.13"
jobs:
pre_build:
- "sed -i '/local_extensions:/,/^[^ ]/d' book/_config.yml"
- "jupyter-book config sphinx book/"
python:
install:
- requirements: requirements.txt
- requirements: standard-imghdr
sphinx:
builder: html
@ -36,8 +40,6 @@ sphinx:
configuration: book/conf.py
```
You might need to add `standard-imghdr` to your `requirements.txt` file if the build fails when you've configured it in Read the Docs (if the error tells you `ModuleNotFoundError: No module named 'imghdr'`)
### Setup Read The Docs account
Setup an account at [](https://app.readthedocs.org/accounts/login/?next=/dashboard/). We recommend using your GitHub account for authentication.
@ -53,4 +55,14 @@ On your [dashboard](https://app.readthedocs.org/dashboard/), add a new project.
### Enable Pull Request build
In the setting of your newest project, enable build of pull request by selecting the option in `Building - Pull request builds - Build pull requests for this project`.
In the setting of your newest project, enable build of pull request by selecting the option in `Building - Pull request builds - Build pull requests for this project`.
## Usage
When opening a pull request, GitHub will shows this line:
![Read the docs in GitHub preview](./figures/readthedocs1.png)
Click 'Details' to see the logs of the build process.
Whenever the build is done, c