Docs that don't drift
mdt keeps your READMEs, doc comments, and docs sites in sync from a single markdown template. One update command. CI catches drift before merge.
How it works
No daemon, no lockfile, no vendor lock-in. Templates are plain markdown with comment tags.
Write a block in a *.t.md template file. That block is the single source of truth for its content.
Place a consumer tag in any markdown file — or inside source doc comments with //! and /// prefixes.
mdt check verifies every consumer is up to date; mdt update syncs them. Run check in CI so drift never merges.
The shape of it
install.t.md — source
<!-- {@install} --> npm install my-lib <!-- {/install} -->
readme.md — consumer
<!-- {=install} --> npm install my-lib <!-- {/install} -->
Built in
Render blocks with minijinja templates fed by project data — versions, package names, anything in mdt.toml.
Trim, indent, wrap, uppercase, or line-prefix content as it's injected — the same template fits every context.
mdt check exits non-zero when any block has drifted, so stale docs fail the build like a broken test.
Consumers work inside //!, ///, and other comment prefixes — crate docs stay synced too.
Diagnostics, hover previews, completions, and rename across blocks via mdt lsp — free for any LSP client.
AI assistants read and verify your doc graph through mdt mcp, so agents stop shipping stale docs.
Install
npm install -g @m-d-t/cli
cargo install mdt_cli
github.com/ifiokjr/mdt/releases