typst level 1 page break

This commit is contained in:
anarsec 2024-04-18 16:54:58 +00:00
parent 8428d86f8b
commit 32784a25be
No known key found for this signature in database
3 changed files with 3 additions and 7 deletions

View file

@ -57,7 +57,6 @@
// set headings // set headings
show heading.where(level: 1): it => { show heading.where(level: 1): it => {
pagebreak(weak: true)
block(width: 100%)[ block(width: 100%)[
#set align(center) #set align(center)
#set text(size: 22pt, font: "Jost") #set text(size: 22pt, font: "Jost")
@ -99,7 +98,7 @@
} }
} }
else if it.dest.starts-with("https://") or it.dest.starts-with("http://") { else if it.dest.starts-with("https://") or it.dest.starts-with("http://") {
footnote[#it.dest.trim("https://", at: start).trim("http://", at: start)] 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("/glossary#") or it.dest.starts-with("/glossary/#") {
context { context {

View file

@ -98,9 +98,6 @@ class Converter:
# Grab the description # Grab the description
description = re.search(r'^(.*?)\<\!\-\- more \-\-\>', markdown_content, re.DOTALL | re.MULTILINE).group(1).strip("\n ") description = re.search(r'^(.*?)\<\!\-\- more \-\-\>', markdown_content, re.DOTALL | re.MULTILINE).group(1).strip("\n ")
# Add the intro heading
markdown_content = f"# Introduction\n\n{markdown_content}"
# Parse the description # Parse the description
description_md_path = pathlib.Path(workingDirectory) / "description.md" description_md_path = pathlib.Path(workingDirectory) / "description.md"
description_txt_path = pathlib.Path(workingDirectory) / "description.txt" description_txt_path = pathlib.Path(workingDirectory) / "description.txt"

View file

@ -30,8 +30,8 @@
const elemAbsBottom = elemRect.bottom - bodyRect.top; const elemAbsBottom = elemRect.bottom - bodyRect.top;
const h = (window.innerHeight || document.documentElement.clientHeight); const h = (window.innerHeight || document.documentElement.clientHeight);
document.querySelector(".menu").style = "position: sticky; top: 48px;"; document.querySelector(".menu").style = "position: sticky; top: 48px;";
const minScroll = tocIndex.offsetTop - document.querySelector(".menu").clientHeight + tocIndex.offsetHeight + 50; const minScroll = tocItems[tocIndex].offsetTop - document.querySelector(".menu").clientHeight + tocItems[tocIndex].offsetHeight + 50;
const maxScroll = tocIndex.offsetTop - tocIndex.offsetHeight - 50; const maxScroll = tocItems[tocIndex].offsetTop - tocItems[tocIndex].offsetHeight - 50;
if(document.querySelector(".menu").scrollTop < minScroll){ if(document.querySelector(".menu").scrollTop < minScroll){
document.querySelector(".menu").scrollTop = minScroll; document.querySelector(".menu").scrollTop = minScroll;
} }