-
DescriptionHey There, I'm working with a custom Typst Format that I developed to generate a series of static pdf dashboards (essentially a 1 page report) and I'd like to set the header of the document from the typst_template.typ: #let dashboard(
title: "Dashboard Title"
) = {
set page(
header: text(weight: "bold", title)
)
body
} typst_show.typ: #show: dashboard.with(
$if(title)$
title: [$title$],
$endif$
) quarto doc: ---
format:
typst_static_dashboard-typst: default
params:
title: "overwrite params"
title: "overwrite metadata"
---
REST OF DOC In the code I use to batch run the data I use quarto_render(
input = "dashboard_pdf.qmd",
output_file = "output.pdf",
metadata = list(title = "Site Name")
) My (perhaps wrong) expectation is that header will show my updated title "Site Name" instead of "overwrite metadata" but the output pdf shows the "overwrite metadata". Interestingly the metadata in the log does show I've also tried setting it via params with the following typst_show and the #show: dashboard.with(
$if(params.title)$
title: [$params.title$],
$endif$
) I was wondering if this was a bug or more likely I'm missing something about the rendering pipeline here but would like to confirm! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
That general strategy looks right: add metadata to document, and then use it in the template within One documentation issue that we need to address is a complete description of which metadata fields are "safe" for third-party templates to use. I think that using Can you share a git repository with your attempt so I can take a look at it? Thanks. |
Beta Was this translation helpful? Give feedback.
Oh D'Oh I just checked the R project and found this issue: quarto-dev/quarto-r#181 which is my exact problem.
Sorry for taking your time on this, I do appreciate all the help and the PR!