From 38989252289b29a8d627e0fd3e1a5c04985670cc Mon Sep 17 00:00:00 2001 From: Spencer Brower <6729162+sbrow@users.noreply.github.com> Date: Thu, 16 Jul 2026 14:46:11 -0400 Subject: [PATCH] chore: Updated `AGENTS.md`. --- AGENTS.md | 155 ++++++++++++++++++++++++++++++++++++------------------ TODOS.md | 22 ++++---- 2 files changed, 117 insertions(+), 60 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 07c1c9c..8f561ae 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,10 +5,10 @@ Thor is a static site generator written in [Odin](https://odin-lang.org), replac ## Architecture ``` -thor.json ← site config (title, base_url, author, params, sectionate) +thor.json ← site config (title, base_url, author, params) content/ ← markdown and HTML content files layouts/ ← Mustache templates + partials (including icons) -assets/ ← CSS (Tufte-based, no build step) and JS +assets/ ← CSS (Tufte-based), JS, fonts, images — copied/processed to public/ public/ ← build output (generated) ``` @@ -16,35 +16,45 @@ public/ ← build output (generated) | File | Responsibility | |---|---| -| `main.odin` | Entry point. Sets `context.logger`, calls `init_site`, `walk_content`, `render_site` | -| `site.odin` | `Site` struct (config + arena), `init_site`, `load_site_config`, `site_merge`, `site_allocator`, `destroy_site` | +| `main.odin` | Entry point. Sets `context.logger`, calls `init_site`, `walk_content`, `render_site`. Optional Spall profiling via `SPALL` config flag. | +| `site.odin` | `Flags` (parsed config), `Site` (runtime state + arena), `Feature` bit_set enum, `init_site`, `load_site_config`, `merge_flags`, `site_apply_flags`, `find_config` (walks up dir tree for `thor.json`) | | `frontmatter.odin` | JSON frontmatter parser (`{ }` delimited) | -| `content.odin` | `Page` struct, content walker, page loader, cmark integration, full markdown pipeline | +| `content.odin` | `Page` struct, content walker, page loader, cmark integration, full markdown pipeline, `copy_assets_dir` (recursive copy with CSS minification) | | `footnotes.odin` | Note definition stripping (pre-cmark) + sidenote/marginnote injection (post-cmark) | | `alerts.odin` | GitHub alert post-processor (`> [!CAUTION]` → styled blockquote) | | `emoji.odin` | Emoji shortcode expander (`:shrug:` → `¯\_(ツ)_/¯`), post-cmark | -| `highlight.odin` | Post-cmark Tree-sitter syntax highlighter; loads grammars/queries from Helix, caches loaded grammars, reports syntax errors with file/line | -| `tree_sitter.odin` | C FFI bindings for Tree-sitter (TSParser, TSQuery, TSQueryCursor, node traversal, dlopen/dlsym) | +| `highlight.odin` | Post-cmark Tree-sitter syntax highlighter; statically links HTML/CSS grammars, dlopen for others; caches loaded grammars, reports syntax errors | +| `tree_sitter.odin` | C FFI bindings for Tree-sitter (TSParser, TSQuery, TSQueryCursor, node traversal, dlopen/dlsym). Statically links `tree-sitter-html` and `tree-sitter-css` via Nix. | | `sectionate.odin` | `wrap_sections` proc — splits HTML at `` wrappers | -| `render.odin` | Mustache template rendering, all page types, RSS, sitemap, robots.txt, `load_partials` recursive scan | -| `feed.odin` | RSS feed + sitemap XML generation | -| `mustache/` | Mustache template engine (spec-compliant, replaces vendored odin-mustache) | +| `render.odin` | Template rendering pipeline: pre-parses templates/partials once, struct-based data model (`Base_Data`/`Page_Data`/`Home_Data`/`Posts_Data`), `mustache.render()`, minification gate, RSS, sitemap, robots.txt | +| `minify.odin` | Tree-sitter-based HTML and CSS minification (`minify_html`, `minify_css`). Strips comments, collapses whitespace, removes inter-tag spaces. Preserves `
`/``/`