Template macros allow dynamic content generation in presentations by defining reusable templates for links, media, and code blocks. This deck demonstrates their definition and invocation.
testtemplates:
test: :(1) :(2) :(3) [:(title)](:(url))
This macro combines three arguments with a titled link.
test Macro[@test arg1 arg2 arg3](the%20url "Title")
Invokes the test macro with three arguments, a URL, and a title.
test and test2Shows the rendered result of the test and test2 macros.
wptemplates:
wp: |
<a href=":(url)"><i class="fa-brands fa-wikipedia-w"></i> - :(title)</a>
Defines a macro for creating Wikipedia links with an icon.
wp Macro[@wp](https://de.wikipedia.org/wiki/SRGB-Farbraum "sRGB Farbraum")
Invokes the wp macro with a Wikipedia URL and title.
videotemplates:
video: |
```{=html}
<video controls style="width: var(--slide-width); height: var(--slide-height);">
<source src=":(url)" type="video/mp4" />
<track kind="subtitles" label="Deutsch" srclang="de" src=":(title)" default />
</video>
```
Defines a macro for embedding videos with subtitles.
video Macro[@video](/videos/myvideo.mp4 "/videos/mycaptions.vtt")
Invokes the video macro with a video URL and subtitle file.
<video controls style="width: var(--slide-width); height: var(--slide-height);">
<source src="/videos/myvideo.mp4" type="video/mp4" />
<track kind="subtitles" label="Deutsch" srclang="de" src="/videos/mycaptions.vtt" default />
</video>
Shows the generated HTML for the video embed.
block-test Macro:(1) :(2) :(3) p1 p2 The Block Test Code
Demonstrates a code block macro with parameterized substitutions.
# Code Block Macro: Example
## Using the `block-test` Macro
``` {.arg1 .arg2 .arg3 macro="block-test"
param1="p1" param2="p2"}
The Block Test Code
```
Demonstrates a code block macro with parameterized substitutions.