1
0
mirror of https://gitlab.cvh-server.de/skrause/flashcards.git synced 2025-12-12 06:41:38 +01:00

use hydra for heading, cleanup docs template

This commit is contained in:
2025-03-26 16:07:59 +01:00
parent 588dea495e
commit 568e4a8db9
2 changed files with 15 additions and 48 deletions

View File

@@ -14,5 +14,8 @@
#pagebreak()
#lorem(100)
#pagebreak()
= Fazit
#lorem(100)

View File

@@ -1,6 +1,5 @@
// The project function defines how your document looks.
// It takes your content and some metadata and formats it.
// Go ahead and customize it to your liking!
#import "@preview/hydra:0.6.0": hydra
#let project(title: "", subtitle: "", authors: (), logo: none, body) = {
// Set the document's basic properties.
@@ -42,55 +41,20 @@
set page(numbering: "I", number-align: center)
/*let ht-first = state("page-first-section", [])
let ht-last = state("page-last-section", [])
set page(
header: {
locate(loc => {
// find first heading of level 1 on current page
let first-heading = query(
heading.where(level: 1), loc)
.find(h => h.location().page() == loc.page())
// find last heading of level 1 on current page
let last-heading = query(
heading.where(level: 1), loc)
.rev()
.find(h => h.location().page() == loc.page())
// test if the find function returned none (i.e. no headings on this page)
{
if not first-heading == none {
ht-first.update([
// change style here if update needed section per section
#first-heading.body
])
ht-last.update([
// change style here if update needed section per section
#last-heading.body
])
// if one or more headings on the page, use first heading
// change style here if update needed page per page
ht-first.display()
} else {
// no headings on the page, use last heading from variable
// change style here if update needed page per page
ht-last.display()
}
}
}
)
v(-0.8em)
line(length: 100%, stroke: 0.5pt)
}
)*/
// Table of contents
outline(depth: 3)
pagebreak()
let show-header(ctx, candidates) = {
candidates.body
v(-0.8em)
line(length: 100%, stroke: 0.5pt)
}
set page(header: context {
hydra(1, skip-starting: false, display: show-header)
})
set page(numbering: "1")
counter(page).update(1)