diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-07 09:25:54 +0300 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-07 09:25:54 +0300 |
| commit | 8a7e96d6fa25a1098c134146883d4f577ab229ca (patch) | |
| tree | 3d121a0903c001042051d3d266f890064daa1770 | |
| parent | 28ed24cc1b97a8861db6963233f6496134827611 (diff) | |
| download | vyos-documentation-8a7e96d6fa25a1098c134146883d4f577ab229ca.tar.gz vyos-documentation-8a7e96d6fa25a1098c134146883d4f577ab229ca.zip | |
docs(conf.py): set Jinja autoescape=False explicitly for llms.txt template
The llms.txt template renders plain text (markdown), not HTML, so the
HTML autoescape rules that bandit/ruff S701 flags don't apply.
Explicit `autoescape=False` silences the lint while documenting the
intent — there's no HTML context to escape into here.
Behavior unchanged (Jinja's default `autoescape=False` was already in
effect); this just makes it visible.
Same change applied symmetrically across [#1874](https://github.com/vyos/vyos-documentation/pull/1874) (current),
[#1876](https://github.com/vyos/vyos-documentation/pull/1876) (sagitta), and [#1903](https://github.com/vyos/vyos-documentation/pull/1903) (circinus).
Addresses CodeRabbit review feedback (S701) on PR #1876.
\xf0\x9f\xa4\x96 Generated by [robots](https://vyos.io)
| -rw-r--r-- | CLAUDE.md | 11 | ||||
| -rw-r--r-- | docs/conf.py | 4 |
2 files changed, 12 insertions, 3 deletions
@@ -107,9 +107,14 @@ Each configuration page should contain: ## LLM-Facing Files (`llms.txt`, `llms-full.txt`) -Both files are regenerated on every Sphinx HTML build. They're shipped at the -docs root for each version (`https://docs.vyos.io/en/<version>/llms.txt`, -`.../llms-full.txt`). +Both files are regenerated on every `html` and `readthedocs` builder run. +The `dirhtml` builder is intentionally skipped (the curated template +encodes `.html` URLs which don't match `dirhtml` output paths). Local +`make dirhtml` won't emit `llms.txt` — production publishes via the +`html`/`readthedocs` builders, where the file lands. + +Files are shipped at the docs root for each version +(`https://docs.vyos.io/en/<version>/llms.txt`, `.../llms-full.txt`). - **`llms-full.txt`** — auto-generated by the `sphinx_llms_txt` extension from the full corpus. No curation; configured by `llms_txt_file = False` (which diff --git a/docs/conf.py b/docs/conf.py index 00324771..d3db8d2b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -283,6 +283,10 @@ def _write_llms_txt(app, exception): loader=FileSystemLoader(str(tpl_dir)), undefined=StrictUndefined, keep_trailing_newline=True, + # Plain-text template (not HTML), so HTML autoescape is not + # appropriate. Setting autoescape=False explicitly to silence + # bandit/ruff S701 and document the intent. + autoescape=False, ) template = env.get_template('llms.txt.j2') rendered = template.render( |
