Shortcodes for variable content based on the output format #373
Replies: 5 comments 20 replies
-
I believe it is on the roadmap. Shortcodes are already a thing for Quarto (https://quarto.org/docs/authoring/shortcodes-and-filters.html#shortcodes) and additional shortcodes for inserting videos, tweets, or others are definitely something that should be done ! Maybe we could use this discussion to identify the shortcodes that would be useful ? I am thinking (mainly for HTML 😅 ) :
For custom shortcodes, it may be something feasible using a Lua Filters (that would output HTML or LaTeX syntax depending on Pandoc's output format. |
Beta Was this translation helpful? Give feedback.
-
For cross reference, related discussion in #676 also following this issue should help know when something will be available: #646 |
Beta Was this translation helpful? Give feedback.
-
See the new feature as answered in #646 (comment) ::: {.content-hidden when-format="pdf"}
This will not appear in a PDF
:::
::: {.content-visible unless-format="docx"}
This will not appear in word output
:::
::: {.content-hidden unless-format="html"}
This will only be visible in HTML output
::: This should help regarding the discussion here. Please give us feedback to know if that answer all or still missing elements. Thanks ! |
Beta Was this translation helpful? Give feedback.
-
Complete docs here: https://quarto.org/docs/authoring/conditional.html |
Beta Was this translation helpful? Give feedback.
-
Closing this as completed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently working on a paper in which I am including videos (which works great with the regular markdown image syntax btw.). However, this of course does not work for pdf output. For my Master's Thesis I solved this with Rmarkdown using R code:
(https://github.com/jmbuhr/hdReports/blob/c55392dcf19cab8d1fd84796a83214fa848dc4ce/inst/rmarkdown/templates/hdReport/skeleton/skeleton.Rmd#L54-L67)
but for quarto it feels like there would be a more elegant language agnostic solution straight in quarto with some sort of shortcode. Is this feasible?
Beta Was this translation helpful? Give feedback.
All reactions