Skip to content

Commit a7302af

Browse files
authored
Merge pull request #26 from codesyntax/llms-docs
Llms docs
2 parents 2f1544f + 61acc61 commit a7302af

13 files changed

Lines changed: 353 additions & 19 deletions

File tree

.github/workflows/main.yml

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,57 @@ jobs:
1414
name: "Backend: Lint"
1515
needs:
1616
- config
17-
uses: plone/meta/.github/workflows/backend-lint.yml@2.x
18-
with:
19-
python-version: ${{ needs.config.outputs.python-version }}
20-
plone-version: ${{ needs.config.outputs.plone-version }}
17+
runs-on: ubuntu-latest
18+
env:
19+
PYTHON_VERSION: ${{ needs.config.outputs.python-version }}
20+
PLONE_VERSION: ${{ needs.config.outputs.plone-version }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v6
24+
25+
- name: Setup codebase
26+
uses: plone/meta/.github/actions/setup_backend_uv@2.x
27+
with:
28+
python-version: ${{ needs.config.outputs.python-version }}
29+
plone-version: ${{ needs.config.outputs.plone-version }}
30+
31+
- name: Check formatting
32+
id: ruff-format
33+
shell: bash
34+
run: |
35+
uvx ruff@latest format --diff
36+
37+
- name: Check lint
38+
id: ruff-lint
39+
if: ${{ success() || failure() }}
40+
shell: bash
41+
run: |
42+
uvx ruff@latest check --diff
43+
44+
- name: Check XML / ZCML
45+
id: zpretty
46+
if: ${{ success() || failure() }}
47+
shell: bash
48+
run: |
49+
uvx zpretty@latest --check src
50+
51+
- name: Check Python Versions
52+
id: py-versions
53+
if: ${{ success() || failure() }}
54+
shell: bash
55+
run: |
56+
uvx check-python-versions@latest .
57+
58+
- name: Report
59+
if: ${{ success() || failure() }}
60+
run: |
61+
echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY
62+
echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY
63+
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
64+
echo '| Format | ${{ steps.ruff-format.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
65+
echo '| Lint | ${{ steps.ruff-lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
66+
echo '| XML / ZCML | ${{ steps.zpretty.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
67+
echo '| Python Versions | ${{ steps.py-versions.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
2168
2269
test:
2370
name: "Backend: Test"

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This document contains the guidelines, commands, and code style rules for AI cod
66

77
This project uses `make` as the primary task runner, backed by `uv` for Python environment management and `hatchling` as the build system.
88

9+
**IMPORTANT MANDATE**: After you modify *any* Python, XML, ZCML, or PT file, you MUST run `make check` (or `make format && make lint`) and fix any resulting errors before completing your task.
10+
911
### Installation and Running
1012
- **Install the project**:
1113
```bash

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ create-site: $(VENV_FOLDER) instance/etc/zope.ini ## Create a new site from scra
100100
lint: ## Check and fix code base according to Plone standards
101101
@echo "$(GREEN)==> Lint codebase$(RESET)"
102102
@uvx ruff@latest check --fix --config $(BACKEND_FOLDER)/pyproject.toml
103-
@uvx pyroma@latest -d .
103+
@uvx --with=hatchling pyroma@latest -d .
104104
@uvx check-python-versions@latest .
105105
@uvx zpretty@latest --check src
106106

docs/docs/conf.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
# -- Path setup --------------------------------------------------------------
66

77
from datetime import datetime
8-
98
from packaging.version import Version
109
from plone_sphinx_theme import __version__
1110

11+
1212
# If extensions (or modules to document with autodoc) are in another directory,
1313
# add these directories to sys.path here. If the directory is relative to the
1414
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -24,7 +24,7 @@
2424
trademark_name = "codesyntax"
2525
now = datetime.now()
2626
year = str(now.year)
27-
copyright = year
27+
copyright = year # noqa: A001
2828

2929

3030
# The version info for the project you're documenting, acts as replacement for
@@ -69,6 +69,7 @@
6969
"sphinx_copybutton",
7070
"sphinx_design",
7171
"sphinx_examples",
72+
"sphinx_llms_txt",
7273
"sphinx_reredirects",
7374
"sphinx_sitemap",
7475
"sphinx_tippy",
@@ -100,8 +101,8 @@
100101
r"https://github.com/.*#.*",
101102
# Ignore other specific anchors
102103
]
103-
linkcheck_allowed_redirects = { # TODO: Confirm usage of linkcheck_allowed_redirects
104-
# All HTTP redirections from the source URI to the canonical URI will be treated as "working".
104+
linkcheck_allowed_redirects = {
105+
# All HTTP redirections from the source URI to the canonical URI will be treated as "working". # noqa: E501
105106
}
106107
linkcheck_anchors = True
107108
linkcheck_timeout = 5
@@ -131,7 +132,7 @@
131132
html_theme = "plone_sphinx_theme" # This can be configured
132133
html_logo = "_static/logo.svg"
133134
html_favicon = "_static/favicon.svg"
134-
# The default value includes icon-links, so override it with that one omitted, and add it to html_theme_options[footer_content_items].
135+
# The default value includes icon-links, so override it with that one omitted, and add it to html_theme_options[footer_content_items]. # noqa: E501
135136
html_sidebars = {
136137
"**": [
137138
"navbar-logo",
@@ -141,8 +142,8 @@
141142
}
142143
html_theme_options = {
143144
"article_header_start": ["toggle-primary-sidebar"],
144-
# "extra_footer": """<p>Example `extra_footer` content. License info. Trademark info and usage.</p>
145-
# <p>Pull request previews by <a href="https://readthedocs.org/">Read the Docs</a>.</p>""",
145+
# "extra_footer": """<p>Example `extra_footer` content. License info. Trademark info and usage.</p> # noqa: E501
146+
# <p>Pull request previews by <a href="https://readthedocs.org/">Read the Docs</a>.</p>""", # noqa: E501
146147
"footer_content_items": [
147148
"author",
148149
"copyright",
@@ -247,12 +248,12 @@
247248
myst_enable_extensions = [
248249
"attrs_block", # Support parsing of block attributes.
249250
"attrs_inline", # Support parsing of inline attributes.
250-
"colon_fence", # You can also use ::: delimiters to denote code fences, instead of ```.
251-
"deflist", # Support definition lists. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists
252-
"html_image", # For inline images. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images
251+
"colon_fence", # You can also use ::: delimiters to denote code fences, instead of ```. # noqa: E501
252+
"deflist", # Support definition lists. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists # noqa: E501
253+
"html_image", # For inline images. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images # noqa: E501
253254
"linkify", # Identify "bare" web URLs and add hyperlinks.
254-
"strikethrough", # See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-strikethrough
255-
"substitution", # Use Jinja2 for substitutions. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2
255+
"strikethrough", # See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-strikethrough # noqa: E501
256+
"substitution", # Use Jinja2 for substitutions. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2 # noqa: E501
256257
]
257258

258259
myst_substitutions = {}

docs/docs/how-to-guides/custom-row-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Next, register the view in your `configure.zcml` so Plone knows it exists. It is
6161

6262
```xml
6363
<browser:page
64-
name="myaddon-video-embed-view"
64+
name="cs_dynamicpages-myaddon-video-embed-view"
6565
for="cs_dynamicpages.content.dynamic_page_row.IDynamicPageRow"
6666
template="video_embed_view.pt"
6767
permission="zope2.View"
@@ -85,7 +85,7 @@ You must register it in the {term}`Dynamic Pages Registry` (`IDynamicPagesContro
8585
<value purge="False">
8686
<element>
8787
<!-- The ZCML name of your view -->
88-
<key name="row_type">myaddon-video-embed-view</key>
88+
<key name="row_type">cs_dynamicpages-myaddon-video-embed-view</key>
8989

9090
<!-- The icon to display in the dropdown (Bootstrap/Plone icon name) -->
9191
<key name="row_type_icon">play-btn</key>

docs/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dev = [
3030
"sphinx-copybutton",
3131
"sphinx-design",
3232
"sphinx-examples",
33+
"sphinx-llms-txt",
3334
"sphinx-notfound-page",
3435
"sphinx-reredirects",
3536
"sphinx-sitemap",

docs/uv.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

news/+llm.internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add llms plugin for documentation @erral

news/+tests.internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add tests for documentation how-tos @erral

src/cs_dynamicpages/tests/how_tos/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)