If you work with strings in your Python scripts and you're writing obscure logic to process them, then you need to look into ...
The most convenient way to use D2 is to just run it as a CLI executable to produce SVGs from .d2 files. You can run the install script with --dry-run to see the ...