blob: 9259aaa735fdfed9322172e4cff3db9f299224b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
.. _writing-builders:
Builder API
===========
.. currentmodule:: sphinx.builders
.. class:: Builder
This is the base class for all builders.
It follows this basic workflow:
.. graphviz:: /_static/diagrams/sphinx_build_flow.dot
:caption: UML for the standard Sphinx build workflow
.. rubric:: Overridable Attributes
These attributes should be set on builder sub-classes:
.. autoattribute:: name
.. autoattribute:: format
.. autoattribute:: epilog
.. autoattribute:: allow_parallel
.. autoattribute:: supported_image_types
.. autoattribute:: supported_remote_images
.. autoattribute:: supported_data_uri_images
.. autoattribute:: default_translator_class
.. rubric:: Core Methods
These methods are predefined and should generally not be overridden,
since they form the core of the build process:
.. automethod:: build_all
.. automethod:: build_specific
.. automethod:: build_update
.. automethod:: build
.. automethod:: read
.. automethod:: read_doc
.. automethod:: write_doctree
.. rubric:: Overridable Methods
These must be implemented in builder sub-classes:
.. automethod:: get_outdated_docs
.. automethod:: prepare_writing
.. automethod:: write_doc
.. automethod:: get_target_uri
These methods can be overridden in builder sub-classes:
.. automethod:: init
.. automethod:: write
.. automethod:: copy_assets
.. automethod:: get_relative_uri
.. automethod:: finish
.. rubric:: Attributes
Attributes that are callable from the builder instance:
.. attribute:: events
An :class:`.EventManager` object.
|