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 `
`/``/`