diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-06 22:08:17 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-06 22:08:17 +0300 |
| commit | c1ad0a2b289ac3b1a17c8adadfce49b1eca3c741 (patch) | |
| tree | 6ffa092a021096834532d5ce5ca4e674f412c076 /docs/_ext | |
| parent | ab5359702db9ba94fa27d770af440a20cf95a41b (diff) | |
| parent | 50a82c126037023d029eaa4ff2d2144c44ae039b (diff) | |
| download | vyos-documentation-c1ad0a2b289ac3b1a17c8adadfce49b1eca3c741.tar.gz vyos-documentation-c1ad0a2b289ac3b1a17c8adadfce49b1eca3c741.zip | |
Merge pull request #1901 from vyos/feat/myst-as-primary-sagitta
feat: flip swap mechanism on sagitta — MD as primary, RST as override (mirrors #1899/#1900)
Diffstat (limited to 'docs/_ext')
| -rw-r--r-- | docs/_ext/vyos.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/docs/_ext/vyos.py b/docs/_ext/vyos.py index c1a96cd9..527178d1 100644 --- a/docs/_ext/vyos.py +++ b/docs/_ext/vyos.py @@ -221,7 +221,7 @@ class CfgInclude(SphinxDirective): path = os.path.join(self.standard_include_path, path[1:-1]) path = os.path.normpath(os.path.join(source_dir, path)) path = utils.relative_path(None, path) - path = nodes.reprunicode(path) + path = str(path) encoding = self.options.get( 'encoding', self.state.document.settings.input_encoding) e_handler=self.state.document.settings.input_encoding_error_handler @@ -364,8 +364,18 @@ class CmdInclude(SphinxDirective): line = re.sub('{{\s?var' + str(i) + '\s?}}',value,line) new_include_lines.append(line) - self.state._renderer.nested_render_text(''.join(new_include_lines), self.lineno) - return [] + if hasattr(self.state, '_renderer'): + self.state._renderer.nested_render_text(''.join(new_include_lines), self.lineno) + return [] + from docutils.statemachine import ViewList + from docutils import nodes + content = ''.join(new_include_lines) + vl = ViewList() + for i, line in enumerate(content.splitlines(keepends=False)): + vl.append(line, include_file[1], i) + node = nodes.Element() + self.state.nested_parse(vl, self.content_offset, node, match_titles=True) + return node.children class CfgcmdlistDirective(Directive): |
