Closed as not planned
Description
Metadata may drive inclusion or omission of content divs via .content-visible when-meta=
or .content-hidden when-meta=
however the implementation for users is a little tough to navigate.
Metadata can be added during execution via something like:
#| output: asis
cat(
"---",
paste0("my_metadata": true"),
"---",
sep = "\n"
)
or more programmatically:
#| echo: false
import yaml
from IPython.display import Markdown
def quarto_metadata(**kwargs):
result = "---\n" + yaml.safe_dump(kwargs) + "---\n"
return Markdown(result)
opts = {}
opts["my_metadata"] = True
quarto_metadata(**opts)
but this is rather abstract for most users. Additionally, there are important elements to understand around order of operations for knitr / jupyter and pandoc.
See rich-iannone/quarto-email#9 for a prime use case, but smoothing out these edges will be relevant beyond conditional emails. Improvements could include wrappers around metadata manipulation to make this more ergonomic.