Back to browse
GitHub Repository

A Rust CLI tool for documentation ↔ code mapping verification

4 starsRust

Doksnet – keep docs and code in sync with hash verification

by pulko·Feb 20, 2026·1 point·0 comments

AI Analysis

●●SolidBig BrainSolve My Problem

Hash-based doc-code sync detection in Rust; solves real drift but narrow audience.

Strengths
  • Deterministic text extraction + Blake3 hashing is clever, avoids fragile AST parsing
  • Repo-local, zero external dependencies makes it genuinely portable for CI pipelines
  • Interactive workflow (add/edit/test) feels thoughtful for iterative documentation work
Weaknesses
  • Audience limited to projects with doc-code coupling tight enough to justify tooling
  • Whitespace sensitivity (stated feature) risks false positives in normal refactoring
Target Audience

Technical writers, library maintainers, documentation-heavy projects

Similar To

Doctest (Rust) · mdBook testing · Literate programming tools

Post Description

Docs drift. Examples in README.md stop matching the implementation. CI usually doesn’t notice.

I built doksnet, a small Rust CLI that lets you link a documentation section to a code snippet and verify that both sides stay in sync using Blake3 hashes.

You define mappings like:

• README.md:15-25

• src/lib.rs:40-65

doksnet stores the ranges + their hashes in a compact .doks file. doksnet test re-extracts the content and fails (exit code 1) if anything changed — including whitespace.

Basic flow:

• doksnet new – initialize

• doksnet add – create doc ↔ code mapping (interactive)

• doksnet test – CI-safe verification

• doksnet test-interactive – review/fix mismatches

It’s repo-local, no external service, no parsing/AST magic — just deterministic text extraction + hashing.

There’s also a GitHub Action if you want to enforce sync in CI.

Repo: https://github.com/Pulko/doksnet Install: cargo install doksnet Web: https://doksnet.pulko-app.com

Interested in feedback on the approach — especially whether this tool could be more useful then “Rewrite all the readme based on new changes. Make no mistakes”, for instance, in environments where AI usage is restricted

Similar Projects