Skip to content

Development Setup

ToolMinimum versionPurpose
Rust1.80Compiler and cargo
Zig0.15.2Zig FFI layer (md4c parser and SIMD acceleration)
BunlatestDocs site tooling
cargo-nextestlatestTest runner
lefthooklatestPre-commit hooks

Install cargo-nextest and lefthook if you don’t have them:

Terminal window
cargo install cargo-nextest --locked
brew install lefthook # macOS; see lefthook.run for others
lefthook install
Terminal window
git clone https://github.com/sethyanow/markymark.git
cd markymark
cargo build

For a release-optimized build (slower compile, faster binary):

Terminal window
cargo build --release

The Zig FFI layer compiles automatically via build.rs. Zig 0.15.2+ is required for all builds — the library is statically linked into the binary. The build will fail if Zig is not installed or is below the minimum version.

Terminal window
cargo nextest run # all tests
cargo nextest run -p markymark-core # single crate
cargo nextest run -p markymark-index # integration tests live here

The project uses cargo-nextest instead of cargo test for parallel execution and better output. Integration tests live in each crate’s tests/ directory alongside unit tests in source files (#[cfg(test)] modules).

Zig tests run separately:

Terminal window
cd zig && zig build test
Terminal window
cargo fmt --all -- --check # formatting
cargo clippy --workspace --all-targets -- -D warnings # lints
cargo audit # dependency vulnerabilities

All three must pass before committing. The pre-commit hooks run these automatically.

Start the LSP server (editors connect over stdin/stdout):

Terminal window
cargo run -- --lsp

Start the MCP server (AI agents connect over stdin/stdout):

Terminal window
cargo run -- --mcp /path/to/your/workspace

The project uses lefthook to run checks before each commit. After cloning, install the hooks:

Terminal window
lefthook install

The hook sequence runs in order:

  1. cargo fmt — formatting check
  2. cargo clippy — lint with -D warnings
  3. cargo-audit — dependency vulnerability scan
  4. gitleaks — secret detection on staged files
  5. zig build — Zig FFI layer compilation check

If a hook fails, the commit is blocked. Fix the issue and try again.

Terminal window
cd docs-site
bun install
bun run dev # local preview at localhost:4321
bun run build # production build