diff options
author | rebortg <github@ghlr.de> | 2020-11-30 19:46:59 +0100 |
---|---|---|
committer | rebortg <github@ghlr.de> | 2020-11-30 19:46:59 +0100 |
commit | e33e1268f944be445b5a771df0e97e913487512f (patch) | |
tree | fc267ab5c8473398b81fd7016ceafa01a62c9694 /docs/_ext | |
parent | ad0dc9cf1a2161cb0bf2cfbc9c6fd4df2f78ab3a (diff) | |
download | vyos-documentation-e33e1268f944be445b5a771df0e97e913487512f.tar.gz vyos-documentation-e33e1268f944be445b5a771df0e97e913487512f.zip |
change include to absolute path
Diffstat (limited to 'docs/_ext')
-rw-r--r-- | docs/_ext/vyos.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/_ext/vyos.py b/docs/_ext/vyos.py index 89cc8ab7..4a974b46 100644 --- a/docs/_ext/vyos.py +++ b/docs/_ext/vyos.py @@ -3,7 +3,7 @@ import json import os from docutils import io, nodes, utils, statemachine from docutils.parsers.rst.roles import set_classes -from docutils.parsers.rst import Directive, directives +from docutils.parsers.rst import Directive, directives, states from sphinx.util.docutils import SphinxDirective @@ -173,7 +173,7 @@ class inlinecmd(nodes.inline): #self.literal_whitespace -= 1 -class CfgInclude(Directive): +class CfgInclude(SphinxDirective): required_arguments = 1 optional_arguments = 0 final_argument_whitespace = True @@ -189,10 +189,15 @@ class CfgInclude(Directive): 'var8': str, 'var9': str } + standard_include_path = os.path.join(os.path.dirname(states.__file__), + 'include') def run(self): ### Copy from include directive docutils """Include a file as part of the content of this reST file.""" + rel_filename, filename = self.env.relfn2path(self.arguments[0]) + self.arguments[0] = filename + self.env.note_included(filename) if not self.state.document.settings.file_insertion_enabled: raise self.warning('"%s" directive disabled.' % self.name) source = self.state_machine.input_lines.source( |