Remove unused Typst template partials.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,7 +4,6 @@ _output/
|
|||||||
!.gitignore
|
!.gitignore
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.typ
|
*.typ
|
||||||
!templates/**/*.typ
|
|
||||||
/.quarto/
|
/.quarto/
|
||||||
.venv-pdf/
|
.venv-pdf/
|
||||||
|
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
#set page(
|
|
||||||
paper: $if(papersize)$"$papersize$"$else$"a4"$endif$,
|
|
||||||
$if(margin)$
|
|
||||||
margin: ($for(margin/pairs)$$margin.key$: $margin.value$,$endfor$),
|
|
||||||
$else$
|
|
||||||
margin: (left: 2cm, right: 2cm, top: 2.5cm, bottom: 2.5cm),
|
|
||||||
$endif$
|
|
||||||
numbering: $if(page-numbering)$"$page-numbering$"$else$"۱"$endif$,
|
|
||||||
header: context {
|
|
||||||
if counter(page).get().first() > 1 [
|
|
||||||
#set text(size: 11pt)
|
|
||||||
#grid(
|
|
||||||
columns: (auto, 1fr, auto),
|
|
||||||
gutter: 8pt,
|
|
||||||
align: (right, right, left),
|
|
||||||
$if(logofile)$
|
|
||||||
image("$logofile$", height: 16pt),
|
|
||||||
$endif$
|
|
||||||
$if(company)$
|
|
||||||
[#h(6pt)$company$$if(subtitle)$ | $subtitle$$endif$],
|
|
||||||
$else$
|
|
||||||
[],
|
|
||||||
$endif$
|
|
||||||
[],
|
|
||||||
)
|
|
||||||
#line(length: 100%, stroke: 0.5pt)
|
|
||||||
]
|
|
||||||
},
|
|
||||||
background: place(
|
|
||||||
dx: -64%,
|
|
||||||
dy: 73%,
|
|
||||||
rotate(
|
|
||||||
-90deg,
|
|
||||||
{
|
|
||||||
set text(size: 13pt$if(sidebarfont)$, font: ("$sidebarfont$",)$endif$)
|
|
||||||
grid(
|
|
||||||
columns: (30%, 30%, 5%),
|
|
||||||
rows: 20pt,
|
|
||||||
align: top,
|
|
||||||
[#h(1fr) $if(title)$$title$$endif$ $if(destinations)$$for(destinations)$$destinations$$sep$ - $endfor$$endif$ #h(5fr)],
|
|
||||||
[#h(1fr) $if(by-author)$$for(by-author)$$it.name.literal$$sep$ - $endfor$$endif$ #h(4fr)],
|
|
||||||
grid.cell(
|
|
||||||
fill: black,
|
|
||||||
align: center,
|
|
||||||
stroke: 1pt,
|
|
||||||
text(fill: white, context counter(page).display("۱/۱", both: true)),
|
|
||||||
),
|
|
||||||
grid.hline(start: 0),
|
|
||||||
)
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
#show: doc => article(
|
|
||||||
$if(title)$
|
|
||||||
title: [$title$],
|
|
||||||
$endif$
|
|
||||||
$if(subtitle)$
|
|
||||||
subtitle: [$subtitle$],
|
|
||||||
$endif$
|
|
||||||
$if(company)$
|
|
||||||
company: [$company$],
|
|
||||||
$endif$
|
|
||||||
$if(destinations)$
|
|
||||||
destinations: (
|
|
||||||
$for(destinations)$
|
|
||||||
[$destinations$],
|
|
||||||
$endfor$
|
|
||||||
),
|
|
||||||
$endif$
|
|
||||||
$if(purpose)$
|
|
||||||
purpose: [$purpose$],
|
|
||||||
$endif$
|
|
||||||
$if(report-type)$
|
|
||||||
report-type: "$report-type$",
|
|
||||||
$endif$
|
|
||||||
$if(logofile)$
|
|
||||||
logo: "$logofile$",
|
|
||||||
$endif$
|
|
||||||
$if(by-author)$
|
|
||||||
authors: (
|
|
||||||
$for(by-author)$
|
|
||||||
$if(it.name.literal)$
|
|
||||||
( name: [$it.name.literal$],
|
|
||||||
affiliation: [$for(it.affiliations)$$it.name$$sep$, $endfor$],
|
|
||||||
email: [$it.email$] ),
|
|
||||||
$endif$
|
|
||||||
$endfor$
|
|
||||||
),
|
|
||||||
$endif$
|
|
||||||
$if(report-date)$
|
|
||||||
date: [$report-date$],
|
|
||||||
$endif$
|
|
||||||
$if(lang)$
|
|
||||||
lang: "$lang$",
|
|
||||||
$endif$
|
|
||||||
$if(region)$
|
|
||||||
region: "$region$",
|
|
||||||
$endif$
|
|
||||||
$if(mainfont)$
|
|
||||||
font: ("$mainfont$",),
|
|
||||||
$endif$
|
|
||||||
$if(fontsize)$
|
|
||||||
fontsize: $fontsize$,
|
|
||||||
$endif$
|
|
||||||
$if(section-numbering)$
|
|
||||||
sectionnumbering: "$section-numbering$",
|
|
||||||
$endif$
|
|
||||||
$if(toc)$
|
|
||||||
toc: $toc$,
|
|
||||||
$endif$
|
|
||||||
$if(toc-title)$
|
|
||||||
toc_title: [$toc-title$],
|
|
||||||
$endif$
|
|
||||||
toc_depth: $toc-depth$,
|
|
||||||
doc,
|
|
||||||
)
|
|
||||||
@@ -1,162 +0,0 @@
|
|||||||
// 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,
|
|
||||||
authors: none,
|
|
||||||
keywords: (),
|
|
||||||
date: none,
|
|
||||||
abstract-title: none,
|
|
||||||
abstract: none,
|
|
||||||
thanks: none,
|
|
||||||
cols: 1,
|
|
||||||
lang: "fa",
|
|
||||||
region: none,
|
|
||||||
font: none,
|
|
||||||
fontsize: 13pt,
|
|
||||||
title-size: 1.5em,
|
|
||||||
subtitle-size: 1.25em,
|
|
||||||
heading-family: none,
|
|
||||||
heading-weight: "bold",
|
|
||||||
heading-style: "normal",
|
|
||||||
heading-color: black,
|
|
||||||
heading-line-height: 0.65em,
|
|
||||||
mathfont: none,
|
|
||||||
codefont: none,
|
|
||||||
linestretch: 1,
|
|
||||||
sectionnumbering: none,
|
|
||||||
linkcolor: none,
|
|
||||||
citecolor: none,
|
|
||||||
filecolor: none,
|
|
||||||
toc: false,
|
|
||||||
toc_title: none,
|
|
||||||
toc_depth: none,
|
|
||||||
toc_indent: 1.5em,
|
|
||||||
company: none,
|
|
||||||
destinations: none,
|
|
||||||
purpose: none,
|
|
||||||
report-type: none,
|
|
||||||
logo: none,
|
|
||||||
doc,
|
|
||||||
) = {
|
|
||||||
set document(title: title, keywords: keywords)
|
|
||||||
set document(
|
|
||||||
author: authors.map(author => content-to-string(author.name)).join(", ", last: " و "),
|
|
||||||
) if authors != none and authors != ()
|
|
||||||
|
|
||||||
set text(lang: lang, dir: rtl, size: fontsize)
|
|
||||||
set text(font: font) if font != none
|
|
||||||
set par(justify: true, leading: linestretch * 0.65em)
|
|
||||||
set align(right)
|
|
||||||
set heading(numbering: sectionnumbering)
|
|
||||||
|
|
||||||
show math.equation: set text(font: mathfont) if mathfont != none
|
|
||||||
show raw: set text(font: codefont) if codefont != none
|
|
||||||
show link: set text(fill: rgb(content-to-string(linkcolor))) if linkcolor != none
|
|
||||||
show ref: set text(fill: rgb(content-to-string(citecolor))) if citecolor != none
|
|
||||||
|
|
||||||
let dest-text = if destinations == none {
|
|
||||||
""
|
|
||||||
} else if type(destinations) == array {
|
|
||||||
destinations.join(" - ")
|
|
||||||
} else {
|
|
||||||
destinations
|
|
||||||
}
|
|
||||||
|
|
||||||
let author-names = if authors == none or authors == () {
|
|
||||||
""
|
|
||||||
} else {
|
|
||||||
authors.map(a => content-to-string(a.name)).join(" - ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Title block
|
|
||||||
block(width: 100%)[
|
|
||||||
#grid(
|
|
||||||
columns: (1fr, auto),
|
|
||||||
align: (right, left),
|
|
||||||
[
|
|
||||||
#set par(leading: 0.9em, spacing: 0em)
|
|
||||||
#if company != none {
|
|
||||||
text(21pt, weight: "bold", company)
|
|
||||||
if subtitle != none {
|
|
||||||
text(14pt)[ | #subtitle]
|
|
||||||
}
|
|
||||||
linebreak()
|
|
||||||
}
|
|
||||||
#if title != none {
|
|
||||||
text(14pt, weight: "bold", title)
|
|
||||||
}
|
|
||||||
],
|
|
||||||
if logo != none {
|
|
||||||
image(logo, height: 1.8cm)
|
|
||||||
} else {
|
|
||||||
[]
|
|
||||||
},
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
// Travel meta is gated on report-type (from templates/travel.yml), not on purpose.
|
|
||||||
let show-travel-meta = report-type == "travel"
|
|
||||||
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
if toc {
|
|
||||||
let title = if toc_title == none { auto } else { toc_title }
|
|
||||||
block(above: 0em, below: 2em)[
|
|
||||||
#outline(title: title, depth: toc_depth, indent: toc_indent)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
doc
|
|
||||||
}
|
|
||||||
|
|
||||||
#set table(
|
|
||||||
inset: 6pt,
|
|
||||||
stroke: 0.5pt + gray,
|
|
||||||
align: center,
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user