On 2017-06-14, Konstantin Molchanov wrote:
> [-- Type: text/plain, Encoding: quoted-printable --]
> Hi! I’m trying to develop an extension for including rst sources from git
> repos. Including the source itself is trivial, but I need to adjust the
> image paths in order to keep them visible in the final doc.
> To do that, I need to parse the included source, traverse through its
> nodes, find all `image` nodes, and modify their content.
> Any suggestions on how to do that?
The docutils.nodes (sub)module has utility functions for such tasks.
Have a look at the Docutils "transforms" for usage examples.
Günter