Add Makefile scaffolding and diagram compilation

This commit is contained in:
2026-05-15 13:10:11 -06:00
parent 2f6138bc7a
commit ad21293862
5 changed files with 80 additions and 0 deletions

1
site/.gitignore vendored
View File

@@ -4,3 +4,4 @@ themes
build
storage
node_modules
diagrams/*.svg

18
site/Makefile Normal file
View File

@@ -0,0 +1,18 @@
DIAGRAMS_IN := $(wildcard diagrams/*.typ)
DIAGRAMS_OUT := $(DIAGRAMS_IN:%.typ=%.svg)
diagrams/%.svg: diagrams/%.typ
typst compile $< $@
.PHONY: clean diagrams build serve
diagrams: $(DIAGRAMS_OUT)
clean:
rm -rf diagrams/*.svg
build: diagrams
zola build
serve: diagrams
zola serve

View File

@@ -3,4 +3,6 @@ title = "Architecture"
description = "A tour through Kerolox's codebase architecture."
+++
{{ diagram(name="crates", alt="A block architecture diagram of every Rust crate in the Kerolox codebase.") }}
TODO

51
site/diagrams/crates.typ Normal file
View File

@@ -0,0 +1,51 @@
#set page(width: auto, height: auto, fill: none, margin: 0em)
#set text(font: "Atkinson Hyperlegible Next", size: 18pt, fill: white)
#set grid(align: center + horizon)
#let gutter = .4em
#let stroke = (paint: gray, dash: "dashed")
#let block(cell) = pad(gutter, box(
radius: 5pt,
stroke: white,
fill: black,
inset: gutter,
width: 100%,
height: 1em + gutter * 2,
cell,
))
#grid(
columns: (8em, 4em, 12em),
pad(.5em, [Backend]),
grid.cell(colspan: 2, pad(.5em, [Frontend])),
grid.hline(stroke: stroke),
grid.vline(stroke: stroke, x: 1, start: 1),
[],
grid.cell(colspan: 2, block[cli]),
[],
grid.cell(
colspan: 2,
grid(
columns: 4,
block[lsp], block[check], block[dox],
),
),
block[clingo], grid.cell(colspan: 2, block[frontend]),
block[eval], grid.cell(colspan: 2, block[core]),
grid.hline(stroke: stroke),
grid.cell(
colspan: 2,
block[IR],
),
block[tree-sitter-kerolox],
)

View File

@@ -0,0 +1,8 @@
<figure
class="diagram"
role="img"
aria-label="{{ alt }}"
>
{{- load_data(path="diagrams/" ~ name ~ ".svg") | safe -}}
<figcaption>{{ alt | markdown(inline=true) }}</figcaption>
</figure>