From b08c426877bf646460ac3410f6e869f0e303cd32 Mon Sep 17 00:00:00 2001 From: alex-s168 Date: Wed, 23 Jul 2025 08:59:52 +0200 Subject: [PATCH] c --- config.py | 11 ++++++++++- core-page-style.typ | 30 +++++++++++++++++++++++------ pages/compiler-pattern-matching.typ | 2 +- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/config.py b/config.py index 7ea0739..88e60d2 100644 --- a/config.py +++ b/config.py @@ -1,10 +1,19 @@ import os gen = """ +build always: phony + rule regen command = python config.py generator = 1 +rule update_git_rev + command = git rev-parse HEAD > build/git_rev.txt.tmp && \ + cmp -s build/git_rev.txt.tmp build/git_rev.txt || mv build/git_rev.txt.tmp build/git_rev.txt; \ + rm -f build/git_rev.txt.tmp + restat = 1 +build build/git_rev.txt: update_git_rev | always + rule typst depfile = $out.d command = eval "typst compile --root . --features html -j 6 $flags $in $out --make-deps $out.d" @@ -73,7 +82,7 @@ web_targets = [] for page in pages: gr = "build/" + page + ".git_rev.txt" gen += "\n" - gen += "build "+gr+" : git_inp pages/" + page + gen += "build "+gr+" : git_inp pages/" + page + " | build/git_rev.txt" for var in variants: tg = "build/" + page + var["suffix"] web_targets.append(tg) diff --git a/core-page-style.typ b/core-page-style.typ index 1a3a5e5..b038752 100644 --- a/core-page-style.typ +++ b/core-page-style.typ @@ -81,9 +81,8 @@ html.elem("style", " @font-face { font-family: 'DejaVu Sans Mono'; - src: url('res/DejaVuSansMono-Bold.woff2') format('woff2'), - url('res/DejaVuSansMono-Bold.woff') format('woff'), - local('DejaVu Sans Mono'), + src:local('DejaVu Sans Mono'), + url('res/DejaVuSansMono-Bold.woff2') format('woff2'), local('Courier New'), local(Courier), local(monospace); @@ -94,9 +93,8 @@ html.elem("style", " @font-face { font-family: 'DejaVu Sans Mono'; - src: url('res/DejaVuSansMono.woff2') format('woff2'), - url('res/DejaVuSansMono.woff') format('woff'), - local('DejaVu Sans Mono'), + src:local('DejaVu Sans Mono'), + url('res/DejaVuSansMono.woff2') format('woff2'), local('Courier New'), local(Courier), local(monospace); @@ -105,6 +103,26 @@ html.elem("style", " font-display: swap; } + @font-face { + font-family: 'DejaVu Sans'; + src:local('DejaVu Sans'), + url('res/DejaVuSans-Bold.woff2') format('woff2'), + local('Courier New'); + font-weight: bold; + font-style: normal; + font-display: swap; + } + + @font-face { + font-family: 'DejaVu Sans'; + src:local('DejaVu Sans'), + url('res/DejaVuSans.woff2') format('woff2'), + local('Courier New'); + font-weight: normal; + font-style: normal; + font-display: swap; + } + body { font-family: DejaVu Sans Mono; font-size: "+len2css(default-font-size)+"; diff --git a/pages/compiler-pattern-matching.typ b/pages/compiler-pattern-matching.typ index 72e1174..71121ce 100644 --- a/pages/compiler-pattern-matching.typ +++ b/pages/compiler-pattern-matching.typ @@ -178,7 +178,7 @@ #flink("https://egraphs-good.github.io/")[egg] is a IR pattern matching and transformation library that uses #inline-block(flink("https://en.wikipedia.org/wiki/E-graph")[E-Graphs]) to - magically solves (almost) all problems regarding IR pattern matching. + magically solve (almost) all problems regarding IR pattern matching. Even though egg solves most problems, I still recommend using a pattern matching dialect, especially in multi-level compilers, to be more flexible, and have more future-proof pattern matching, if for example there suddenly is a better alternative to egg,