Environment Collector API

class sphinx.environment.collectors.EnvironmentCollector[ソース]

An EnvironmentCollector is a specific data collector from each document.

It gathers data and stores BuildEnvironment as a database. Examples of specific data would be images, download files, section titles, metadatas, index entries and toctrees, etc.

clear_doc(app: sphinx.application.Sphinx, env: sphinx.environment.BuildEnvironment, docname: str) → None[ソース]

Remove specified data of a document.

This method is called on the removal of the document.

get_outdated_docs(app: sphinx.application.Sphinx, env: sphinx.environment.BuildEnvironment, added: Set[str], changed: Set[str], removed: Set[str]) → List[str][ソース]

Return a list of docnames to re-read.

This methods is called before reading the documents.

get_updated_docs(app: sphinx.application.Sphinx, env: sphinx.environment.BuildEnvironment) → List[str][ソース]

Return a list of docnames to re-read.

This methods is called after reading the whole of documents (experimental).

merge_other(app: sphinx.application.Sphinx, env: sphinx.environment.BuildEnvironment, docnames: Set[str], other: sphinx.environment.BuildEnvironment) → None[ソース]

Merge in specified data regarding docnames from a different BuildEnvironment object which coming from a subprocess in parallel builds.

process_doc(app: sphinx.application.Sphinx, doctree: docutils.nodes.document) → None[ソース]

Process a document and gather specific data from it.

This method is called after the document is read.