Deterministic SVGs?
Hi,
Is there a way to get deterministic SVGs?
I've noticed that the id tag of the SVG seems to be randomly generated. Is there a way to have it be determined based on the source file (based on the SHA:256 value of the original file, for example)?
The reason for this, is that I'd like to have them generated automatically when the source file changes, and the resulting SVGs are checked in to git, and it would be very convenient if the generated files do not change if the source files are unchanged.
Hi. I have added a PR here: https://github.com/mermaid-js/mermaid/pull/1787 Please give some feedback if this is getting into the right direction. The CLI should use it then later. Will add that PR after merge.
I will push a PR to: https://github.com/mermaid-js/mermaid-cli since this is the living repo for this project.
Development has moved to the https://github.com/mermaid-js/mermaid-cli repo, please re-open your issue there if it's still relevant.
The package has also been renamed on NPM to @mermaid-js/mermaid-cli, so you may need to run npm uninstall mermaid.cli && npm install @mermaid-js/mermaid-cli to get the latest version of this package.
Thanks @julianbei for making that PR. We actually use a Mermaid Config with {"deterministicIds": true} in some of the @mermaid-js/mermaid-cli tests, and we can confirm it works, see https://github.com/mermaid-js/mermaid-cli/blob/57f826263e52c7ff821372c1c3f3a811c36ff7bf/test-positive/config-deterministic.json#L2