class documentation

class SphinxDirective(Directive):

Known subclasses: sphinx.directives.ObjectDescription, sphinx.directives.code.CodeBlock, sphinx.directives.code.Highlight, sphinx.directives.code.LiteralInclude, sphinx.directives.DefaultDomain, sphinx.directives.DefaultRole, sphinx.directives.other.Acks, sphinx.directives.other.Author, sphinx.directives.other.Centered, sphinx.directives.other.HList, sphinx.directives.other.Include, sphinx.directives.other.Only, sphinx.directives.other.TabularColumns, sphinx.directives.other.TocTree, sphinx.directives.patches.Code, sphinx.directives.patches.MathDirective, sphinx.directives.patches.Meta, sphinx.domains.c.CNamespaceObject, sphinx.domains.c.CNamespacePopObject, sphinx.domains.c.CNamespacePushObject, sphinx.domains.changeset.VersionChange, sphinx.domains.cpp.CPPNamespaceObject, sphinx.domains.cpp.CPPNamespacePopObject, sphinx.domains.cpp.CPPNamespacePushObject, sphinx.domains.index.IndexDirective, sphinx.domains.javascript.JSModule, sphinx.domains.python.PyCurrentModule, sphinx.domains.python.PyModule, sphinx.domains.std.Glossary, sphinx.domains.std.ProductionList, sphinx.domains.std.Program, sphinx.domains.std.Target, sphinx.ext.autodoc.directive.AutodocDirective, sphinx.ext.autosummary.Autosummary, sphinx.ext.doctest.TestDirective, sphinx.ext.graphviz.Graphviz, sphinx.ext.graphviz.GraphvizSimple, sphinx.ext.ifconfig.IfConfig, sphinx.ext.inheritance_diagram.InheritanceDiagram, sphinx.ext.todo.Todo, sphinx.ext.todo.TodoList

View In Hierarchy

A base class for Sphinx directives.

This class provides helper methods for Sphinx directives.

Note

The subclasses of this class might not work with docutils. This class is strongly coupled with Sphinx.

Method get​_location Get current location info for logging.
Method get​_source​_info Get source and line number.
Method set​_source​_info Set source and line number to the node.
Property config Reference to the .Config object.
Property env Reference to the .BuildEnvironment object.
def get_location(self):
Get current location info for logging.
Returns
strUndocumented
def get_source_info(self):
Get source and line number.
Returns
Tuple[str, int]Undocumented
def set_source_info(self, node):
Set source and line number to the node.
Parameters
node:NodeUndocumented
@property
config: Config =
Reference to the .Config object.
@property
env: BuildEnvironment =
Reference to the .BuildEnvironment object.