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

support layers

Open alixander opened this issue 1 year ago • 4 comments

not sure how best to do it, but just creating the issue so it's not forgotten

Screen Shot 2023-07-19 at 4 55 41 PM

alixander avatar Jul 19 '23 23:07 alixander

The layers paradigm seems to lend itself to being represented as a separate page per layer. This could be rendered as an actual preview tab per layer, or on one preview with html rendered tabs to switch between layers. The question really being how to relay this information from d2 cli to the d2 extension.

BarryNolte avatar Jul 25 '23 18:07 BarryNolte

As layers are currently not supported, this leads to a compilation error in the vs-code preview. grafik

For my specific use case, I build links between different d2 files, thus using the layers as link for the pdf mode. The problem is, once I include the links, the vs-code preview does not work any longer.

Would it be possible to just ignore layers without breaking the compilation? Or including a beta flag, that allows the vs-code preview to ignore layers, but the pdf export to use it?

jlnrrg avatar Oct 18 '23 10:10 jlnrrg

I'll take another look at this.

BarryNolte avatar Oct 18 '23 17:10 BarryNolte

@alixander What is the mode of operation in D2 Studio? How are Layers handled there?

BarryNolte avatar Nov 12 '23 23:11 BarryNolte