Closed galtenberg closed 2 years ago
Closing this – I updated my version, and not specifying an -o
works for me now, just generates diagrams without touching the .md
– (I hadn't tried that in awhile, so maybe I just mis-learned the md feature, thinking I always needed an -o
)
Is your feature request related to a problem? Please describe.
I'd like to be able to generate the updated
.md
without stomping/losing the mermaid definition – while still having the reference to the external svg/png (![diagram](./stuff-1.svg)
) added to the .md.Describe the solution you'd like
A flag or config option that allows leaving the mermaid definition left in place, while generating the reference to the external svg/png (maybe either above or below the mermaid definition).
In theory, then the file output name could be the same as the input file name, there'd be no loss of information, only addition.
Thought: Could the reference to the external svg/png be detected in the md? If
![diagram](./stuff-1.svg)
is already in the.md
, then just the external svg/png needs to be regenerated? (I imagine this would be hard if there are multiple diagrams defined – creating edge cases like: two mermaid definitions in the file but only one external image reference.)Describe alternatives you've considered The only real alternative that's worked is to keep manual READMEs with workarounds, like keeping two mermaid definitions around but hiding one from the
mmdc
processor.Additional context I keep architecture documents in git. I'd like to be able to keep around the updated markdown, diagram, and mermaid definition.
For instance, for my architecture documents, the structure of the page is:
The architecture evolves over time, so does the markdown text explanation, and so does the mermaid definition. I'd like to keep them all around