当前位置: 首页 > 文档资料 > Sphinx 中文文档 >

Available builders

优质
小牛编辑
133浏览
2023-12-01

These are the built-in Sphinx builders. More builders can be added by extensions.

The builder’s “name” must be given to the -b command-line option of sphinx-build to select a builder.

class sphinx.builders.html.StandaloneHTMLBuilder

All serialization builders outputs one file per source file and a few special files. They also copy the reST source files in the directory _sources under the output directory.

The PickleHTMLBuilder is a builtin subclass that implements the pickle serialization interface.

The files per source file have the extensions of out_suffix, and are arranged in directories just as the source files are. They unserialize to a dictionary (or dictionary like structure) with these keys:

body
The HTML “body” (that is, the HTML rendering of the source file), as rendered by the HTML translator.
title
The title of the document, as HTML (may contain markup).
toc
The table of contents for the file, rendered as an HTML <ul>.
display_toc
A boolean that is True if the toc contains more than one entry.
current_page_name
The document name of the current file.
parents, prev and next
Information about related chapters in the TOC tree. Each relation is a dictionary with the keys link (HREF for the relation) and title (title of the related document, as HTML). parents is a list of relations, while prev and next are a single relation.
sourcename
The name of the source file under _sources.

The special files are located in the root output directory. They are:

SerializingHTMLBuilder.globalcontext_filename

A pickled dict with these keys:

project, copyright, release, version
The same values as given in the configuration file.
style
html_style.
last_updated
Date of last build.
builder
Name of the used builder, in the case of pickles this is always 'pickle'.
titles
A dictionary of all documents’ titles, as HTML strings.
SerializingHTMLBuilder.searchindex_filename

An index that can be used for searching the documentation. It is a pickled list with these entries:

  • A list of indexed docnames.
  • A list of document titles, as HTML strings, in the same order as the first list.
  • A dict mapping word roots (processed by an English-language stemmer) to a list of integers, which are indices into the first list.
environment.pickle

The build environment. This is always a pickle file, independent of the builder and a copy of the environment that was used when the builder was started.

Todo

Document common members.

Unlike the other pickle files this pickle file requires that the sphinx package is available on unpickling.