pomdtr / vscode-markdown-kroki

Adds Kroki support to VS Code's builtin markdown preview
https://marketplace.visualstudio.com/items?itemName=pomdtr.markdown-kroki
MIT License
21 stars 7 forks source link

Support kroki diagram options #4

Open p-rogalski opened 1 year ago

p-rogalski commented 1 year ago

Kroki allows to pass options to diagrams: How-to use: https://docs.kroki.io/kroki/setup/usage/#_options Option Reference: https://docs.kroki.io/kroki/setup/diagram-options/

Use Case: Mermaid has a dark mode, which could be automatically set when your extension senses VSCode dark mode. Something similar is done by https://github.com/mjbvz/vscode-markdown-mermaid

pomdtr commented 1 year ago

Great idea ! I'll take a look

pomdtr commented 5 months ago

I'm not super interested in introducing package specific features (ex: dark mode for mermaid diagrams only).

However, it could be interesting to allow setting these options using a yaml meta block:

---
mermaid:
  theme: dark
---

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
p-rogalski commented 5 months ago

I'm not super interested in introducing package specific features (ex: dark mode for mermaid diagrams only).

I understand that. What about setting options in VSCode settings in a generic way and sending them each time a kroki request is made? VSCode settings could look something like:

"markdown-kroki.options": {
  "key":"value"
}

However, it could be interesting to allow setting these options using a yaml meta block

This could also work

pomdtr commented 5 months ago

Good point. Adding support for it both at a global, workspace and document level would be nice.