Hi, I'm writing an extension that dynamically generates images. My problem is that when Sphinx finds the image nodes, it tries to find the images relative to the source. An absolute path is relative to the source directory, while a relative path is relative to the source file. (See `sphinx/environment/collectors/asset.py`.) In order not to pollute the source directory, I would naturally like to generate the images in the build directory.
I see that the `sphinx.ext.graphviz` extension does this by adding a node type that does not inherit from `docutils.nodes.image`, and implementing its own output functions for each builder. I'd like to avoid this if possible, as I won't be outputting the images differently than the `image` directives, just generating them on the fly. I guess a possible way would be to generate a special node type while reading, then use a transform running after the `DoctreeReadEvent` (i.e., with priority > 880) to replace those nodes with normal image nodes. Is there a better way? Thanks, Jean -- 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 sphinx-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/4c7de25d97108dd9d13c7f230e669efdb62300b5.camel%40abou-samra.fr.
signature.asc
Description: This is a digitally signed message part