diff --git a/book/features/figures/readthedocs1.png b/book/features/figures/readthedocs1.png new file mode 100644 index 0000000..f1d8d49 Binary files /dev/null and b/book/features/figures/readthedocs1.png differ diff --git a/book/features/pull_request_build.md b/book/features/pull_request_build.md index d90a203..6697d9a 100644 --- a/book/features/pull_request_build.md +++ b/book/features/pull_request_build.md @@ -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`. \ No newline at end of file +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 \ No newline at end of file