Skip to content

Commit 27c4998

Browse files
authored
Add documentation for how to administer Read the Docs for documentation and update Plone Sphinx Theme configuration (#1667)
* Add documentation for how to administer Read the Docs for documentation * Remove subprojects mention * Remove Netlify configuration * Update requirements files * Remove netlify.toml * Add RTD configuration * Update conf.py for new theme * Add configuration for pull request previews on RTD * Try using deps to pull in submodules and create symlinks * RTD cannot run multiple make targets * Remove obsolete Sphinx template `_templates/sections/header-article.html` * Purge Netlify * Fix link references * Relocate static files * Purge Netlify * Clean up `conf.py` * Fix link * Revert "Try using deps to pull in submodules and create symlinks" This reverts commit c23aa55. * Rename headings and improve flow * Rewrite search engine indexing section Add Cancel builds programmatically section Add Cancel builds on a branch section * Update configuration to build only on changes to docs files * Use commands instead * - Sort items in .gitignore - Remove obsolete documentation-custom.css file - Merge `conf.py` with 6.0 * - Remove obsolete custom.css file * Update comments in linkcheckignore * plone.api must be installed to build its API docs. Remove symlinks in `distclean` allows its installation. * Tidy up conf.py * This file's content was migrated elsewhere * Disable Edit this page, and add comments explaining that it does not support multiple repositories * Update documentation for build pull request previews.
1 parent 9644d6f commit 27c4998

File tree

10 files changed

+65
-55
lines changed

10 files changed

+65
-55
lines changed

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
# Generated files
55
/_build
6-
/styles/Microsoft
76
/share
7+
/styles/Microsoft
88

99
# symlinked from submodule
10-
docs/volto
11-
docs/plone.restapi
1210
docs/plone.api
11+
docs/plone.restapi
12+
docs/volto
1313

1414
# editor files
1515
.vscode

Makefile

+16-11
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ clean: ## Clean docs build directory
3030
cd $(DOCS_DIR) && rm -rf $(BUILDDIR)/
3131

3232
.PHONY: distclean
33-
distclean: clean ## Clean docs build directory and Python virtual environment
33+
distclean: clean ## Clean docs build directory, Python virtual environment, and symlinks
3434
rm -rf venv
35+
rm docs/plone.api
36+
rm docs/plone.restapi
37+
rm docs/volto
38+
@echo
39+
@echo "Cleaned docs build directory, Python virtual environment, and symlinks."
3540

3641
venv/bin/python: ## Setup up Python virtual environment and install requirements
3742
python3 -m venv venv
@@ -40,24 +45,24 @@ venv/bin/python: ## Setup up Python virtual environment and install requirement
4045
@echo
4146
@echo "Installation of requirements completed."
4247

43-
docs/plone.api:
44-
git submodule init; \
45-
git submodule update; \
46-
venv/bin/pip install -e submodules/plone.api/"[test]"; \
48+
docs/plone.api: ## Setup plone.api docs
49+
git submodule init
50+
git submodule update
51+
venv/bin/pip install -e submodules/plone.api/"[test]"
4752
ln -s ../submodules/plone.api/docs ./docs/plone.api
4853
@echo
4954
@echo "Documentation of plone.api initialized."
5055

51-
docs/plone.restapi:
52-
git submodule init; \
53-
git submodule update; \
56+
docs/plone.restapi: ## Setup plone.restapi docs
57+
git submodule init
58+
git submodule update
5459
ln -s ../submodules/plone.restapi ./docs/plone.restapi
5560
@echo
5661
@echo "Documentation of plone.restapi initialized."
5762

58-
docs/volto:
59-
git submodule init; \
60-
git submodule update; \
63+
docs/volto: ## Setup Volto docs
64+
git submodule init
65+
git submodule update
6166
ln -s ../submodules/volto/docs/source ./docs/volto
6267
@echo
6368
@echo "Documentation of volto initialized."

docs/backend/upgrading/version-specific-migration/upgrade-to-60.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ The standard theme in Classic UI was updated to Bootstrap 5, CSS variables, and
168168
If you have a theme that builds on Barceloneta, you most likely need various changes.
169169

170170
It may be best to start with a fresh theme, and try to keep the changes minimal.
171-
The training documentation lists {doc}`three possible theming strategies <theming_plone_5/index>`:
171+
The training documentation lists {doc}`three possible theming strategies <training-2022:theming_plone_5/index>`:
172172

173173
- Create a theme based on Barceloneta.
174174
- Create a theme from scratch.

docs/conf.py

+29-25
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
# The full version, including alpha/beta/rc tags.
3434
release = "6"
3535

36+
3637
# -- General configuration ----------------------------------------------------
3738

3839
# Add any paths that contain templates here, relative to this directory.
@@ -85,11 +86,14 @@
8586
# Ignore pages that require authentication
8687
r"https://github.com/orgs/plone/teams/", # requires auth
8788
r"https://github.com/plone/documentation/issues/new", # requires auth
89+
r"https://github.com/plone/volto/issues/new/choose", # requires auth
8890
r"https://opensource.org/", # requires auth
8991
# Ignore github.com pages with anchors
9092
r"https://github.com/.*#.*",
9193
# Ignore github.com searches
9294
r"https://github.com/search",
95+
# Ignore GitHub 429 Client Error: Too Many Requests for url
96+
r"https://github.com/collective/plone.app.locales/commits/master/",
9397
# Ignore rate limiting by github.com
9498
r"https://github.com/plone/volto/issues",
9599
r"https://github.com/plone/volto/pull",
@@ -98,11 +102,8 @@
98102
r"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors#Identifying_the_issue",
99103
r"https://docs.cypress.io/guides/references/migration-guide#Migrating-to-Cypress-version-10-0", # volto
100104
# Ignore unreliable sites
101-
# r"https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi", # TODO retest with latest Sphinx when upgrading theme. chromewebstore recently changed its URL and has "too many redirects".
102-
# r"https://chromewebstore.google.com/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd", # TODO retest with latest Sphinx when upgrading theme. chromewebstore recently changed its URL and has "too many redirects".
103-
# r"https://stackoverflow.com", # volto and documentation # TODO retest with latest Sphinx.
104-
r"https://web.archive.org/", # volto
105-
# r"https://www.youtube.com/playlist", # volto, TODO remove after installing sphinxcontrib.youtube
105+
r"https://web.archive.org/",
106+
r"https://www.youtube.com/playlist", # volto, TODO remove after installing sphinxcontrib.youtube
106107
r"http://z3c.pt", # fluke where Sphinx interprets this as a URL
107108
]
108109
linkcheck_allowed_redirects = { # TODO: Confirm usage of linkcheck_allowed_redirects
@@ -241,22 +242,23 @@
241242
"primary_sidebar_end": [
242243
"version-switcher",
243244
],
244-
"repository_branch": "main",
245+
"repository_branch": "6.0",
245246
"repository_url": "https://github.com/plone/documentation",
246247
"search_bar_text": "Search",
247248
"switcher": {
248249
"json_url": "https://6.docs.plone.org/_static/switcher.json",
249250
"version_match": version,
250251
},
251-
"use_edit_page_button": True,
252+
"use_edit_page_button": False, # This option does not support multiple repositories.
252253
"use_issues_button": True,
253254
"use_repository_button": True,
254255
}
255256
# suggest edit link
256257
# remark: {{ file_name }} is mandatory in "edit_page_url_template"
257-
html_context = {
258-
"edit_page_url_template": "https://6.docs.plone.org/contributing/index.html?{{ file_name }}#making-contributions-on-github",
259-
}
258+
# used by `use_edit_page_button`, but it does not support multiple repositories
259+
# html_context = {
260+
# "edit_page_url_template": "https://6.docs.plone.org/contributing/documentation/index.html?{{ file_name }}#making-contributions-on-github",
261+
# }
260262

261263
# Announce that we have an opensearch plugin
262264
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_use_opensearch
@@ -275,7 +277,6 @@
275277
html_extra_path = [
276278
"robots.txt",
277279
]
278-
279280
# Add any paths that contain custom static files (such as style sheets) here,
280281
# relative to this directory. They are copied after the builtin static files,
281282
# so a file named "default.css" will overwrite the builtin "default.css".
@@ -295,16 +296,7 @@
295296
# Don't show class signature with the class' name.
296297
autodoc_class_signature = "separated"
297298

298-
299-
# -- Options for sphinx_sitemap to html -----------------------------
300-
301-
# Used by sphinx_sitemap to generate a sitemap
302-
html_baseurl = "https://6.docs.plone.org/"
303-
# https://sphinx-sitemap.readthedocs.io/en/latest/advanced-configuration.html#customizing-the-url-scheme
304-
sitemap_url_scheme = "{link}"
305-
sitemap_filename = "sitemap-custom.xml"
306-
307-
# -- Options for myST markdown conversion to html -----------------------------
299+
# -- Options for MyST markdown conversion to HTML -----------------------------
308300

309301
# For more information see:
310302
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
@@ -328,6 +320,7 @@
328320
"fawrench": '<span class="fa fa-wrench" style="font-size: 1.6em;"></span>',
329321
}
330322

323+
331324
# -- Intersphinx configuration ----------------------------------
332325

333326
# This extension can generate automatic links to the documentation of objects
@@ -359,7 +352,7 @@
359352

360353

361354
# -- Mermaid configuration ----------------------------------
362-
# mermaid_version = "10.9.1"
355+
mermaid_version = "11.2.0"
363356

364357

365358
# -- OpenGraph configuration ----------------------------------
@@ -374,12 +367,13 @@
374367
]
375368

376369

377-
# -- sphinx.ext.todo -----------------------
370+
# -- Options for sphinx.ext.todo -----------------------
371+
378372
# See http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos
379373
todo_include_todos = True
380374

381375

382-
# -- sphinx-notfound-page configuration ----------------------------------
376+
# -- Options for sphinx-notfound-page ----------------------------------
383377

384378
notfound_urls_prefix = ""
385379
notfound_template = "404.html"
@@ -396,6 +390,15 @@
396390
}
397391

398392

393+
# -- Options for sphinx_sitemap to HTML -----------------------------
394+
395+
# Used by sphinx_sitemap to generate a sitemap
396+
html_baseurl = "https://6.docs.plone.org/"
397+
# https://sphinx-sitemap.readthedocs.io/en/latest/advanced-configuration.html#customizing-the-url-scheme
398+
sitemap_url_scheme = "{link}"
399+
sitemap_filename = "sitemap-custom.xml"
400+
401+
399402
# -- Options for HTML help output -------------------------------------------------
400403

401404
# Output file base name for HTML help builder.
@@ -411,7 +414,7 @@
411414
"index",
412415
"PloneDocumentation.tex",
413416
"Plone Documentation",
414-
"The Plone community",
417+
"Plone community",
415418
"manual",
416419
),
417420
]
@@ -421,6 +424,7 @@
421424
latex_logo = "_static/logo_2x.png"
422425

423426
# -- Configuration for source_replacements extension -----------------------
427+
424428
# An extension that allows replacements for code blocks that
425429
# are not supported in `rst_epilog` or other substitutions.
426430
# https://stackoverflow.com/a/56328457/2214933

docs/contributing/documentation/admins.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ The following are example files that you can use to configure your project for p
9696
9797
- [Plone Sphinx Theme `Makefile`](https://github.com/plone/plone-sphinx-theme/blob/main/Makefile), specifically the `rtd-pr-preview` section.
9898
This is the command to use to build documentation previews on Read the Docs.
99-
- [Plone Sphinx Theme `requirements-dev.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.
99+
- [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.
100100
- [Plone Sphinx Theme `conf.py`](https://github.com/plone/plone-sphinx-theme/blob/main/docs/conf.py) the Sphinx configuration file to 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.
101+
- [Plone Sphinx Theme `.readthedocs.yaml`](https://github.com/plone/plone-sphinx-theme/blob/main/.readthedocs.yaml) specifies the configuration and Makefile command that Read the Docs uses 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 and there are changes to the documentation files.
103+
You might need to adjust the `paths` and `project-slug` for your documentation.
104104
105105
106106
### Import your project
@@ -113,9 +113,10 @@ After logging in to your Read the Docs account, you can import your project.
113113
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`.
114114
The defaults are usually accurate.
115115
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.
116+
Read the Docs will redirect you to the project details, and start building the docs, but you don't need to wait.
117+
1. Click the {guilabel}`Settings` button.
118+
1. Scroll to the end of the page and check the box for {guilabel}`Build pull requests for this project`.
119+
1. Click {guilabel}`Save` to save the new setting.
119120

120121

121122
### Search engine indexing
@@ -138,10 +139,10 @@ cp source-path/block-robots.txt docs-root-path/robots.txt
138139
```
139140

140141
```{seealso}
142+
- [`robots.txt` support](https://docs.readthedocs.io/en/stable/reference/robots.html)
141143
- [Automation rules](https://docs.readthedocs.io/en/stable/automation-rules.html)
142144
- [Versions](https://docs.readthedocs.io/en/stable/versions.html)
143145
- [Managing versions automatically](https://docs.readthedocs.io/en/stable/guides/automation-rules.html)
144-
- [`robots.txt` support](https://docs.readthedocs.io/en/stable/reference/robots.html)
145146
```
146147

147148

docs/contributing/documentation/themes-and-extensions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ We use several MyST and Sphinx extensions to enhance the presentation of Plone d
5858
- [`sphinx_reredirects`](https://documatt.com/sphinx-reredirects/) handles redirects for moved pages.
5959
- [`sphinx_sitemap`](https://pypi.org/project/sphinx-sitemap/) generates multiversion and multilanguage [sitemaps.org](https://www.sitemaps.org/protocol.html) compliant sitemaps.
6060
- [`sphinxcontrib.httpdomain`](https://sphinxcontrib-httpdomain.readthedocs.io/en/stable/) provides a Sphinx domain for describing HTTP APIs.
61-
It is used by Plone's {doc}`plone.restapi/docs/source/index`.
61+
It is used by Plone's {doc}`/plone.restapi/docs/source/index`.
6262
- [`sphinxcontrib.httpexample`](https://sphinxcontrib-httpexample.readthedocs.io/en/latest/) enhances `sphinxcontrib-httpdomain` by generating RESTful HTTP API call examples for different tools from a single HTTP request example.
6363
Supported tools include [curl](https://curl.se/), [wget](https://www.gnu.org/software/wget/), [httpie](https://httpie.io/), and [python-requests](https://requests.readthedocs.io/en/latest/).
64-
It is used by Plone's {doc}`plone.restapi/docs/source/index`.
64+
It is used by Plone's {doc}`/plone.restapi/docs/source/index`.
6565
- [`sphinxcontrib.video`](https://pypi.org/project/sphinxcontrib-video/) allows you to embed local videos as defined by the HTML5 standard.
6666
- [`sphinxext.opengraph`](https://pypi.org/project/sphinxext-opengraph/) generates [OpenGraph metadata](https://ogp.me/).

docs/contributing/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Plone API
167167

168168
Plone REST API
169169
: A RESTful API for Plone.
170-
See {doc}`plone.restapi/docs/source/contributing/index`.
170+
See {doc}`/plone.restapi/docs/source/contributing/index`.
171171

172172
Volto
173173
: Plone 6 default frontend.

requirements-initial.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# requirements-initial.txt
12
# From https://dist.plone.org/release/6-latest/constraints.txt
23
pip==24.0
34
setuptools==71.0.0

requirements-netlify.txt

-1
This file was deleted.

requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ linkify-it-py
33
plone-sphinx-theme
44
sphinx-autobuild
55
sphinx-copybutton
6-
sphinx-design
6+
sphinx-design # Documentation only
77
sphinx-examples
88
sphinx-notfound-page # Documentation only
99
sphinx-reredirects
1010
sphinx-sitemap
11-
sphinxcontrib.httpdomain
12-
sphinxcontrib.httpexample
11+
sphinxcontrib.httpdomain # plone.restapi
12+
sphinxcontrib.httpexample # plone.restapi
1313
sphinxcontrib-video
1414
sphinxext-opengraph
1515
sphinxcontrib.mermaid

0 commit comments

Comments
 (0)