diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-12 15:34:04 +0300 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-12 15:34:04 +0300 |
| commit | 9c815d689a2a4a5d433ba15154cb606bd986fc8d (patch) | |
| tree | 66cd7a1da972cfeb6c416a0fd5747524c152ac72 /docs/_include/interface-disable-flow-control.txt | |
| parent | 240012ea1e892cede84be150ef33429b87824a00 (diff) | |
| download | vyos-documentation-9c815d689a2a4a5d433ba15154cb606bd986fc8d.tar.gz vyos-documentation-9c815d689a2a4a5d433ba15154cb606bd986fc8d.zip | |
fix(ext): parse cmdincludemd content as RST so legacy `_include/*.txt` directives render
The `_include/*.txt` library is written in reStructuredText (`.. cfgcmd::`,
`.. code-block::`, `.. note::`, `.. cmdinclude::`). After the RST→MyST
migration, the `{cmdincludemd}` fence on .md pages routed include content
through `MockState.nested_parse`, which in MyST 2.0 simply replays the
content through the MyST renderer (see myst_parser/mocking.py:153). RST
directives in the .txt file then rendered as literal paragraph text:
<p>.. cmdinclude:: /_include/interface-description.txt</p>
<p>.. cfgcmd:: set interfaces ethernet ...</p>
<p>.. code-block:: none</p>
User-visible symptom (reported on rolling docs): the Ethernet, dummy,
tunnel, bonding, bridge, macsec, vxlan, l2tpv3, pseudo-ethernet,
virtual-ethernet, and wireless pages all showed unprocessed `.. cfgcmd::`
and `.. cmdinclude::` directives instead of styled command boxes.
Fix: mirror MyST's own `{eval-rst}` plumbing
(`MockRSTParser().parse(text, doc)` per
`mdit_to_docutils/base.py:1655`). Build a fresh document that inherits
the outer document's settings + reporter, run `MockRSTParser` over the
substituted include content, and graft the resulting children back
into the calling document with explicit-target registration. Keeps the
Sphinx env available to `cfgcmd`/`opcmd`/`cmdinclude` directives.
Verified locally on rolling (Sphinx 7.x, myst-parser 2.0): zero literal
`cfgcmd::` / `cmdinclude::` / `code-block::` / `opcmd::` / `note::` /
`include::` strings remain in any built HTML page under
`configuration/`, `automation/`, `installation/`, `operation/`,
`vpp/`; all 11 affected interface pages now render proper
`cfgcmd-heading` / `cfgcmd-body` blocks (e.g. ethernet.html: 160,
wireless.html: 172, dummy.html: 4).
🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'docs/_include/interface-disable-flow-control.txt')
0 files changed, 0 insertions, 0 deletions
