Sphinx logo

Previous topic

Extension API

Next topic

sphinx.ext.autodoc – Include documentation from docstrings

This Page

Quick search

Writing new builders

Todo

Expand this.

class sphinx.builder.Builder

This is the base class for all builders.

These methods are predefined and will be called from the application:

load_env()
Set up the build environment.
get_relative_uri(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.
build_all()
Build all source files.
build_specific(filenames)
Only rebuild as much as needed for changes in the source_filenames.
build_update()
Only rebuild files changed or added since last build.
build(docnames, summary=None, method='update')

These methods must be overridden in concrete builder classes:

init()
Load necessary templates and perform initialization.
get_outdated_docs()
Return an iterable of output files that are outdated, or a string describing what an update build will build.
get_target_uri(docname, typ=None)
Return the target URI for a document name (typ can be used to qualify the link characteristic for individual builders).
prepare_writing(docnames)
write_doc(docname, doctree)
finish()