class documentation

class BuildEnvironment:

View In Hierarchy

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.
Method doc2path Return the filename for the document name.
Method new​_serialno Return a serial number, e.g. for index entry targets.
Method note​_dependency Add filename as a dependency of the current document.
Method note​_reread Add the current document to the list of documents that will automatically be re-read at the next build.
Method relfn2path Return paths to a file referenced from a document, relative to documentation root and absolute.
Instance Variable app Undocumented
Instance Variable config Undocumented
Instance Variable doctreedir Undocumented
Instance Variable events Undocumented
Instance Variable metadata Undocumented
Instance Variable project Undocumented
Instance Variable srcdir Undocumented
Instance Variable titles Undocumented
Method __getstate__ Obtains serializable data for pickling.
Method __init__ Undocumented
Method __setstate__ Undocumented
Method ​_update​_config Update configurations by new one.
Method ​_update​_settings Update settings by new config.
Method apply​_post​_transforms Apply all post-transforms.
Method check​_consistency Do consistency checks.
Method check​_dependents Undocumented
Method clear​_doc Remove all traces of a source file in the inventory.
Method collect​_relations Undocumented
Method find​_files Find all source files in the source dir and put them in self.found_docs.
Method get​_and​_resolve​_doctree Read the doctree from the pickle, resolve cross-references and toctrees and return it.
Method get​_doctree Read the doctree for a file from the pickle and return it.
Method get​_domain Return the domain instance with the specified name.
Method get​_outdated​_files Return (added, changed, removed) sets.
Method merge​_info​_from Merge global information gathered about docnames while reading them from the other environment.
Method note​_included Add filename as a included from other document.
Method path2doc Return the docname for the filename if the file is document.
Method prepare​_settings Prepare to set up environment for reading.
Method resolve​_references Undocumented
Method resolve​_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.
Method set​_versioning​_method This sets the doctree versioning method for this environment.
Method setup Set up BuildEnvironment object.
Instance Variable all​_docs Undocumented
Instance Variable config​_status Undocumented
Instance Variable config​_status​_extra Undocumented
Instance Variable dependencies Undocumented
Instance Variable dlfiles Undocumented
Instance Variable domaindata Undocumented
Instance Variable domains Undocumented
Instance Variable files​_to​_rebuild Undocumented
Instance Variable glob​_toctrees Undocumented
Instance Variable images Undocumented
Instance Variable included Undocumented
Instance Variable longtitles Undocumented
Instance Variable numbered​_toctrees Undocumented
Instance Variable original​_image​_uri Undocumented
Instance Variable ref​_context Undocumented
Instance Variable reread​_always Undocumented
Instance Variable settings Undocumented
Instance Variable temp​_data Undocumented
Instance Variable toc​_fignumbers Undocumented
Instance Variable toc​_num​_entries Undocumented
Instance Variable toc​_secnumbers Undocumented
Instance Variable tocs Undocumented
Instance Variable toctree​_includes Undocumented
Instance Variable version Undocumented
Instance Variable versioning​_compare Undocumented
Instance Variable versioning​_condition Undocumented
Property docname Returns the docname of the document currently being parsed.
Property found​_docs contains all existing docnames.
def doc2path(self, docname, base=True):

Return the filename for the document name.

If base is True, return absolute path under self.srcdir. If base is False, return relative path to self.srcdir.

Parameters
docname:strUndocumented
base:boolUndocumented
Returns
strUndocumented
def new_serialno(self, category=''):

Return a serial number, e.g. for index entry targets.

The number is guaranteed to be unique in the current document.

Parameters
category:strUndocumented
Returns
intUndocumented
def note_dependency(self, 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.

Parameters
filename:strUndocumented
def note_reread(self):
Add the current document to the list of documents that will automatically be re-read at the next build.
def relfn2path(self, 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.

Parameters
filename:strUndocumented
docname:strUndocumented
Returns
Tuple[str, str]Undocumented
app =

Undocumented

config =

Undocumented

doctreedir =

Undocumented

events =

Undocumented

metadata: Dict[str, Dict[str, Any]] =

Undocumented

project =

Undocumented

srcdir =

Undocumented

titles: Dict[str, nodes.title] =

Undocumented

def __getstate__(self):
Obtains serializable data for pickling.
Returns
DictUndocumented
def __init__(self, app=None):

Undocumented

Parameters
app:SphinxUndocumented
def __setstate__(self, state):

Undocumented

Parameters
state:DictUndocumented
def _update_config(self, config):
Update configurations by new one.
Parameters
config:ConfigUndocumented
def _update_settings(self, config):
Update settings by new config.
Parameters
config:ConfigUndocumented
def apply_post_transforms(self, doctree, docname):
Apply all post-transforms.
Parameters
doctree:nodes.documentUndocumented
docname:strUndocumented
def check_consistency(self):
Do consistency checks.
def check_dependents(self, app, already):

Undocumented

Parameters
app:SphinxUndocumented
already:Set[str]Undocumented
Returns
Generator[str, None, None]Undocumented
def clear_doc(self, docname):
Remove all traces of a source file in the inventory.
Parameters
docname:strUndocumented
def collect_relations(self):

Undocumented

Returns
Dict[str, List[Optional[str]]]Undocumented
def find_files(self, config, builder):
Find all source files in the source dir and put them in self.found_docs.
Parameters
config:ConfigUndocumented
builder:BuilderUndocumented
def get_and_resolve_doctree(self, docname, builder, doctree=None, prune_toctrees=True, includehidden=False):
Read the doctree from the pickle, resolve cross-references and toctrees and return it.
Parameters
docname:strUndocumented
builder:BuilderUndocumented
doctree:nodes.documentUndocumented
prune​_toctrees:boolUndocumented
includehidden:boolUndocumented
Returns
nodes.documentUndocumented
def get_doctree(self, docname):
Read the doctree for a file from the pickle and return it.
Parameters
docname:strUndocumented
Returns
nodes.documentUndocumented
def get_domain(self, domainname):

Return the domain instance with the specified name.

Raises an ExtensionError if the domain is not registered.

Parameters
domainname:strUndocumented
Returns
DomainUndocumented
def get_outdated_files(self, config_changed):
Return (added, changed, removed) sets.
Parameters
config​_changed:boolUndocumented
Returns
Tuple[Set[str], Set[str], Set[str]]Undocumented
def merge_info_from(self, docnames, other, app):

Merge global information gathered about docnames while reading them from the other environment.

This possibly comes from a parallel build process.

Parameters
docnames:List[str]Undocumented
other:BuildEnvironmentUndocumented
app:SphinxUndocumented
def note_included(self, filename):

Add filename as a included from other document.

This means the document is not orphaned.

filename should be absolute or relative to the source directory.

Parameters
filename:strUndocumented
def path2doc(self, filename):

Return the docname for the filename if the file is document.

filename should be absolute or relative to the source directory.

Parameters
filename:strUndocumented
Returns
Optional[str]Undocumented
def prepare_settings(self, docname):
Prepare to set up environment for reading.
Parameters
docname:strUndocumented
def resolve_references(self, doctree, fromdocname, builder):

Undocumented

Parameters
doctree:nodes.documentUndocumented
fromdocname:strUndocumented
builder:BuilderUndocumented
def resolve_toctree(self, docname, builder, toctree, prune=True, maxdepth=0, titles_only=False, collapse=False, includehidden=False):

Resolve a toctree node into individual bullet lists with titles as items, returning None (if no containing titles are found) or a new node.

If prune is True, the tree is pruned to maxdepth, or if that is 0, to the value of the maxdepth option on the toctree node. If titles_only is True, only toplevel document titles will be in the resulting tree. If collapse is True, all branches not containing docname will be collapsed.

Parameters
docname:strUndocumented
builder:BuilderUndocumented
toctree:addnodes.toctreeUndocumented
prune:boolUndocumented
maxdepth:intUndocumented
titles​_only:boolUndocumented
collapse:boolUndocumented
includehidden:boolUndocumented
Returns
NodeUndocumented
def set_versioning_method(self, method, compare):

This sets the doctree versioning method for this environment.

Versioning methods are a builder property; only builders with the same versioning method can share the same doctree directory. Therefore, we raise an exception if the user tries to use an environment with an incompatible versioning method.

Parameters
method:Union[str, Callable]Undocumented
compare:boolUndocumented
def setup(self, app):
Set up BuildEnvironment object.
Parameters
app:SphinxUndocumented
all_docs: Dict[str, float] =

Undocumented

config_status =

Undocumented

config_status_extra: str =

Undocumented

dependencies: Dict[str, Set[str]] =

Undocumented

dlfiles: DownloadFiles =

Undocumented

domaindata: Dict[str, Dict] =

Undocumented

domains: dict =

Undocumented

files_to_rebuild: Dict[str, Set[str]] =

Undocumented

glob_toctrees: Set[str] =

Undocumented

images: FilenameUniqDict =

Undocumented

included: Dict[str, Set[str]] =

Undocumented

longtitles: Dict[str, nodes.title] =

Undocumented

numbered_toctrees: Set[str] =

Undocumented

original_image_uri: Dict[str, str] =

Undocumented

ref_context: Dict[str, Any] =

Undocumented

reread_always: Set[str] =

Undocumented

settings =

Undocumented

temp_data =

Undocumented

toc_fignumbers: Dict[str, Dict[str, Dict[str, Tuple[int, ...]]]] =

Undocumented

toc_num_entries: Dict[str, int] =

Undocumented

toc_secnumbers: Dict[str, Dict[str, Tuple[int, ...]]] =

Undocumented

tocs: Dict[str, nodes.bullet_list] =

Undocumented

toctree_includes: Dict[str, List[str]] =

Undocumented

version =

Undocumented

versioning_compare =

Undocumented

versioning_condition =

Undocumented

@property
docname: str =
Returns the docname of the document currently being parsed.
@property
found_docs: Set[str] =
contains all existing docnames.