feat: rename project from nrd-sh to sukr
sukr = suckless + Rust. Minimal static site compiler. - Update Cargo.toml name and description - Update main.rs USAGE and doc comments - Update AGENTS.md with new name, Tera architecture - Create README.md with quick start guide
This commit is contained in:
35
AGENTS.md
35
AGENTS.md
@@ -34,13 +34,13 @@ The agent MUST read and adhere to the global engineering ruleset and any active
|
|||||||
|
|
||||||
## Project Overview
|
## Project Overview
|
||||||
|
|
||||||
**nrd.sh** is a bespoke static site compiler written in Rust. It transforms Markdown content into a minimal, high-performance static site with zero client-side dependencies.
|
**sukr** is a minimal static site compiler written in Rust. Suckless, zero JS, transforms Markdown into high-performance static HTML.
|
||||||
|
|
||||||
### Philosophy
|
### Philosophy
|
||||||
|
|
||||||
- **Suckless:** No bloated runtimes, no unnecessary JavaScript
|
- **Suckless:** No bloated runtimes, no unnecessary JavaScript
|
||||||
- **Hermetic:** Single binary with all dependencies compiled in
|
- **Hermetic:** Single binary with all dependencies compiled in
|
||||||
- **Elegant:** Syntax highlighting via Tree-sitter
|
- **Elegant:** Syntax highlighting via Tree-sitter, templates via Tera
|
||||||
|
|
||||||
### Architecture
|
### Architecture
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ The compiler implements an **Interceptor Pipeline**:
|
|||||||
2. **Stream:** Feed Markdown to `pulldown-cmark` event parser
|
2. **Stream:** Feed Markdown to `pulldown-cmark` event parser
|
||||||
3. **Intercept:** Route code blocks to Tree-sitter, Mermaid, KaTeX
|
3. **Intercept:** Route code blocks to Tree-sitter, Mermaid, KaTeX
|
||||||
4. **Render:** Push modified events to HTML writer
|
4. **Render:** Push modified events to HTML writer
|
||||||
5. **Layout:** Wrap in `maud` templates
|
5. **Layout:** Wrap in Tera templates (runtime, user-customizable)
|
||||||
6. **Write:** Output to `public/`
|
6. **Write:** Output to `public/`
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -65,7 +65,12 @@ cargo run # Run compiler (builds site to public/)
|
|||||||
|
|
||||||
# Production
|
# Production
|
||||||
nix build # Build hermetic release binary
|
nix build # Build hermetic release binary
|
||||||
./result/bin/nrd-sh # Run release compiler
|
./result/bin/sukr # Run release compiler
|
||||||
|
|
||||||
|
# CLI Usage
|
||||||
|
sukr # Build with ./site.toml
|
||||||
|
sukr -c sites/blog/site.toml # Build with custom config
|
||||||
|
sukr --help # Show usage
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -85,15 +90,17 @@ nix build # Build hermetic release binary
|
|||||||
.
|
.
|
||||||
├── Cargo.toml # Rust manifest
|
├── Cargo.toml # Rust manifest
|
||||||
├── flake.nix # Nix build environment
|
├── flake.nix # Nix build environment
|
||||||
├── site.toml # Site configuration
|
├── site.toml # Site configuration (or in sites/*)
|
||||||
├── src/
|
├── src/
|
||||||
│ ├── main.rs # Pipeline orchestrator
|
│ ├── main.rs # Pipeline orchestrator
|
||||||
│ ├── config.rs # TOML config loader
|
│ ├── config.rs # TOML config loader
|
||||||
|
│ ├── content.rs # Content discovery, sections
|
||||||
|
│ ├── template_engine.rs # Tera template engine
|
||||||
│ ├── feed.rs # Atom feed generation
|
│ ├── feed.rs # Atom feed generation
|
||||||
│ ├── highlight.rs # Tree-sitter highlighting
|
│ ├── highlight.rs # Tree-sitter highlighting
|
||||||
│ ├── render.rs # Pulldown-cmark interception
|
│ └── render.rs # Pulldown-cmark interception
|
||||||
│ └── templates.rs # Maud HTML templates
|
├── templates/ # Tera templates (base, page, section/*)
|
||||||
├── content/ # Blog content (Markdown + YAML frontmatter)
|
├── content/ # Markdown + YAML frontmatter
|
||||||
├── static/ # CSS, images, _headers
|
├── static/ # CSS, images, _headers
|
||||||
└── public/ # Generated output
|
└── public/ # Generated output
|
||||||
```
|
```
|
||||||
@@ -121,7 +128,13 @@ nix build # Build hermetic release binary
|
|||||||
Site configuration lives in `site.toml`:
|
Site configuration lives in `site.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
title = "nrd.sh"
|
title = "My Site"
|
||||||
author = "nrdxp"
|
author = "Author Name"
|
||||||
base_url = "https://nrd.sh/"
|
base_url = "https://example.com"
|
||||||
|
|
||||||
|
[paths] # All optional, defaults shown
|
||||||
|
content = "content"
|
||||||
|
output = "public"
|
||||||
|
static = "static"
|
||||||
|
templates = "templates"
|
||||||
```
|
```
|
||||||
|
|||||||
62
Cargo.lock
generated
62
Cargo.lock
generated
@@ -839,37 +839,6 @@ dependencies = [
|
|||||||
"thiserror 1.0.69",
|
"thiserror 1.0.69",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nrd-sh"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"gray_matter",
|
|
||||||
"katex-rs",
|
|
||||||
"lightningcss",
|
|
||||||
"mermaid-rs-renderer",
|
|
||||||
"pulldown-cmark",
|
|
||||||
"serde",
|
|
||||||
"tempfile",
|
|
||||||
"tera",
|
|
||||||
"thiserror 2.0.18",
|
|
||||||
"toml 0.8.23",
|
|
||||||
"tree-sitter",
|
|
||||||
"tree-sitter-bash",
|
|
||||||
"tree-sitter-c",
|
|
||||||
"tree-sitter-css",
|
|
||||||
"tree-sitter-go",
|
|
||||||
"tree-sitter-highlight",
|
|
||||||
"tree-sitter-html",
|
|
||||||
"tree-sitter-javascript",
|
|
||||||
"tree-sitter-json",
|
|
||||||
"tree-sitter-nix",
|
|
||||||
"tree-sitter-python",
|
|
||||||
"tree-sitter-rust",
|
|
||||||
"tree-sitter-typescript",
|
|
||||||
"tree-sitter-yaml",
|
|
||||||
"walkdir",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-traits"
|
name = "num-traits"
|
||||||
version = "0.2.19"
|
version = "0.2.19"
|
||||||
@@ -1539,6 +1508,37 @@ dependencies = [
|
|||||||
"syn 2.0.114",
|
"syn 2.0.114",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sukr"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"gray_matter",
|
||||||
|
"katex-rs",
|
||||||
|
"lightningcss",
|
||||||
|
"mermaid-rs-renderer",
|
||||||
|
"pulldown-cmark",
|
||||||
|
"serde",
|
||||||
|
"tempfile",
|
||||||
|
"tera",
|
||||||
|
"thiserror 2.0.18",
|
||||||
|
"toml 0.8.23",
|
||||||
|
"tree-sitter",
|
||||||
|
"tree-sitter-bash",
|
||||||
|
"tree-sitter-c",
|
||||||
|
"tree-sitter-css",
|
||||||
|
"tree-sitter-go",
|
||||||
|
"tree-sitter-highlight",
|
||||||
|
"tree-sitter-html",
|
||||||
|
"tree-sitter-javascript",
|
||||||
|
"tree-sitter-json",
|
||||||
|
"tree-sitter-nix",
|
||||||
|
"tree-sitter-python",
|
||||||
|
"tree-sitter-rust",
|
||||||
|
"tree-sitter-typescript",
|
||||||
|
"tree-sitter-yaml",
|
||||||
|
"walkdir",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.109"
|
version = "1.0.109"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
[package]
|
[package]
|
||||||
description = "Bespoke static site compiler for nrd.sh"
|
description = "Minimal static site compiler — suckless, Rust, zero JS"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "nrd-sh"
|
name = "sukr"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
59
README.md
Normal file
59
README.md
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# sukr
|
||||||
|
|
||||||
|
**Minimal static site compiler — suckless, Rust, zero JS.**
|
||||||
|
|
||||||
|
sukr transforms Markdown content into high-performance static HTML. No bloated runtimes, no unnecessary JavaScript, just clean output.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Build-time rendering** — Syntax highlighting via Tree-sitter, no client JS
|
||||||
|
- **Tera templates** — Runtime customizable, no recompilation needed
|
||||||
|
- **Convention over configuration** — Add sections by creating directories
|
||||||
|
- **Monorepo support** — Multiple sites via `-c` flag
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
|
# Run (uses ./site.toml)
|
||||||
|
sukr
|
||||||
|
|
||||||
|
# Custom config (monorepo)
|
||||||
|
sukr -c sites/blog/site.toml
|
||||||
|
|
||||||
|
# Help
|
||||||
|
sukr --help
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Create `site.toml`:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
title = "My Site"
|
||||||
|
author = "Your Name"
|
||||||
|
base_url = "https://example.com"
|
||||||
|
|
||||||
|
[paths] # All optional
|
||||||
|
content = "content" # default
|
||||||
|
output = "public" # default
|
||||||
|
static = "static" # default
|
||||||
|
templates = "templates" # default
|
||||||
|
```
|
||||||
|
|
||||||
|
## Content Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
content/
|
||||||
|
├── _index.md # Homepage
|
||||||
|
├── about.md # Standalone page → /about.html
|
||||||
|
└── blog/
|
||||||
|
├── _index.md # Section index → /blog/index.html
|
||||||
|
└── my-post.md # Post → /blog/my-post.html
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
//! nrd.sh - Bespoke static site compiler.
|
//! sukr - Minimal static site compiler.
|
||||||
//!
|
//!
|
||||||
//! Transforms markdown content into a minimal static site.
|
//! Suckless, Rust, zero JS. Transforms markdown into static HTML.
|
||||||
|
|
||||||
mod config;
|
mod config;
|
||||||
mod content;
|
mod content;
|
||||||
@@ -20,10 +20,10 @@ use std::fs;
|
|||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
const USAGE: &str = "\
|
const USAGE: &str = "\
|
||||||
nrd-sh - Bespoke static site compiler
|
sukr - Minimal static site compiler
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
nrd-sh [OPTIONS]
|
sukr [OPTIONS]
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
-c, --config <FILE> Path to site.toml config file (default: ./site.toml)
|
-c, --config <FILE> Path to site.toml config file (default: ./site.toml)
|
||||||
|
|||||||
Reference in New Issue
Block a user