diff options
author | Georg Brandl <georg@python.org> | 2014-03-26 07:30:55 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-03-26 07:30:55 +0100 |
commit | b0fb88ef3718eff6ba6a9e4c91521130c7177b45 (patch) | |
tree | 2446f356aa9354ab76dc7122d455a6e6127a9391 | |
parent | 9ff2cc2ce7c09b32058ef64d9f81ff6170117360 (diff) | |
parent | 9ee16137537e42356e3186a0f9f4cca04f124e57 (diff) | |
download | sphinx-b0fb88ef3718eff6ba6a9e4c91521130c7177b45.tar.gz |
merge with stable
-rw-r--r-- | doc/extdev/appapi.rst | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst index 48f5d96e..4edab5db 100644 --- a/doc/extdev/appapi.rst +++ b/doc/extdev/appapi.rst @@ -382,7 +382,18 @@ Sphinx core events ------------------ These events are known to the core. The arguments shown are given to the -registered event handlers. +registered event handlers. Use :meth:`.connect` in an extension's ``setup`` +function (note that ``conf.py`` can also have a ``setup`` function) to connect +handlers to the events. Example: + +.. code-block:: python + + def source_read_handler(app, docname, source): + print('do something here...') + + def setup(app): + app.connect('source-read', source_read_handler) + .. event:: builder-inited (app) |