Skip to content

Commit f93567c

Browse files
committed
lint and format
1 parent 26b5029 commit f93567c

24 files changed

Lines changed: 1080 additions & 3 deletions

File tree

docs/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Python related
2+
*.egg-info
3+
.venv
4+
5+
# Documentation builds
6+
_build
7+
styles/Microsoft

docs/.readthedocs.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the OS, Python version and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.13"
13+
commands:
14+
# Cancel building pull requests when there aren't changes in the docs directory or YAML file.
15+
# You can add any other files or directories that you'd like here as well,
16+
# like your docs requirements file, or other files that will change your docs build.
17+
#
18+
# If there are no changes (git diff exits with 0) we force the command to return with 183.
19+
# This is a special exit code on Read the Docs that will cancel the build immediately.
20+
- |
21+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/docs/ docs/styles/ .readthedocs.yaml docs/.vale.ini docs/Makefile docs/uv.lock .github/workflows/docs.yml;
22+
then
23+
exit 183;
24+
fi
25+
- cd docs && make rtd-pr-preview

docs/.vale.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
StylesPath = styles
2+
3+
MinAlertLevel = suggestion
4+
5+
Vocab = Base,Plone
6+
7+
Packages = Microsoft
8+
9+
[*]
10+
BasedOnStyles = Vale, Microsoft
11+
Microsoft.Contractions = suggestion
12+
Microsoft.Units = suggestion

docs/LICENSE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cs_dynamicpages Copyright 2025, Lur Ibargutxi
2+
3+
The text and illustrations in this website are licensed by the Plone Foundation under a [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/) license. Plone and the Plone® logo are registered trademarks of the Plone Foundation, registered in the United States and other countries. For guidelines on the permitted uses of the Plone trademarks, see [https://plone.org/foundation/logo](https://plone.org/foundation/logo). All other trademarks are owned by their respective owners.

docs/Makefile

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Makefile for Sphinx documentation
2+
.DEFAULT_GOAL = help
3+
SHELL = bash
4+
5+
# You can set these variables from the command line.
6+
SPHINXOPTS ?=
7+
PAPER ?=
8+
9+
# Internal variables.
10+
GREEN=`tput setaf 2`
11+
RESET=`tput sgr0`
12+
DOCS_DIR = ./docs/
13+
BUILDDIR = ./_build
14+
PAPEROPT_a4 = -D latex_paper_size=a4
15+
PAPEROPT_letter = -D latex_paper_size=letter
16+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(DOCS_DIR)
17+
VALEFILES := $(shell find $(DOCS_DIR) -type f -name "*.md" -print)
18+
VALEOPTS ?=
19+
PYTHONVERSION = >=3.11,<3.14
20+
21+
# Add the following 'help' target to your Makefile
22+
# And add help text after each target name starting with '\#\#'
23+
.PHONY: help
24+
help: # This help message
25+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
26+
27+
28+
# environment management
29+
.venv/bin/python: ## Create Python virtual environment and install package requirements
30+
@uv sync
31+
32+
.PHONY: install
33+
install: .venv/bin/python ## Sync package requirements
34+
35+
36+
.PHONY: init
37+
init: clean clean-python .venv/bin/python ## Clean docs build directory and Python, and initialize Python virtual environment
38+
39+
.PHONY: clean
40+
clean: ## Clean docs build directory
41+
cd $(DOCS_DIR) && rm -rf $(BUILDDIR)/
42+
43+
.PHONY: clean-python
44+
clean-python: clean
45+
rm -rf .venv/
46+
rm -rf *.egg-info
47+
# /environment management
48+
49+
50+
# documentation builders
51+
.PHONY: html
52+
html: .venv/bin/python ## Build html
53+
@uv run sphinx-build -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54+
@echo
55+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56+
57+
.PHONY: livehtml
58+
livehtml: .venv/bin/python ## Rebuild Sphinx documentation on changes, with live-reload in the browser
59+
@uv run sphinx-autobuild \
60+
--ignore "*.swp" \
61+
--port 8050 \
62+
-b html $(DOCS_DIR) "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
63+
64+
.PHONY: dirhtml
65+
dirhtml: .venv/bin/python
66+
@uv run sphinx-build -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
67+
@echo
68+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
69+
70+
.PHONY: singlehtml
71+
singlehtml: .venv/bin/python
72+
@uv run sphinx-build -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
73+
@echo
74+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
75+
76+
.PHONY: text
77+
text: .venv/bin/python
78+
@uv run sphinx-build -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
79+
@echo
80+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
81+
82+
.PHONY: changes
83+
changes: .venv/bin/python
84+
@uv run sphinx-build -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
85+
@echo
86+
@echo "The overview file is in $(BUILDDIR)/changes."
87+
88+
.PHONY: rtd-prepare
89+
rtd-prepare: ## Prepare environment on Read the Docs
90+
asdf plugin add uv
91+
asdf install uv latest
92+
asdf global uv latest
93+
94+
.PHONY: rtd-pr-preview ## Build pull request previews on Read the Docs
95+
rtd-pr-preview: rtd-prepare .venv/bin/python ## Build pull request preview on Read the Docs
96+
cd $(DOCS_DIR) && $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ${READTHEDOCS_OUTPUT}/html/
97+
# /documentation builders
98+
99+
100+
# test
101+
.PHONY: linkcheck
102+
linkcheck: .venv/bin/python ## Run linkcheck
103+
@uv run sphinx-build -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
104+
@echo
105+
@echo "Link check complete; look for any errors in the above output " \
106+
"or in $(BUILDDIR)/linkcheck/ ."
107+
108+
.PHONY: linkcheckbroken
109+
linkcheckbroken: .venv/bin/python ## Run linkcheck and show only broken links
110+
@uv run sphinx-build -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | GREP_COLORS='0;31' grep -wi "broken\|redirect" --color=always | GREP_COLORS='0;31' grep -vi "https://github.com/plone/volto/issues/" --color=always && if test $$? = 0; then exit 1; fi || test $$? = 1
111+
@echo
112+
@echo "Link check complete; look for any errors in the above output " \
113+
"or in $(BUILDDIR)/linkcheck/ ."
114+
115+
.PHONY: doctest
116+
doctest: .venv/bin/python ## Test snippets in the documentation
117+
@uv run sphinx-build -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
118+
@echo "Testing of doctests in the sources finished, look at the " \
119+
"results in $(BUILDDIR)/doctest/output.txt."
120+
121+
.PHONY: vale
122+
vale: .venv/bin/python ## Run Vale style, grammar, and spell checks
123+
@uv run vale sync
124+
@uv run vale --no-wrap $(VALEOPTS) $(VALEFILES)
125+
@echo "Vale is finished; look for any errors in the above output."
126+
@echo
127+
128+
.PHONY: test
129+
test: clean vale linkcheckbroken doctest ## Clean docs build, then run vale, linkcheckbroken, and doctest
130+
131+
.PHONY: all
132+
all: clean vale linkcheckbroken html ## Clean docs build, then run linkcheckbroken, and build html
133+
# /test

docs/README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# cs_dynamicpages
2+
3+
Documentation for cs_dynamicpages.
4+
An addon to create dynamic pages for Plone
5+
6+
This project provides a Sphinx-based documentation environment for your Plone project, powered by the [Plone Sphinx Theme](https://github.com/plone/plone-sphinx-theme).
7+
It's generated using the `documentation_starter` template from [Cookieplone](https://github.com/plone/cookieplone).
8+
9+
10+
## Prerequisites
11+
12+
- [uv](https://docs.astral.sh/uv/) is the recommended tool for managing Python versions and project dependencies.
13+
14+
To install uv, use the following command, or visit the [uv installation page](https://docs.astral.sh/uv/getting-started/installation/) for alternative methods.
15+
16+
```shell
17+
curl -LsSf https://astral.sh/uv/install.sh | sh
18+
```
19+
20+
21+
## Build documentation
22+
23+
To build the HTML documentation, issue the following command.
24+
25+
```shell
26+
make html
27+
```
28+
29+
To build the HTML documentation and view a live preview while editing your documentation, issue the following command.
30+
31+
```shell
32+
make livehtml
33+
```
34+
35+
To check for broken links in your documentation, issue the following command.
36+
37+
```shell
38+
make linkcheckbroken
39+
```
40+
41+
To check spelling, grammar, and style in your documentation, issue the following command.
42+
You should pay attention to errors and warnings, and suggestions may get noisy.
43+
44+
```shell
45+
make vale
46+
```
47+
48+
To delete the `docs` build directory and Python virtual environment, and reinitialize Python virtual environment, issue the following command.
49+
This is useful to force reinstall dependencies and purge cached files in Sphinx builds.
50+
51+
```shell
52+
make init
53+
```
54+
55+
For more `make` commands, issue the following command.
56+
57+
```shell
58+
make help
59+
```
60+
61+
62+
## Customize the cs_dynamicpages documentation
63+
64+
This section provides how-to guidance to customize your documentation.
65+
66+
The file `docs/conf.py` controls the configuration of your documentation.
67+
It has extensive comments for each part, often with links to the authoritative documentation for extensions and configuration.
68+
69+
The following sections describe customization not addressed in `docs/conf.py`.
70+
71+
72+
### Manage dependencies
73+
74+
You can configure which dependencies or requirements you want to use in your documentation using uv.
75+
Requirements are stored in the `dev` dependency group in the `pyproject.toml` file.
76+
77+
To add a requirement, use the following command.
78+
79+
```shell
80+
uv add --dev my-requirement
81+
```
82+
83+
To remove a requirement, use the following command.
84+
85+
```shell
86+
uv remove --dev my-requirement
87+
```
88+
89+
See also uv's documentation [Development dependencies](https://docs.astral.sh/uv/concepts/projects/dependencies/#development-dependencies).
90+
91+
After installing a dependency, you might need to add it to your documentation's configuration file, `conf.py`, under the `extensions` key.
92+
93+
94+
### Replace static files
95+
96+
You might want to replace the default static files, located in `docs/_static`, `logo.svg` and `favicon.ico`.
97+
Plone Sphinx Theme is configured to use these files when rendering documentation to HTML.
98+
99+
If you rename `logo.svg`, you must update `conf.py`, under the `html_logo`, `ogp_image`, and `latex_logo` keys.
100+
101+
102+
## Read the Docs
103+
104+
Now that you've built your documentation, how do you publish it?
105+
And how do you get collaborators to easily review your changes to your documentation?
106+
107+
Thankfully, [Read the Docs](https://about.readthedocs.com/) provides both hosting of documentation and pull request previews.
108+
For public repositories, this service is free.
109+
However, the Plone Foundation donates to Read the Docs for their unwavering support to open source software, and encourages you to do the same.
110+
111+
Your documentation scaffold is partially configured to use Read the Docs.
112+
In several files, search for the string `MY_READTHEDOCS_PROJECT_SLUG`.
113+
You'll need to replace that string with the slug that Read the Docs creates for you when you import your project.
114+
115+
For complete documentation of this process, see the Plone 6 Documentation [Pull request preview builds](https://6.docs.plone.org/contributing/documentation/admins.html#pull-request-preview-builds).
116+
117+
See also Read the Docs documentation:
118+
119+
- [Pull request previews](https://docs.readthedocs.com/platform/stable/pull-requests.html)
120+
- [Build process overview](https://docs.readthedocs.com/platform/stable/builds.html)
121+
122+
## Credits and acknowledgements 🙏
123+
124+
This was generated by the [cookieplone-templates documentation_starter template](https://github.com/plone/cookieplone-templates/tree/main/documentation_starter) on 2025-07-07 07:27:42. A special thanks to all contributors and supporters!

docs/docs/_static/favicon.ico

15 KB
Binary file not shown.

0 commit comments

Comments
 (0)