Add Makefile scaffolding and diagram compilation
This commit is contained in:
1
site/.gitignore
vendored
1
site/.gitignore
vendored
@@ -4,3 +4,4 @@ themes
|
||||
build
|
||||
storage
|
||||
node_modules
|
||||
diagrams/*.svg
|
||||
|
||||
18
site/Makefile
Normal file
18
site/Makefile
Normal 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
|
||||
@@ -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
51
site/diagrams/crates.typ
Normal 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],
|
||||
)
|
||||
8
site/templates/shortcodes/diagram.html
Normal file
8
site/templates/shortcodes/diagram.html
Normal 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>
|
||||
Reference in New Issue
Block a user