diff --git a/.gitignore b/.gitignore index ad7c24f..b89ad7e 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,8 @@ npm-debug.log* # Generated static/css/site.compiled.css + +# Nix +result +result-* +.direnv/ diff --git a/Makefile b/Makefile index 206aa66..c09cd2c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help serve size validate clean +.PHONY: help serve size validate tidy ascii clean help: ## Show this help @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ @@ -28,5 +28,14 @@ validate: ## Quick HTML sanity check (counts opening vs closing tags) diff <(echo "$$open") <(echo "$$close") || true; \ done -clean: ## Remove generated artifacts +tidy: ## Run html-tidy on every .html + @for f in *.html; do echo "--- $$f ---"; tidy -e -q $$f || true; done + +ascii: ## Regenerate the body-rain ASCII art (needs chafa) + @mkdir -p static/ascii + chafa -f symbols -c none -s 240x60 --symbols ascii --animate off \ + static/img/og-image-bg.svg > static/ascii/rain.txt + @echo "Regenerated static/ascii/rain.txt (from static/img/og-image-bg.svg)" + +clean: ## Remove build artefacts @rm -rf bin/ node_modules/ dist/ diff --git a/README.md b/README.md index 0cc95fe..bc35865 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,104 @@ The `Makefile` wraps the Python server and a few convenience commands: make serve # python3 -m http.server 8000 make size # report file sizes make validate # quick HTML syntax check (search for unclosed tags) +make tidy # run html-tidy on every .html (warnings only) +make ascii # regenerate the body-rain ASCII art (needs `chafa`) ``` +## Animated ASCII body background + +The page background is **animated ASCII art** generated by +[`chafa`](https://github.com/hpjansson/chafa) from a stripped-down version +of the Open Graph card (`static/img/og-image-bg.svg` — black background, +grid, the `tui-pages` wordmark, the "A framework for / building TUIs in +Rust." headline, and the subtitle, with the install button cropped out +because chafa was rendering it as a row of `@` symbols). The art is plain +text inside `
` blocks; the animation is pure CSS.
+
+```
+static/ascii/rain.txt     ← 240 × ~50 grid of og-image-bg.svg
+```
+
+To re-render after changing the source SVG (you need `chafa` on `$PATH`,
+or run inside `nix develop`):
+
+```bash
+make ascii
+```
+
+The source SVG is committed (`static/img/og-image-bg.svg`) so `make ascii`
+is fully reproducible — no ImageMagick, no cropping step.
+
+### How it's wired
+
+- A single `