| Crates.io | doksnet |
| lib.rs | doksnet |
| version | 1.1.2 |
| created_at | 2025-06-09 01:14:25.573821+00 |
| updated_at | 2025-06-09 13:53:44.934457+00 |
| description | A CLI tool for documentation-code mapping verification using cryptographic hashes |
| homepage | https://github.com/Pulko/doksnet |
| repository | https://github.com/Pulko/doksnet |
| max_upload_size | |
| id | 1705381 |
| size | 129,984 |
A Rust CLI tool for documentation β code mapping verification. Create lightweight symbolic links between documentation sections and code snippets, then verify that both sides stay synchronized using cryptographic hashes.
# Install from crates.io
cargo install doksnet
Download pre-built binaries from GitHub Releases:
doksnet-linux-amd64doksnet-windows-amd64.exedoksnet-macos-amd64 (Intel) or doksnet-macos-arm64 (Apple Silicon)# Clone and build from source
git clone https://github.com/Pulko/doksnet
cd doksnet
cargo install --path .
| Command | Purpose | Interactive | CI/CD Safe |
|---|---|---|---|
new |
Initialize a .doks file |
β | β |
add |
Create docβcode mappings | β | β |
edit <id> |
Edit specific mapping | β | β |
remove-failed |
Remove all failed mappings | β | β |
test |
Verify all mappings | β | β |
test-interactive |
Test with guided fixing | β | β |
# Create .doks file in current directory
doksnet new
# Create .doks file in specific directory
doksnet new /path/to/project
What it does:
.doks configuration filedoksnet add
Interactive flow:
README.md:15-25 or README.md:10-20@5-30src/lib.rs:45-60 or src/main.rs:10-25@10-50# Edit by ID (first 8 characters sufficient)
doksnet edit a1b2c3d4
What you can edit:
Features:
# Non-interactive testing for automation
doksnet test
Output:
# Interactive mode with change preview
doksnet test-interactive
For each failed mapping, you can:
doksnet edit <id>Shows:
# Remove all mappings that fail verification
doksnet remove-failed
Safety features:
Partitions use this lightweight format to reference file ranges:
<relative_path>:<start_line>-<end_line>@<start_col>-<end_col>
Examples:
README.md - Entire fileREADME.md:10-20 - Lines 10-20README.md:15 - Single line 15src/lib.rs:10-20@5-30 - Lines 10-20, columns 5-30docs/guide.md:1-5@1-50 - First 5 lines, first 50 charactersNotes:
How it works:
What's detected:
The .doks file uses a compact, machine-optimized format:
# .doks v2 - Compact format
version=0.2.0
default_doc=README.md
# Format: id|doc_partition|code_partition|doc_hash|code_hash|description
a1b2c3d4|README.md:10-15|src/lib.rs:20-35|abc123def456...|789xyz012abc...|API usage example
main-func|README.md:25-30|src/main.rs:1-10|fedcba987654...|123456789abc...|Main function example
Benefits of the compact format:
# 1. Initialize project
doksnet new
# 2. Create mappings between docs and code
doksnet add # Repeat as needed
# 3. Test locally
doksnet test
# 4. When changes are detected
doksnet test-interactive # Guided fixing
# 5. Edit specific mappings
doksnet edit a1b2c3d4
# 6. Clean up broken mappings
doksnet remove-failed
Using GitHub Action (Recommended):
# .github/workflows/docs.yml
name: Documentation Sync
on: [push, pull_request]
jobs:
verify-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Pulko/doksnet@v1
Manual Installation:
# In your CI/CD pipeline
cargo install doksnet
doksnet test # Fails build if docs/code drift apart
Doksnet provides a ready-to-use GitHub Action for seamless CI/CD integration:
name: Documentation Sync Check
on: [push, pull_request]
jobs:
verify-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Pulko/doksnet@v1
# Uses defaults: command='test', fail-on-error=true
- uses: Pulko/doksnet@v1
with:
command: 'test' # Command to run
version: 'latest' # Doksnet version
working-directory: '.' # Directory to run in
fail-on-error: true # Fail workflow on issues
| Input | Description | Default | Options |
|---|---|---|---|
command |
Doksnet command to run | test |
test, remove-failed |
version |
Doksnet version to use | latest |
latest, 0.2.0, etc. |
working-directory |
Directory to run doksnet in | . |
Any valid path |
fail-on-error |
Fail workflow if issues found | true |
true, false |
| Output | Description |
|---|---|
result |
Full output from doksnet command |
exit-code |
Exit code (0 = success, 1 = failure) |
Enforce Documentation Sync (Fail Build):
- uses: Pulko/doksnet@v1
# Fails CI if docs are out of sync (default behavior)
Warning Only (Don't Fail Build):
- uses: Pulko/doksnet@v1
with:
fail-on-error: false
Cleanup Failed Mappings:
- uses: Pulko/doksnet@v1
with:
command: 'remove-failed'
Benefits:
Built with β€οΈ in Rust β’ Lightweight β’ Fast β’ Reliable