Open xinyi-joffre opened 5 years ago
I would love this. Happy to shout a beer for whomever ships it.
I actually got this working in combination with another extension: Trigger Task on Save
I created a task in the tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "generatePlantumlPng",
"command": "${command:plantuml.exportDocument}",
"isBackground": true,
},
]
}
and added in my settings.json:
{
"plantuml.exportFormat": "png",
"triggerTaskOnSave.tasks": {
"generatePlantumlPng": [
"**/*.wsd",
"**/*.pu",
"**/*.puml",
"**/*.plantuml",
"**/*.iuml",
]
},
}
This will actually export your diagram as a png on save.
I tried doing this also for exporting all diagrams in the workspace, but this is not working because of the task execution in vscode adding arguments.
Can I set this up to save the export alongside the plantuml file?
It would be great if plantuml could have a setting like:
"plantuml.exportCurrentDiagramOnSave": true
It could be defaulted to false to keep current behavior. We have a large number of diagrams, and people may forget to autogenerate the pictures before making a PR. It would be great if the exportCurrentDiagramOnSave could export the png to the configured out directory each time the file is actually saved (not while typing).