Skip to content

Commit 35fb31e

Browse files
committed
Add documentation for how to administer Read the Docs for documentation
1 parent a83aea0 commit 35fb31e

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ livehtml: deps ## Rebuild Sphinx documentation on changes, with live-reload in
224224
--port 8050 \
225225
-b html . "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
226226

227+
.PHONY: rtd-pr-preview
228+
rtd-pr-preview: bin/python ## Build pull request preview on Read the Docs
229+
cd $(DOCS_DIR) && $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ${READTHEDOCS_OUTPUT}/html/
230+
227231
.PHONY: netlify
228232
netlify:
229233
pip install -r requirements-initial.txt

docs/contributing/documentation/admins.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ myst:
44
"description": "Administrators' guide to writing Plone Documentation. It covers automated deployments, hosting, automated testing, previewing, and importing external package documentation into Plone Documentation."
55
"property=og:description": "Administrators' guide to writing Plone Documentation. It covers automated deployments, hosting, automated testing, previewing, and importing external package documentation into Plone Documentation."
66
"property=og:title": "Administrators Guide"
7-
"keywords": "Plone, Documentation, automated deployments, hosting, automated testing, importing external packages"
7+
"keywords": "Plone, Documentation, automated deployments, hosting, automated testing, importing external packages, preview, build, pull request"
88
---
99

1010
(administrators-guide-label)=
@@ -84,6 +84,54 @@ To make it easier for other contributors to work with your project, update the f
8484
Commit and push your changes to a remote, and submit a pull request against [`plone/[email protected]`](https://github.com/plone/documentation/compare).
8585

8686

87+
## Add a project to Read the Docs
88+
89+
To add a new site to Read the Docs to preview documentation or storybooks in pull requests, you need to configure your project's repository and import it into Read the Docs.
90+
You also need an account on Read the Docs and have write access to the repository.
91+
92+
93+
### Configuration files
94+
95+
The following are example files that you can use to configure your project for Read the Docs pull request previews.
96+
97+
- [Plone Sphinx Theme `Makefile`](https://github.com/plone/plone-sphinx-theme/blob/main/Makefile), specifically the `rtd-pr-preview` section.
98+
This is the command to use to build documentation previews on Read the Docs.
99+
- [Plone Sphinx Theme `requirements-initial.txt`](https://github.com/plone/plone-sphinx-theme/blob/main/requirements-initial.txt) specifies the initial Python packaging tool requirements to set up a virtual environment.
100+
- [Plone Sphinx Theme `requirements-docs.txt`](https://github.com/plone/plone-sphinx-theme/blob/main/requirements-docs.txt) specifies the requirements to use Plone Sphinx Theme and build the docs.
101+
- [Plone Sphinx Theme `.readthedocs.yaml`](https://github.com/plone/plone-sphinx-theme/blob/main/readthedocs.yaml) specifies the configuration and command to build the docs.
102+
- [Plone Sphinx Theme `.github/workflows/rtd-pr-preview.yml`](https://github.com/plone/plone-sphinx-theme/blob/main/.github/workflows/rtd-pr-preview.yml) specifies when to build the docs, specifically only when a pull request is opened against the `main` branch and there are changes to documentation files.
103+
You might need to adjust the branch name, paths, and files to check for changes.
104+
105+
106+
### Read the Docs administration
107+
108+
After logging in to your Read the Docs account, you can import your project.
109+
110+
1. Click {guilabel}`Add project`.
111+
1. For {guilabel}`Repository name`, enter the GitHub organization, a forward slash, and the repository to import, for example, `plone/volto`.
112+
1. Click {guilabel}`Continue`.
113+
1. In the {guilabel}`Add project` screen, you can configure basic project settings, including its {guilabel}`Name`, {guilabel}`Repository URL`, {guilabel}`Default branch`, and {guilabel}`Language`.
114+
The defaults are usually accurate.
115+
1. Click {guilabel}`Next`.
116+
1. A sample `.readthedocs.yaml` file is suggested, if you have not already added one.
117+
1. Click {guilabel}`Finish`.
118+
Read the Docs will redirect you to the project details, and start building the docs.
119+
120+
Plone uses an organization on Read the Docs.
121+
The main project is Plone Documentation.
122+
All other Plone projects with documentation should be configured as subprojects.
123+
124+
```{todo}
125+
Add how to set up a subproject.
126+
```
127+
128+
For most Plone projects, you will not want to Read the Docs to publish the `latest` or other specific versions.
129+
Plone projects currently self-host their official documentation.
130+
131+
1. For the version that you want to deactivate, click its {guilabel}`…` icon, and select {guilabel}`Configure version`.
132+
1. Toggle the {guilabel}`Active` option off, and click {guilabel}`Update version`.
133+
134+
87135
## Add a project to Netlify
88136
89137
To add a new site to Netlify to preview built documentation or storybooks, you need to add a new site to Netlify.

0 commit comments

Comments
 (0)