sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.59k stars 2.12k forks source link

source-read event not raised for docutils include directive #837

Closed shimizukawa closed 9 years ago

shimizukawa commented 9 years ago

I'm trying to do a bit of processing on my reStructuredText before it gets converted into a doctree using the source-read event, but the documentation project makes extensive use of the standard docutils ".. include:: /path/to/file.rst" directive.

Unfortunately, the source-read event does not fire when includes are read. Can Sphinx raise this event on include as well? Or is there a better way to do some processing on the rst before it is parsed?


shimizukawa commented 9 years ago

From Georg Brandl on 2012-01-29 10:50:19+00:00

The content of the include file will be in the doctree you get for the "source-read" event for the file that used the "include" directive, so I don't think it would be good to raise it twice for the same content.