7.17. sphinx.ext.literalincludewrap

The Sphinx extension setupdocx.sphinx.ext.literalincludewrap adjusts the path argument to the top of the document tree.

7.17.1. Module

Wrapper extension for the directive literalinclude. Extends path by search.

7.17.2. Functions

7.17.2.1. align_paths_to_top

setupdocx.sphinx.ext.literalincludewrap.align_paths_to_top(inst)[source]

Aligns the provided include relative paths. Checks first the existence of the path, if not exists adds the upward relative path as offset and checks the existence again. In case of a match the path is replace by the existent, else kept unchanged. Ignores absolute paths.

7.17.3. LiteralIncludeWrap

class setupdocx.sphinx.ext.literalincludewrap.LiteralIncludeWrap(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Wraps the class Literalinclude. Adjusts paths and passes to parent class. Thus allows position independed include paths.

7.17.3.1. run

LiteralIncludeWrap.run()[source]

Process the paths by self.setoptions, and calls the run method of the parent class LiteralInclude. Inherits the option_spec from sphinx.directives.code.LiteralInclude.

7.17.4. Exceptions

exception setupdocx.sphinx.ext.literalincludewrap.LiteralIncludeWrapError[source]