MDZ (Markdown Document Zip) is a revolutionary new file format designed specifically for sharing Markdown documents with embedded assets. Tired of broken images, missing files, and complex folder structures when sharing your Markdown content? MDZ solves the fundamental challenge of modern content distribution: creating portable, self-contained documents that work perfectly everywhere.
Traditional Markdown Sharing Problems:
- β Broken image links when documents are moved or shared
- β Complex folder structures that must be maintained
- β Network dependencies that make offline viewing impossible
- β Asset management headaches for content creators
- β Distribution requires multiple files and careful organization
MDZ Solution:
- β Single File, Complete Story - Everything embedded in one .mdz file
- β Universal Portability - Works anywhere, no dependencies required
- β Smart Asset Processing - Automatically handles both local and network resources
- β Professional Distribution - Share like a PDF, but with Markdown's flexibility
- β Future-Proof Content - Self-contained files that never break over time
MDZ isn't just another compression tool - it's a thoughtfully designed file format that understands how people actually create and share content:
- Bloggers: Share posts with embedded images without hosting hassles
- Technical Writers: Distribute documentation with diagrams and examples
- Authors: Send book chapters with media to editors and publishers
- Educators: Create lesson plans with embedded resources
- Developers: Share READMEs with screenshots and demos
- Standardized Format: Open specification for consistent implementation
- Rich Ecosystem: Rust library, CLI tool, and VS Code extension
- Extensible Design: Ready for future enhancements and integrations
- Cross-Platform: Works on Windows, macOS, and Linux
- ποΈ MDZ Format: Custom ZIP-based format for bundling Markdown with images, videos, audio, and other files
- π§ Rust Library: High-performance core library (
mdz-rs) with async image downloading and smart asset handling - π» CLI Tool: Full-featured command-line utility (
mdz) for packing and unpacking MDZ files - β‘ VS Code Extension: First-class editor integration with export/unpack capabilities (
mdz-vscode)
- π Network Images: Automatically downloads remote images and saves with UUID filenames
- π Local Files: Intelligent copying of local assets with conflict resolution
- π Relative Links: Uses relative paths (
./assets/...) for maximum compatibility - βͺ Backward Compatibility: Handles legacy MDZ files without filename field
- π Metadata: Complete manifest.json with asset mapping and document metadata
.
βββ LICENSE
βββ README.md
βββ CLAUDE.md
βββ mdz-spec.md # π MDZ format specification
βββ mdz/ # π» CLI tool crate
β βββ Cargo.toml
β βββ src/
β βββ main.rs # CLI interface
β βββ tests.rs # CLI tests
βββ mdz-rs/ # π§ Core library crate
β βββ Cargo.toml
β βββ src/
β βββ lib.rs # Main library implementation
β βββ tests.rs # Unit tests
βββ mdz-vscode/ # β‘ VS Code extension
β βββ package.json
β βββ src/
β β βββ extension.ts # Extension entry point
β β βββ commands/
β β β βββ export.ts # Export functionality
β β β βββ unpack.ts # Unpack functionality
β β βββ utils/
β β βββ mdzCli.ts # CLI integration
β β βββ fileUtils.ts # File utilities
β βββ out/ # Compiled JavaScript
βββ tests/ # π§ͺ Test files and demos
βββ integration_test.rs
βββ demo/
mdz-rs/: Core Rust library (lib.rs) - 787 linesmdz/: CLI tool (main.rs) - 191 linesmdz-vscode/: VS Code extension - 448 lines TypeScript- mdz-spec.md: Complete format specification and usage guide
<!-- Before: Multiple files to manage -->
documentation/
βββ README.md
βββ images/
β βββ architecture.png
β βββ workflow.png
β βββ deployment.png
βββ diagrams/
βββ sequence.uml
βββ network.graphml
<!-- After: Single file to share -->
documentation.mdz β Contains everything!# My Travel Blog Post



<!-- MDZ automatically: -->
<!-- β’ Downloads map image and saves locally -->
<!-- β’ Bundles all media in the file -->
<!-- β’ Updates all links to work offline --># Programming Tutorial
## Exercise 1

## Video Tutorial

## Source Code
[Download examples](./code/examples.zip)| Scenario | Before MDZ | After MDZ |
|---|---|---|
| Sharing with colleague | Send zip file + instructions | Send single .mdz file |
| Uploading to platform | Multiple files + manual linking | Upload single .mdz file |
| Backup content | Track folder + assets separately | One .mdz file contains everything |
| Offline viewing | Broken network images | All images work offline |
| Version control | Large repos with media assets | Small repos with single files |
| Solution | β Advantages | β Limitations |
|---|---|---|
| MDZ | Single file, smart processing, offline capable | Requires MDZ-aware tools |
| ZIP folders | Universal compatibility | Manual asset management |
| Git repos | Version control | Complex setup, requires internet |
| Static sites | Beautiful presentation | Hosting dependency, maintenance |
| PDF export | Universal viewing | Lost Markdown editing capability |
# Install CLI tool
cargo install mdz
# Library usage in Cargo.toml
mdz-rs = "1.1.0"# Clone and build
git clone https://github.com/wflixu/mdz.git
cd mdz
cargo install --path .
# Build library only
cargo build --release -p mdz-rs# Install from marketplace
code --install-extension wflixu.mdz
# Or install from VSIX
code --install-extension mdz-vscode/mdz-1.1.0.vsix# Export markdown to MDZ
mdz pack document.md -o document.mdz
# Export with custom name
mdz pack document.md -o my-doc.mdz
# Unpack MDZ to current directory
mdz unpack document.mdz
# Unpack to specific directory
mdz unpack document.mdz -o output/use mdz_rs::{pack, unpack};
// Async pack function
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
pack("document.md", "document.mdz").await?;
unpack("document.mdz", Some("output/"))?;
Ok(())
}- Export: Right-click
.mdfile β "Export as MDZ" - Unpack: Right-click
.mdzfile β "Unpack MDZ" - Quick Actions: Export/unpack buttons in editor title bar
- Commands:
Ctrl+Shift+Pβ "MDZ: Export as MDZ"
document.mdz (ZIP archive)
βββ index.md # Updated markdown with relative asset links
βββ manifest.json # Metadata and asset mapping
βββ assets/ # Organized asset files
βββ images/
βββ videos/
βββ audio/
βββ files/
- β Standard ZIP: Can be extracted with any ZIP tool
- β
Relative Links: Uses
./assets/...paths for maximum compatibility - β Smart Asset Handling: Auto-download network images, copy local files
- β UUID Filenames: Network images use UUID names to avoid conflicts
- β Metadata Support: Complete manifest with document and asset information
- β Backward Compatible: Handles legacy files (v1.0.0) seamlessly
See mdz-spec.md for complete format specification and implementation details.
# Build all components
cargo build
# Run tests
cargo test
# Run with verbose output
cargo test -- --nocapture
# Integration tests
cargo test --test integration_testcd mdz-vscode
pnpm install
pnpm run compile
pnpm exec vsce package- Core Code: 1,426 lines (Rust + TypeScript)
- Tests: 491 lines (unit + integration tests)
- Languages: Rust (1k+ lines), TypeScript (448 lines)
- Components: Core library, CLI tool, VS Code extension
Contributions are welcome! Please:
- π Bug Reports: Open issues with detailed description
- π‘ Feature Requests: Suggest improvements with use cases
- π§ Pull Requests: Ensure tests pass and code follows project style
- π Documentation: Help improve docs and examples
git clone https://github.com/wflixu/mdz.git
cd mdz
cargo build
cargo test # Verify everything worksThis project is licensed under the MIT License. See LICENSE for details.
- Built with Rust for performance and safety
- VS Code extension powered by TypeScript
- Inspired by the need for self-contained Markdown document sharing
- Community feedback and contributions for continuous improvement