-
I'm writing a Sphinx extension that implements a directive able to render a d2 diagram and insert the resulting It is already good enough for my needs, but I'd like to exploit the link feature of a In other words, instead of writing this:
I would prefer being able to say:
Given that the actual rendering of the diagram (that is, the execution of I spent a few hours searching and trying, but I could not figure out a way to do that at render time. Can you shed some light on how I could do that? Thanks in advance for any hint! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
You will need to do this in the reading phase (in your directive). Once you've extracted the reST to process, call A |
Beta Was this translation helpful? Give feedback.
-
Entirely off topic, but out of interest are you the same Lele that contributed Italian translations etc to Docutils (e.g. at r2533)? We're (slowly) working on a migration to Git, so matching people up is useful! Best, |
Beta Was this translation helpful? Give feedback.
Yay, I think I got it!
Basically
d2node
produced by the directive.refuri
/refid
Thanks a lot!