layout more

This commit is contained in:
anarsec 2024-11-22 14:17:52 -05:00
parent 05a1171289
commit 4854035341
No known key found for this signature in database

View file

@ -12,6 +12,8 @@
) = {
set document(date: none)
set text(lang: lang)
set text(hyphenate: true)
// format lists
set list(marker: ([•], [--]))
@ -101,25 +103,38 @@
outline(indent: 20pt, depth: 2)
// format links
let glossaryFootnote = state("x", [#footnote[anarsec.guide/glossary]<glossary-footnote>])
#if lang == "en" [
#let before = ""
#let after = ""
] else [
#let before = "/" + lang
#let after = lang + "/"
]
#if lang == "en" [
#let rec = "Appendix: Recommendations"
]
#if lang == "fr" [
#let rec = "Annexe: Recommendations"
]
let glossaryFootnote = state("x", [#footnote[anarsec.guide/glossary]<glossary-footnote>])
show link: it => {
it.body
if type(it.dest) == "string" {
if it.dest == "https://anarsec.guide/recommendations" or it.dest == "/recommendations" {
text[ (#emph()[Appendix: Recommendations])]
if it.dest == ("https://anarsec.guide/" + after + "recommendations") or it.dest == (before + "/recommendations") {
text[ (#emph()[rec])]
}
else if it.dest.starts-with("/recommendations#") or it.dest.starts-with("/recommendations/#") {
else if it.dest.starts-with(before + "/recommendations#") or it.dest.starts-with(before + "/recommendations/#") {
context {
let elements = query(label(it.dest.trim("/recommendations#", at: start).trim("/recommendations/#", at: start)))
text[ (#emph()[Appendix: Recommendations])]
let elements = query(label(it.dest.trim(before + "/recommendations#", at: start).trim(before + "/recommendations/#", at: start)))
text[ (#emph()[rec])]
}
}
else if it.dest.starts-with("https://") or it.dest.starts-with("http://") {
footnote[#it.dest.trim("https://", at: start).trim("http://", at: start).trim("www.", at: start)]
}
else if it.dest.starts-with("/glossary#") or it.dest.starts-with("/glossary/#") {
else if it.dest.starts-with(before + "/glossary#") or it.dest.starts-with(before + "/glossary/#") {
context {
let elements = query(heading.where(label: label(it.dest.trim("/glossary#", at: start).trim("/glossary/#", at: start))))
let elements = query(heading.where(label: label(it.dest.trim(before + "/glossary#", at: start).trim(before + "/glossary/#", at: start))))
if elements.len() != 0 {
text[#super[]]
}