Skip to content

Commit 35a925f

Browse files
authored
docs: add example combining when/unless for revealjs/html (#910)
1 parent a401413 commit 35a925f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/authoring/conditional.qmd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ Will not appear in PDF.
4545

4646
Then `when-format` and `unless-format` attributes match the current Pandoc output format with some additional intelligence to alias related formats (e.g. html, html4, and html5). Details are provided below in [Format Matching](#format-matching)
4747

48+
`when-format` and `unless-format` can also be combined to create more complex conditions:
49+
50+
``` markdown
51+
::: {.content-visible when-format="html" unless-format="revealjs"}
52+
53+
Will only appear in HTML and not in Reveal.js, but actually it appears.
54+
55+
:::
56+
57+
::: {.content-visible when-format="revealjs"}
58+
59+
Will only appear in Reveal.js and not in HTML or other formats.
60+
61+
:::
62+
```
63+
4864
## .content-hidden
4965

5066
To prevent content from being displayed when rendering to a given format, use the `.content-hidden` class. For example, here we mark content as hidden in HTML:

0 commit comments

Comments
 (0)