Skip to content

Project Structure

markymark/
├── markymark-cli/ # Binary entry point
├── markymark-core/ # Shared types and traits
├── markymark-parser/ # Tree-sitter markdown parser
├── markymark-index/ # Document and realm indexing
├── markymark-lsp/ # LSP server
├── markymark-mcp/ # MCP server
├── markymark-kernels/ # Zig FFI layer (md4c parser + SIMD acceleration)
├── zig/ # Zig source (compiled by markymark-kernels)
├── markymark-plugin/ # Claude Code plugin manifest
├── markymark-vscode/ # VS Code extension
├── docs-site/ # This documentation site (Starlight)
├── docs/ # Agent reference docs (internal)
├── examples/ # Example configurations
├── security-fixtures/ # Test fixtures for security scans
└── docker/ # Container build files

Each crate has a focused role. See the architecture overview for the full dependency graph.

CrateKey filesWhat to look at
clisrc/main.rsArgument parsing, LSP vs MCP mode selection
coresrc/engine.rs, src/scanner/CoreEngine trait, CoreOperation enum, ScanBackend trait
parsersrc/lib.rs, src/extract/Tree-sitter parsing, element extraction (frontmatter, links, tags, tasks, blocks)
indexsrc/document/, src/realm/Per-document index (from_blob/, from_scan), cross-document realm index, resolution
lspsrc/server.rs, src/state/LSP protocol handlers, server state management
mcpsrc/lib.rs, src/tools/MCP tool definitions, engine operation handlers
kernelsbuild.rs, src/lib.rsZig FFI layer — compilation, bindings, repr(C) structs

Several crates use module directories rather than single files. These were split to keep files under the 500-line threshold.

ModuleFilesContents
markymark-core/src/scanner/mod.rs, types.rs, md4c.rs, tests.rsScan-pass types and md4c scan backend
markymark-parser/src/extract/mod.rs, frontmatter.rs, links.rs, tags.rs, tasks.rs, blocks.rsTree-sitter element extraction by type
markymark-index/src/document/from_blob/mod.rs, header.rs, decode.rs, owned.rs, tests/Blob deserialization with v1/v2 backward compat
markymark-index/src/realm/mod.rs, types.rs, helpers.rs, tests.rsRealmIndex v2 — interner, incremental updates, resolution

The zig/ directory contains the Zig source code compiled by markymark-kernels:

DirectoryPurpose
zig/src/engine/Document engine — blob serialization, FFI exports, stored types
zig/src/md4c/md4c parser bindings — extraction renderer, offset recovery, XML tags
zig/src/shared/Shared utilities (similarity, helpers)
zig/test/Zig test files
zig/bench/Zig benchmarks

The markymark-kernels/build.rs script invokes zig build during cargo build and links the resulting static library. Zig 0.15.2+ is required.

  • Unit tests — inline in source files as #[cfg(test)] modules
  • Integration tests — in each crate’s tests/ directory (e.g., markymark-index/tests/realm_index.rs)
  • Zig tests — in zig/test/ and inline test blocks in source files
  • Snapshot tests — some crates use insta for snapshot testing

The markymark-index crate has the most integration tests since it exercises the full indexing pipeline (parsing, extraction, resolution, diagnostics).

FilePurpose
Cargo.tomlWorkspace configuration, shared dependencies
lefthook.ymlPre-commit hook definitions
cliff.tomlChangelog generation (git-cliff)
deny.tomlDependency license and advisory checks (cargo-deny)
Cross.tomlCross-compilation settings