class documentation

class Builder:

Known subclasses: sphinx.builders.changes.ChangesBuilder, sphinx.builders.dummy.DummyBuilder, sphinx.builders.html.StandaloneHTMLBuilder, sphinx.builders.latex.LaTeXBuilder, sphinx.builders.manpage.ManualPageBuilder, sphinx.builders.texinfo.TexinfoBuilder, sphinx.builders.text.TextBuilder, sphinx.builders.xml.XMLBuilder, sphinx.ext.coverage.CoverageBuilder, sphinx.builders.gettext.I18nBuilder, sphinx.ext.doctest.DocTestBuilder

View In Hierarchy

Builds target formats from the reST sources.
Method build Main build method.
Method build​_all Build all source files.
Method build​_specific Only rebuild as much as needed for changes in the filenames.
Method build​_update Only rebuild what was changed or added since last build.
Method finish Finish the building process.
Method get​_outdated​_docs Return an iterable of output files that are outdated, or a string describing what an update build will build.
Method get​_relative​_uri Return a relative URI between two source filenames.
Method get​_target​_uri Return the target URI for a document name.
Method init Load necessary templates and perform initialization. The default implementation does nothing.
Method prepare​_writing A place where you can add logic before write_doc is run
Method write​_doc Where you actually write something to the filesystem.
Class Variable allow​_parallel Undocumented
Class Variable default​_translator​_class Undocumented
Class Variable epilog Undocumented
Class Variable format Undocumented
Class Variable name Undocumented
Class Variable supported​_data​_uri​_images Undocumented
Class Variable supported​_image​_types Undocumented
Class Variable supported​_remote​_images Undocumented
Instance Variable events Undocumented
Method __init__ Undocumented
Method ​_read​_parallel Undocumented
Method ​_read​_serial Undocumented
Method ​_write​_parallel Undocumented
Method ​_write​_serial Undocumented
Method cleanup Cleanup any resources.
Method compile​_all​_catalogs Undocumented
Method compile​_catalogs Undocumented
Method compile​_specific​_catalogs Undocumented
Method compile​_update​_catalogs Undocumented
Method create​_template​_bridge Return the template bridge configured.
Method create​_translator Return an instance of translator.
Method get​_asset​_paths Return list of paths for assets (ex. templates, CSS, etc.).
Method get​_builder​_config Return a builder specific option.
Method get​_translator​_class Return a class of translator.
Method post​_process​_images Pick the best candidate for all image URIs.
Method read (Re-)read all files new or changed since last update.
Method read​_doc Parse a file and add/update inventory entries for the doctree.
Method set​_environment Store BuildEnvironment object.
Method write Undocumented
Method write​_doc​_serialized Handle parts of write_doc that must be called in the main process if parallel build is active.
Method write​_doctree Write the doctree to a file.
Class Variable use​_message​_catalog Undocumented
Class Variable versioning​_compare Undocumented
Class Variable versioning​_method Undocumented
Instance Variable app Undocumented
Instance Variable confdir Undocumented
Instance Variable config Undocumented
Instance Variable doctreedir Undocumented
Instance Variable env Undocumented
Instance Variable finish​_tasks Undocumented
Instance Variable imagedir Undocumented
Instance Variable images Undocumented
Instance Variable imgpath Undocumented
Instance Variable outdir Undocumented
Instance Variable parallel​_ok Undocumented
Instance Variable srcdir Undocumented
Instance Variable tags Undocumented
Instance Variable templates Undocumented
def build(self, docnames, summary=None, method='update'):

Main build method.

First updates the environment, and then calls write.

Parameters
docnames:Iterable[str]Undocumented
summary:strUndocumented
method:strUndocumented
def build_all(self):
Build all source files.
def build_specific(self, filenames):
Only rebuild as much as needed for changes in the filenames.
Parameters
filenames:List[str]Undocumented
def build_update(self):
Only rebuild what was changed or added since last build.
def get_outdated_docs(self):

Return an iterable of output files that are outdated, or a string describing what an update build will build.

If the builder does not output individual files corresponding to source files, return a string here. If it does, return an iterable of those files that need to be written.

Returns
Union[str, Iterable[str]]Undocumented
def get_relative_uri(self, from_, to, typ=None):

Return a relative URI between two source filenames.

May raise environment.NoUri if there's no way to return a sensible URI.

Parameters
from​_:strUndocumented
to:strUndocumented
typ:strUndocumented
Returns
strUndocumented
def get_target_uri(self, docname, typ=None):

Return the target URI for a document name.

typ can be used to qualify the link characteristic for individual builders.

Parameters
docname:strUndocumented
typ:strUndocumented
Returns
strUndocumented
def prepare_writing(self, docnames):
def write_doc(self, docname, doctree):
Where you actually write something to the filesystem.
Parameters
docname:strUndocumented
doctree:nodes.documentUndocumented
default_translator_class: Type[nodes.NodeVisitor] =

Undocumented

supported_data_uri_images: bool =

Undocumented

supported_remote_images: bool =
events: EventManager =

Undocumented

def __init__(self, app):

Undocumented

Parameters
app:SphinxUndocumented
def _read_parallel(self, docnames, nproc):

Undocumented

Parameters
docnames:List[str]Undocumented
nproc:intUndocumented
def _read_serial(self, docnames):

Undocumented

Parameters
docnames:List[str]Undocumented
def _write_parallel(self, docnames, nproc):

Undocumented

Parameters
docnames:Sequence[str]Undocumented
nproc:intUndocumented
def _write_serial(self, docnames):

Undocumented

Parameters
docnames:Sequence[str]Undocumented
def cleanup(self):

Cleanup any resources.

The default implementation does nothing.

def compile_all_catalogs(self):

Undocumented

def compile_catalogs(self, catalogs, message):

Undocumented

Parameters
catalogs:Set[CatalogInfo]Undocumented
message:strUndocumented
def compile_specific_catalogs(self, specified_files):

Undocumented

Parameters
specified​_files:List[str]Undocumented
def compile_update_catalogs(self):

Undocumented

def create_template_bridge(self):
Return the template bridge configured.
def create_translator(self, *args):

Return an instance of translator.

This method returns an instance of default_translator_class by default. Users can replace the translator class with app.set_translator() API.

Parameters
*args:AnyUndocumented
Returns
nodes.NodeVisitorUndocumented
def get_asset_paths(self):
Return list of paths for assets (ex. templates, CSS, etc.).
Returns
List[str]Undocumented
def get_builder_config(self, option, default):

Return a builder specific option.

This method allows customization of common builder settings by inserting the name of the current builder in the option key. If the key does not exist, use default as builder name.

Parameters
option:strUndocumented
default:strUndocumented
Returns
AnyUndocumented
def get_translator_class(self, *args):
Return a class of translator.
Parameters
*args:AnyUndocumented
Returns
Type[nodes.NodeVisitor]Undocumented
def post_process_images(self, doctree):
Pick the best candidate for all image URIs.
Parameters
doctree:NodeUndocumented
def read(self):

(Re-)read all files new or changed since last update.

Store all environment docnames in the canonical format (ie using SEP as a separator in place of os.path.sep).

Returns
List[str]Undocumented
def read_doc(self, docname):
Parse a file and add/update inventory entries for the doctree.
Parameters
docname:strUndocumented
def set_environment(self, env):
Store BuildEnvironment object.
Parameters
env:BuildEnvironmentUndocumented
def write(self, build_docnames, updated_docnames, method='update'):
def write_doc_serialized(self, docname, doctree):
Handle parts of write_doc that must be called in the main process if parallel build is active.
Parameters
docname:strUndocumented
doctree:nodes.documentUndocumented
def write_doctree(self, docname, doctree):
Write the doctree to a file.
Parameters
docname:strUndocumented
doctree:nodes.documentUndocumented
use_message_catalog: bool =

Undocumented

versioning_compare: bool =

Undocumented

versioning_method: str =

Undocumented

app: Sphinx =

Undocumented

confdir =

Undocumented

config: Config =

Undocumented

doctreedir =

Undocumented

env =

Undocumented

finish_tasks =

Undocumented

imagedir: str =

Undocumented

images: Dict[str, str] =

Undocumented

imgpath: str =

Undocumented

outdir =

Undocumented

parallel_ok =

Undocumented

srcdir =

Undocumented

tags: Tags =

Undocumented

templates =

Undocumented