fradav / quarto-revealjs-animate

MIT License
4 stars 0 forks source link

Feature request: convert SVG yaml block for other formats #2

Open m-guggenmos opened 1 year ago

m-guggenmos commented 1 year ago

For output formats other than revealjs, the yaml code block used to generate animated SVGs is displayed verbatim. It would be a nice addition if a code block of the form

```yaml { .animate src="image.svg"}
setup:
  - element: "#xyz"
 ...
```

could be transformed to

![](image.svg)

Or ideally even transforming something like

```yaml { .animate .my-custom-class src="image.svg" caption="My custom caption"}
setup:
  - element: "#xyz"
 ...
```

to

![My custom caption](image.svg){.my-custom-class}
fradav commented 12 months ago

Good idea, will look into it. For the moment, I just use https://quarto.org/docs/authoring/conditional.html like

:::{.content-hidden when-format="revealjs"}
![My custom caption](image.svg){ .my-custom-class}
:::

:::{.content-visible when-format="revealjs"}
```yaml { .my-custom-class src="image.svg" }
setup: ...