terrastruct / d2-vscode

VSCode extension for D2 files.
https://d2lang.com
BSD 3-Clause "New" or "Revised" License
240 stars 11 forks source link

support layers #114

Open alixander opened 1 year ago

alixander commented 1 year ago

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
BarryNolte commented 1 year ago

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.

jlnrrg commented 1 year ago

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?

BarryNolte commented 1 year ago

I'll take another look at this.

BarryNolte commented 1 year ago

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