summaryrefslogtreecommitdiff
path: root/docs/_ext
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-07 10:10:21 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-07 10:10:21 +0300
commit672b331fdaaa91e5a0c23c4abb9609c6f4c6a359 (patch)
tree82f67edd0bd5cc9730014e6e5f5a829a379ea81f /docs/_ext
parent0dbd2b071c0fc36796ae00a814586a39aabcc616 (diff)
parentcda6de295f85bc33d4ad60b0cbed48ea54aaedf8 (diff)
downloadvyos-documentation-672b331fdaaa91e5a0c23c4abb9609c6f4c6a359.tar.gz
vyos-documentation-672b331fdaaa91e5a0c23c4abb9609c6f4c6a359.zip
Merge remote-tracking branch 'origin/sagitta' into fix/docs-html-title-sagitta
# Conflicts: # docs/conf.py
Diffstat (limited to 'docs/_ext')
-rw-r--r--docs/_ext/vyos.py16
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):