Add Quarto product-test example and fix Typst render.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
// Quarto's default Pandoc Typst template defines this; custom template-partials
|
||||
// replace that file, so we need the helper here.
|
||||
#let content-to-string(content) = {
|
||||
if type(content) == str {
|
||||
content
|
||||
} else if content.has("text") {
|
||||
content.text
|
||||
} else if content.has("children") {
|
||||
content.children.map(content-to-string).join("")
|
||||
} else if content.has("body") {
|
||||
content-to-string(content.body)
|
||||
} else if content == [ ] {
|
||||
" "
|
||||
} else {
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
#let article(
|
||||
title: none,
|
||||
subtitle: none,
|
||||
@@ -92,33 +110,40 @@
|
||||
)
|
||||
]
|
||||
|
||||
v(12pt)
|
||||
align(center, line(length: 100%))
|
||||
text(1.4em, weight: "bold", [اطلاعات کلی])
|
||||
v(8pt)
|
||||
// Travel reports pass `purpose`; product-test reports put general info in the body.
|
||||
let show-travel-meta = purpose != none and purpose != ""
|
||||
|
||||
let meta-row(label, value) = if value != none and value != "" {
|
||||
grid(
|
||||
columns: (8em, 1fr),
|
||||
gutter: 1em,
|
||||
align: (right, right),
|
||||
[#label],
|
||||
[#strong(value)],
|
||||
if show-travel-meta {
|
||||
v(12pt)
|
||||
align(center, line(length: 100%))
|
||||
text(1.4em, weight: "bold", [اطلاعات کلی])
|
||||
v(8pt)
|
||||
|
||||
let meta-row(label, value) = if value != none and value != "" {
|
||||
grid(
|
||||
columns: (8em, 1fr),
|
||||
gutter: 1em,
|
||||
align: (right, right),
|
||||
[#label],
|
||||
[#strong(value)],
|
||||
)
|
||||
}
|
||||
|
||||
stack(
|
||||
spacing: 12pt,
|
||||
meta-row([مقصد:], dest-text),
|
||||
meta-row([هدف مأموریت:], purpose),
|
||||
meta-row([تیم اعزامی:], author-names),
|
||||
meta-row([تاریخ:], date),
|
||||
)
|
||||
|
||||
v(24pt)
|
||||
align(center, line(length: 100%))
|
||||
v(12pt)
|
||||
} else {
|
||||
v(16pt)
|
||||
}
|
||||
|
||||
stack(
|
||||
spacing: 12pt,
|
||||
meta-row([مقصد:], dest-text),
|
||||
meta-row([هدف مأموریت:], purpose),
|
||||
meta-row([تیم اعزامی:], author-names),
|
||||
meta-row([تاریخ:], date),
|
||||
)
|
||||
|
||||
v(24pt)
|
||||
align(center, line(length: 100%))
|
||||
v(12pt)
|
||||
|
||||
if toc {
|
||||
let title = if toc_title == none { auto } else { toc_title }
|
||||
block(above: 0em, below: 2em)[
|
||||
|
||||
Reference in New Issue
Block a user