Yes, the source-read event seems to be triggered regardless of wether the file is included or not.
The question is then: How can I make an extension do some pre-processing, like a regex, on included files? e.g.; index.rst contains $some math 1$ .. include test.rst test.rst contains $some math 2$ My extension has a a regex to replace $(...)$ by a :math: directive based on source_read, but only $some math 1$ gets converted to :math:'some math 1', $some math 2$ is left unchanged. Le jeudi 6 septembre 2018 00:23:48 UTC+2, frederik…@gmail.com a écrit : As proposed in the documentation for the source-read > <http://www.sphinx-doc.org/en/master/extdev/appapi.html#event-source-read> > event, > I am trying to use a regex to replace $...$ by :math: directives. > > This works well, except for interactions with the .. include:: file.rst > directive. > Included files do seem to trigger source-read events, but the > modification to the source is not reflected in the output. > > What is the correct way of preprocessing included files? > > > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
