Rendering to multiple outputs #2021
-
Is it possible to render a single qmd file into multiple simultaneous formats each render? I have a website with certain pages that would be useful to automatically render to html (for the website) and to pdf for the option to download a pdf version. I thought about setting it up as a pre- or post-render script but I haven't been able to get it working yet (it also had me wondering about getting trapped in infinite render loops). In an ideal world this would be a qmd-specific option through the yaml. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This should work if you list both ---
title: "Document"
format:
html: default
pdf: default
--- |
Beta Was this translation helpful? Give feedback.
-
You want it to be more scoped that that -- i.e. just put it in the metadata of the individual file(s) or use a directory level |
Beta Was this translation helpful? Give feedback.
This should work if you list both
html
andpdf
as target formats for those documents. The current heuristic is that any document without aformat
gets the website default and any document with aformat
will render exactly the formats listed (which allows you to render to just PDF, Revealjs, Markdown, etc. -- which is probably the more common case). So TLDR this should do it: