-
DescriptionI want to produce lecture slides in two versions. One version contains answers to the problems, and the other does not. The code shown below achieves this, with the metadata value But putting a div around a whole slide looks like a hack to me. Is it the recommended approach, or are there better ways to achieve the same effect. For example, could it be done by defining a ---
title: "Some title"
author: "An author"
jupyter: python3
format:
revealjs:
theme: default
answer_slides: false
---
## First slide
Some content
::: {.content-hidden unless-meta="answer_slides"}
## Second slide
This slide will be hidden unless `answer_slides` is set to `true`
::: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
That's how it is documented and how this feature works: https://quarto.org/docs/authoring/conditional.html Note that in this case I would use profile. https://quarto.org/docs/projects/profiles.html ---
title: "Some title"
author: "An author"
engine: markdown
format:
revealjs:
theme: default
---
## First slide
Some content
::: {.content-visible when-profile="answer"}
## Second slide
This slide will be hidden unless `answer_slides` is set to `true`
::: quarto render index.qmd
quarto render index.qmd --profile answer --output with-answers.html |
Beta Was this translation helpful? Give feedback.
-
@mcanouil Would it possible to get both files (without and with answers) on the same website? |
Beta Was this translation helpful? Give feedback.
That's how it is documented and how this feature works: https://quarto.org/docs/authoring/conditional.html
Note that in this case I would use profile. https://quarto.org/docs/projects/profiles.html