From 32784a25be8ff89cecfb55d03f53dd8787c67417 Mon Sep 17 00:00:00 2001 From: anarsec Date: Thu, 18 Apr 2024 16:54:58 +0000 Subject: [PATCH] typst level 1 page break --- layout/anarsec_article.typ | 3 +-- layout/python/anarsec_article_to_pdf.py | 3 --- themes/DeepThought/static/js/site.js | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/layout/anarsec_article.typ b/layout/anarsec_article.typ index a2e5c5d..722ffc8 100644 --- a/layout/anarsec_article.typ +++ b/layout/anarsec_article.typ @@ -57,7 +57,6 @@ // set headings show heading.where(level: 1): it => { - pagebreak(weak: true) block(width: 100%)[ #set align(center) #set text(size: 22pt, font: "Jost") @@ -99,7 +98,7 @@ } } 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/#") { context { diff --git a/layout/python/anarsec_article_to_pdf.py b/layout/python/anarsec_article_to_pdf.py index 954519e..1d52ff0 100644 --- a/layout/python/anarsec_article_to_pdf.py +++ b/layout/python/anarsec_article_to_pdf.py @@ -98,9 +98,6 @@ class Converter: # Grab the description 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 description_md_path = pathlib.Path(workingDirectory) / "description.md" description_txt_path = pathlib.Path(workingDirectory) / "description.txt" diff --git a/themes/DeepThought/static/js/site.js b/themes/DeepThought/static/js/site.js index db448db..195d798 100644 --- a/themes/DeepThought/static/js/site.js +++ b/themes/DeepThought/static/js/site.js @@ -30,8 +30,8 @@ const elemAbsBottom = elemRect.bottom - bodyRect.top; const h = (window.innerHeight || document.documentElement.clientHeight); document.querySelector(".menu").style = "position: sticky; top: 48px;"; - const minScroll = tocIndex.offsetTop - document.querySelector(".menu").clientHeight + tocIndex.offsetHeight + 50; - const maxScroll = tocIndex.offsetTop - tocIndex.offsetHeight - 50; + const minScroll = tocItems[tocIndex].offsetTop - document.querySelector(".menu").clientHeight + tocItems[tocIndex].offsetHeight + 50; + const maxScroll = tocItems[tocIndex].offsetTop - tocItems[tocIndex].offsetHeight - 50; if(document.querySelector(".menu").scrollTop < minScroll){ document.querySelector(".menu").scrollTop = minScroll; }