This commit is contained in:
2025-05-19 23:08:28 +02:00
commit 4d6c7201ee
15 changed files with 842 additions and 0 deletions

47
simple-page-layout.typ Normal file
View File

@@ -0,0 +1,47 @@
#import "common.typ": *
#import "core-page-style.typ": *
#let html-href(target, content) = {
[#context if is-html() {
html.elem("a", attrs:(href:target), content)
} else { content }]
}
#let min-pdf-link(content) = {
[#context if is-html() {
html.elem("a", attrs:(href:"#",onclick:"gotoMinPdf();"), content)
} else { content }]
}
#let simple-page(gen-table-of-contents: true, gen-index-ref: true, content) = {
core-page-style[
#if is-web {
table(
stroke: none,
columns: (25%, 50%, 25%),
column-fixed(
[#if gen-table-of-contents { [#table-of-contents()] }],
min-pdf-link("Minimal PDF Version"),
[#if gen-index-ref {[
#context br()
#context html-href("index.html")[#html-bold[Website Home]]
]}]
),
[
#let off = 3;
#html-style("position: absolute; left: "+str(25+off)+"%; width: "+str(75-off)+"%")[
#box(width: 50%, content)
]
],
)
} else {
content
}
#html-script("
function gotoMinPdf() {
window.location.href = window.location.href.replace(/\.\w+.html/g, '.min.pdf');
}
")
]
}