feat(manual): add listings outline and tweak template

This commit is contained in:
2026-06-28 22:28:13 +02:00
parent 759b416bf3
commit 31e696c938

View File

@@ -66,8 +66,40 @@
font: "Source Sans 3",
)
show std.title: set text(size: 1.5em)
set raw(syntaxes: path("midas.sublime-syntax"))
let front-page() = {
align(center)[
#{
set text(size: 1.5em)
std.title()
}
v#version - #hash
#if icon-path != none {
v(1cm)
image(icon-path)
}
]
pagebreak()
}
let outlines() = {
outline()
pagebreak()
outline(
title: [List of Listings],
target: figure.where(kind: raw),
)
outline(
title: [List of Tables],
target: figure.where(kind: table),
)
}
let main() = {
// Adapted from https://github.com/hei-templates/hei-synd-thesis/blob/7d2b941197babae0bf3afd4e5914754e09a64001/lib/template-thesis.typ#L242-L261
show heading.where(level: 1): it => {
pagebreak()
@@ -93,29 +125,19 @@
}
set page(
header: context if counter(page).get().first() != 1 { _render-header(version, hash) },
footer: context if counter(page).get().first() != 1 and page.numbering != none {
header: context _render-header(version, hash),
footer: context if page.numbering != none {
align(center, counter(page).display(page.numbering, both: true))
},
numbering: "1 / 1",
)
set raw(syntaxes: path("midas.sublime-syntax"))
// Title page
align(center)[
#std.title()
v#version - #hash
#if icon-path != none {
v(1cm)
image(icon-path)
}
]
outline()
show heading: set heading(numbering: "I.1.")
counter(page).update(1)
doc
}
front-page()
outlines()
main()
}