summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-06 20:55:18 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-06 20:55:18 +0300
commit97d12b42d997627be6f33528ba2625bd0378de74 (patch)
treeafe2bc5b4426837530f2b4e0ab9840c81337a4c2 /docs
parent5d6fa52b8985f8068314aba26878a1d7d5cb84e5 (diff)
downloadvyos-documentation-97d12b42d997627be6f33528ba2625bd0378de74.tar.gz
vyos-documentation-97d12b42d997627be6f33528ba2625bd0378de74.zip
feat: flip swap mechanism — Phase 2 (swap_sources.py rewrite)
Phase 2 of the MD-as-primary flip. Inverts swap_sources.py so it activates RST overrides (rst-<stem>.rst → <stem>.rst, with the matching <stem>.md excluded via _md_exclude.txt) for stems listed in docs/_rst_overrides.txt. Changes: - scripts/swap_sources.py: rewritten with inverted rename direction and renamed runtime artifacts (_rst_override_state.json, _md_exclude.txt). CLI flags --swap/--restore/--dry-run/--status kept for compatibility with the Makefile and Read the Docs config. - docs/conf.py: clean up the runtime-artifact references that Phase 1 left pointing at the old _swap_state.json and _swap_exclude.txt names. - scripts/import_myst.py and tests/test_import_myst.py deleted; obsolete after the flip (MD is canonical, no separate import workflow needed). - tests/test_swap_sources.py: rewritten for the new semantics. All 10 tests pass under pytest. Smoke-tested end-to-end on a real worktree page (quick-start): adding the stem to _rst_overrides.txt, --dry-run, --swap, --status, --restore, all behave correctly. State JSON has version 2 (bumped from 1 to surface the incompatibility on rollback if old state lingers). Phase 3 will verify Makefile, .readthedocs.yml, docs/_ext/vyos.py don't reference any of the old names, then mark the PR ready-for-review. Generated by robots https://vyos.io
Diffstat (limited to 'docs')
-rw-r--r--docs/conf.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/conf.py b/docs/conf.py
index b5019407..76a00577 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -91,14 +91,14 @@ gettext_uuid = False
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = [
u'_build', 'Thumbs.db', '.DS_Store', '_include/vyos-1x',
- 'md-*.md', '**/md-*.md',
+ 'rst-*.rst', '**/rst-*.rst',
]
import pathlib
_build = pathlib.Path(__file__).parent / '_build'
-if (_build / '_swap_state.json').exists() and (_build / '_swap_exclude.txt').exists():
+if (_build / '_rst_override_state.json').exists() and (_build / '_md_exclude.txt').exists():
exclude_patterns.extend(
- s for s in (line.strip() for line in (_build / '_swap_exclude.txt').read_text().splitlines()) if s
+ s for s in (line.strip() for line in (_build / '_md_exclude.txt').read_text().splitlines()) if s
)
# The name of the Pygments (syntax highlighting) style to use.