Issue #837 resolved

source-read event not raised for docutils include directive

Blake Williams
created an issue

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?

Comments (2)

  1. Georg Brandl repo owner

    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.

  2. Log in to comment