Contributors Guide
Architecture
Listsome follows a pipeline architecture: source content → parse → render → output.
projects/*/index.md ──► Parser ──► Renderer (MiniJinja) ──► output/
(frontmatter + MD) (pulldown-cmark) + (static HTML)
templates/
Modules
| Module | Responsibility |
|---|---|
src/cli.rs | Command-line argument parsing with clap |
src/commands.rs | Command implementations that wire up the pipeline |
src/config.rs | listsome.toml loading, default config creation |
src/parser/mod.rs | Frontmatter extraction, Markdown→HTML, step/BOM parsing |
src/render/mod.rs | MiniJinja template rendering, context builders |
src/generator/mod.rs | Site generation orchestration (discover, parse, render, copy assets, generate index + feed) |
src/server/mod.rs | Axum-based dev server with WebSocket live reload and file watching |
src/model/project.rs | Project, Step, ProjectMetadata, Difficulty, ProjectStatus |
src/model/site.rs | SiteConfig, BuildConfig, WebmentionConfig, FediverseConfig |
src/error.rs | ListsomeError enum with typed error variants |
src/templates/ | Built-in MiniJinja templates (base.html, index.html, project.html, feed.atom) |
Data Flow
listsome buildloadslistsome.tomlviaconfig::find_and_load_config()generator::SiteGenerator::discover_projects()walksprojects/looking forindex.md- Each file is parsed by
parser::parse_project()which extracts frontmatter and renders Markdown to HTML - Headers matching
## Step N: TitlebecomeStepstructs; BOM tables becomeMaterialItems render::TemplateRendererrenders each project into HTML using MiniJinja templates- Assets from
projects/<slug>/assets/are copied tooutput/<slug>/assets/ output/index.html(project listing) andoutput/feed.atomare generated
Design Patterns
- Pure functions with no shared mutable state
Result<T, ListsomeError>throughout for error handling- Immutable
ProjectandProjectMetadatastructs SiteConfigwith sensible defaults viaDefaulttrait- Template renderer is created once and reused across all projects
Building
cargo build
cargo build --release # Optimized binary
Testing
cargo test # Run all tests
cargo test -- --nocapture # Show test output
Tests are in #[cfg(test)] modules within each source file (parser, render, generator, config, server).
Code Style
cargo clippy: Pedantic and nursery lints enabled (warnings during dev, not errors)cargo fmt: 100-character line width, Unix line endings- Conventional commit messages for pull requests
How to Contribute
- Open an issue to discuss your proposed change
- Fork the repository
- Make your changes with tests
- Run
cargo testandcargo clippy - Submit a pull request