class sphinx.environment.BuildEnvironment(app=None)[source]

The environment in which the ReST files are translated. Stores an inventory of cross-file targets and provides doctree transformations to resolve links to them.


Initialize self. See help(type(self)) for accurate signature.


__init__([app]) Initialize self.
apply_post_transforms(doctree, docname) Apply all post-transforms.
check_consistency() Do consistency checks.
check_dependents(app, already)
clear_doc(docname) Remove all traces of a source file in the inventory.
create_index(builder[, group_entries, _fixre])
doc2path(docname[, base, suffix]) Return the filename for the document name.
dump(env, f)
find_files(config, builder) Find all source files in the source dir and put them in self.found_docs.
frompickle(filename, app)
get_and_resolve_doctree(docname, builder[, …]) Read the doctree from the pickle, resolve cross-references and toctrees and return it.
get_doctree(docname) Read the doctree for a file from the pickle and return it.
get_domain(domainname) Return the domain instance with the specified name.
get_outdated_files(config_changed) Return (added, changed, removed) sets.
get_toc_for(docname, builder) Return a TOC nodetree – for use on the same page only!
get_toctree_for(docname, builder, collapse, …) Return the global TOC nodetree.
load(f[, app])
loads(string[, app])
merge_info_from(docnames, other, app) Merge global information gathered about docnames while reading them from the other environment.
new_serialno([category]) Return a serial number, e.g.
note_dependency(filename) Add filename as a dependency of the current document.
note_included(filename) Add filename as a included from other document.
note_reread() Add the current document to the list of documents that will automatically be re-read at the next build.
note_toctree(docname, toctreenode) Note a TOC tree directive in a document and gather information about file relations from it.
note_versionchange(type, version, node, lineno)
path2doc(filename) Return the docname for the filename if the file is document.
prepare_settings(docname) Prepare to set up environment for reading.
read_doc(docname[, app])
relfn2path(filename[, docname]) Return paths to a file referenced from a document, relative to documentation root and absolute.
resolve_references(doctree, fromdocname, builder)
resolve_toctree(docname, builder, toctree[, …]) Resolve a toctree node into individual bullet lists with titles as items, returning None (if no containing titles are found) or a new node.
set_versioning_method(method, compare) This sets the doctree versioning method for this environment.
setup(app) Set up BuildEnvironment object.
update(config, srcdir, doctreedir)
warn(docname, msg[, lineno]) Emit a warning.
warn_node(msg, node, **kwargs) Like warn(), but with source information taken from node.
write_doctree(docname, doctree)


docname Returns the docname of the document currently being parsed.