Build environment API¶
-
class
sphinx.environment.
BuildEnvironment
[源代码]¶ Attributes
-
project
¶ Target project. See
Project
.
-
srcdir
¶ Source directory.
-
doctreedir
¶ Directory for storing pickled doctrees.
-
found_docs
¶ A set of all existing docnames.
-
metadata
¶ Dictionary mapping docnames to “metadata” (see File-wide metadata).
-
titles
¶ Dictionary mapping docnames to the docutils node for their main title.
-
docname
¶ Returns the docname of the document currently being parsed.
Utility methods
-
doc2path
(docname, base=True, suffix=None)[源代码]¶ Return the filename for the document name.
If base is True, return absolute path under self.srcdir. If base is None, return relative path to self.srcdir. If base is a path string, return absolute path under that. If suffix is not None, add it instead of config.source_suffix.
-
relfn2path
(filename, docname=None)[源代码]¶ Return paths to a file referenced from a document, relative to documentation root and absolute.
In the input “filename”, absolute filenames are taken as relative to the source dir, while relative filenames are relative to the dir of the containing document.
-
note_dependency
(filename)[源代码]¶ Add filename as a dependency of the current document.
This means that the document will be rebuilt if this file changes.
filename should be absolute or relative to the source directory.
-