Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to do not replace source with image #363

Open
Bruno-366 opened this issue Aug 12, 2021 · 2 comments
Open

Option to do not replace source with image #363

Bruno-366 opened this issue Aug 12, 2021 · 2 comments

Comments

@Bruno-366
Copy link

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.

@Bruno-366 Bruno-366 changed the title do not replace source with image feature request: option to do not replace source with image Aug 12, 2021
@pepijnve
Copy link
Member

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[]
----

@pepijnve
Copy link
Member

Just a note to self, it is possible to do this by creating a compound block.

@pepijnve pepijnve changed the title feature request: option to do not replace source with image Option to do not replace source with image Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants