diff options
| author | Daniil Baturin <daniil@vyos.io> | 2026-05-06 14:08:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-06 14:08:35 +0100 |
| commit | 9d0341379184622b3da2e7e05aeeceed4bbf83e9 (patch) | |
| tree | 3c881338b1f6e0ec369a138e4c53772fcbaa8253 /docs/conf.py | |
| parent | 5eb383a10ec92c65eed525bc174785a6852e997f (diff) | |
| download | vyos-documentation-9d0341379184622b3da2e7e05aeeceed4bbf83e9.tar.gz vyos-documentation-9d0341379184622b3da2e7e05aeeceed4bbf83e9.zip | |
Revert "Add incremental RST-to-MyST swap mechanism (circinus) (#1867)" (#1893)
This reverts commit 5eb383a10ec92c65eed525bc174785a6852e997f.
Diffstat (limited to 'docs/conf.py')
| -rw-r--r-- | docs/conf.py | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/docs/conf.py b/docs/conf.py index d8a4f506..e87def82 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,6 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # import os -import shutil import sys sys.path.append(os.path.abspath("./_ext")) @@ -84,23 +83,7 @@ gettext_uuid = False # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # 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', -] - -# MyST-Parser configuration -myst_enable_extensions = ["colon_fence", "deflist", "fieldlist", "substitution"] -myst_fence_as_directive = ["cfgcmd", "opcmd", "cmdincludemd"] - -# Incremental RST→MyST swap: extend exclude_patterns with the RST paths that -# swap_sources.py just hid behind their md-prefixed counterparts. -import pathlib -_build = pathlib.Path(__file__).parent / '_build' -if (_build / '_swap_state.json').exists() and (_build / '_swap_exclude.txt').exists(): - exclude_patterns.extend( - s for s in (line.strip() for line in (_build / '_swap_exclude.txt').read_text().splitlines()) if s - ) +exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store', '_include/vyos-1x'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' @@ -215,32 +198,5 @@ texinfo_documents = [ ] -def _prefer_webp(app): - """Prepend WebP to supported image types for HTML builders so MyST pages - can use webp without falling back to PDF/PNG fallbacks.""" - if app.builder.name in ('html', 'dirhtml'): - types = app.builder.supported_image_types - if 'image/webp' not in types: - app.builder.supported_image_types = ['image/webp'] + types - - -def _copy_md_sources(app, exception): - """Copy .md source files verbatim into the HTML output tree. - - md-prefixed staging files are excluded — they are never meant to be served. - """ - if exception is not None: - return - src = pathlib.Path(app.srcdir) - out = pathlib.Path(app.outdir) - for md_path in src.rglob("*.md"): - if md_path.name.startswith("md-"): - continue - dest = out / md_path.relative_to(src) - dest.parent.mkdir(parents=True, exist_ok=True) - shutil.copy2(md_path, dest) - - def setup(app): - app.connect('builder-inited', _prefer_webp) - app.connect('build-finished', _copy_md_sources) + pass
\ No newline at end of file |
