@@ -156,6 +156,39 @@ connect handlers to the events. Example:
156
156
def setup (app ):
157
157
app.connect(' source-read' , source_read_handler)
158
158
159
+ Below is an overview of each event that happens during a build. In the list
160
+ below, we include the event name, its callback parameters, and the input and output
161
+ type for that event::
162
+
163
+ 1. event.config-inited(app,config)
164
+ 2. event.builder-inited(app)
165
+ 3. event.env-get-outdated(app, env, added, changed, removed)
166
+ 4. event.env-before-read-docs(app, env, docnames)
167
+
168
+ for docname in docnames:
169
+ 5. event.env-purge-doc(app, env, docname)
170
+ if doc changed and not removed:
171
+ 6. source-read(app, docname, source)
172
+ 7. run source parsers: text -> docutils.document (parsers can be added with the app.add_source_parser() API)
173
+ 8. apply transforms (by priority): docutils.document -> docutils.document
174
+ - event.doctree-read(app, doctree) is called in the middly of transforms,
175
+ transforms come before/after this event depending on their priority.
176
+ 9. (if running in parallel mode, for each process) event.env-merged-info(app, env, docnames, other)
177
+ 10. event.env-updated(app, env)
178
+ 11. event.env-get-updated(app, env)
179
+ 11. event.env-check-consistency(app, env)
180
+
181
+ # For builders that output a single page, they are first joined into a single doctree before post-transforms/doctree-resolved
182
+ for docname in docnames:
183
+ 12. apply post-transforms (by priority): docutils.document -> docutils.document
184
+ 13. event.doctree-resolved(app, doctree, docname)
185
+ - (for any reference node that fails to resolve) event.missing-reference(env, node, contnode)
186
+
187
+ 14. call builder
188
+
189
+ 15. event.build-finished(app, exception)
190
+
191
+ Here is a more detailed list of these events.
159
192
160
193
.. event :: builder-inited (app)
161
194
0 commit comments