d2-vscode icon indicating copy to clipboard operation
d2-vscode copied to clipboard

Allow for setting Layout, Theme and Sketch options per document

Open asanjabi opened this issue 2 years ago • 6 comments

If there a none option in the settings, then user would have the option of setting these values through the variables per document. Or maybe an option for the CLI to reverse the override priority to document over CLI parameters.

asanjabi avatar Aug 30 '23 06:08 asanjabi

ah i didn't realize this wasn't working in d2 preview.

Screen Shot 2023-08-30 at 4 26 20 AM

indeed, i suspect that this extension is passing in default values through the CLI, which takes priority. Instead, they should be omitted, which will let the variable configurations take priority over default values

alixander avatar Aug 30 '23 11:08 alixander

@alixander So the solution is to have a "none" option in the theme and sketch options, that would then omit the CLI options? What about layout?

BarryNolte avatar Aug 30 '23 21:08 BarryNolte

I think the same pattern would work for layout also, I'd love to see that as an option :)

asanjabi avatar Aug 30 '23 21:08 asanjabi

@alixander So the solution is to have a "none" option in the theme and sketch options, that would then omit the CLI options? What about layout?

No the solution is to just omit the flags if they are default.

alixander avatar Aug 31 '23 05:08 alixander

setting render layout engine per document is crucial obviously, a lot of hassle brings that vars not working as expected. Curios why it's working correctly on d2 Playground, which is also VSCode based

artk42 avatar Jul 19 '24 14:07 artk42