Open Bruno-366 opened 3 years ago
I'm not sure how feasible that is, because I think a block macro can only generate single block. I'll have a look.
In the meantime, a simple solution that avoids the duplication is to put your dot code in a separate file (e.g., diagram.dot
) and then use macros to produce the two blocks you want:
graphviz::diagram.dot[]
[source,dot]
----
include::diagram.dot[]
----
Just a note to self, it is possible to do this by creating a compound block.
I was wondering if there was/could-be an option to preserve the source and place the outputted image below, rather than replace the source code with the image?
Oftentimes I was to generate an graphviz diagram, but I also want to show the dot code that produced the diagram. Right now the only solution I can think of is duplicating the source code, having two copies means I have to make sure that they're in sync.