Architecture
markers is a Cargo workspace — a virtual root manifest plus one crate per
concern. The dependency direction is acyclic:
Crates
| Crate | Role | External deps |
|---|---|---|
markers-cli |
markers binary: clap CLI, build/serve/init/wiki commands |
clap, markers-* |
markers-mcp |
markers-mcp binary: stdio MCP server (rmcp) |
rmcp, serde, tokio |
markers-build |
Build pipeline: discover → render → write → copy → graph | markers-* |
markers-site |
Content model: discovery, frontmatter, config, URLs, nav, link resolution | none |
markers-markdown |
Markdown → HTML (pulldown-cmark), outlines, alerts, link rewriting | pulldown-cmark |
markers-theme |
Embedded md.css, site chrome, page.html template |
none |
markers-graph |
Page-link graph extraction + HTML/JSON/DOT rendering | markers-markdown |
markers-wiki |
Wikipedia: URL parse → REST fetch → extract → convert → normalize | reqwest, scraper, htmd, … |
markers-build exists so both the CLI and the MCP server share one pipeline;
markers-wiki is deliberately independent of the site crates — its stages (url
→ client → extractor → converter → normalizer → metadata) are reusable for other
content sources.
Build pipeline
Everything is deterministic and offline — no network access during a build.
Conventions
- Edition 2021/2024 idioms,
thiserrorfor library errors,clapderive for the CLI. - No
unsafe, nounwrap()/expect()on fallible paths in library code. - Small focused modules:
markers-wikisplits url/client/extractor/ converter/normalizer/metadata/error into separate files. - Tests live beside the code (
#[cfg(test)]) plustests/integration suites with local fixtures — no live network in tests.
Developing
cargo build # debug
cargo build --release # release → target/release/markers
cargo test --workspace # all crate tests
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --check
CI (.github/workflows/ci.yaml) runs fmt/clippy/tests on every push and PR. On
master it also builds the release binary, builds the landing site in
packages/landing (Next.js static export rendering these docs at /docs),
deploys it to GitHub Pages, and publishes the rolling latest release.