中文版本 | English
MDZ (Markdown Zipped) is a self-contained document packaging format that solves the resource management problem of Markdown documents. It packages Markdown content, images, and styles into a single file while maintaining full compatibility with standard Markdown syntax.
- Self-contained: All resources in a single file
- Markdown compatible: Fully compatible with standard Markdown syntax
- Minimal complexity: Only three core components (main.md, img/, css/)
- Automation-first: Automatic resource loading with minimal manual configuration
- Open standard: Based on open ZIP and Markdown standards
MDZ/
├── mdz-core/ # Core parsing and rendering
├── mdz-cli/ # Command-line tool
│ ├── src/ # CLI source code
│ ├── Cargo.toml # CLI dependencies
│ └── README.md # CLI documentation
├── MDZ_SPEC.md # Format specification v1.0
├── Cargo.toml # Workspace configuration
└── README.md # This file
# Clone the repository
git clone https://github.com/mdz-format/mdz.git
cd mdz
# Install from source
cargo install --path mdz-cli
# Or build for local use
cargo build --release
# Binary at: ./target/release/mdz-cli
# Create from a directory containing main.md, img/, and css/
mdz create document.mdz --from ./my-document
# Extract MDZ file
mdz extract document.mdz --to ./extracted
# Validate MDZ format
mdz validate document.mdz --detailed
# Preview in browser
mdz preview document.mdz --browser
# Preview with HTML output
mdz preview document.mdz --output document.html
example.mdz (ZIP file)
├── main.md # Main Markdown content (required)
├── img/ # Image resources (optional)
│ ├── photo.jpg
│ └── diagram.png
└── css/ # Style resources (optional)
└── style.css # Auto-loaded main stylesheet
- ✅ ZIP file parsing and validation
- ✅ Markdown parsing with pulldown-cmark
- ✅ HTML rendering with embedded resources
- ✅ Automatic CSS loading
- ✅ Image resource handling (base64 embedding)
- ✅ Comprehensive format validation
- ✅ Error handling and reporting
- ✅ Create MDZ files from directories
- ✅ Extract MDZ files to directories
- ✅ Validate MDZ format compliance
- ✅ Generate HTML previews with embedded resources
- ✅ Cross-platform browser opening
- ✅ Colorized output and progress reporting
- ✅ Verbose mode and detailed error messages
- Headers, paragraphs, emphasis
- Lists (ordered, unordered, task lists)
- Code blocks with syntax highlighting
- Tables and blockquotes
- Links and images
- HTML inline elements
- JPEG, PNG, GIF, SVG, WebP
- Automatic base64 embedding in HTML output
- Subdirectory organization support
- Automatic
css/style.css
loading - Custom CSS override options
- Responsive design support
- Print-friendly styles
# Build all packages
cargo build
# Build in release mode
cargo build --release
# Build specific package
cargo build -p mdz-core
cargo build -p mdz-cli
# Create test MDZ file
./target/release/mdz-cli create test.mdz --from test-document --verbose
# Validate it
./target/release/mdz-cli validate test.mdz --detailed
# Preview in browser
./target/release/mdz-cli preview test.mdz --browser
- Format Specification - Complete MDZ format specification v1.0
- Core Library API - mdz-core library documentation
- CLI Tool Guide - mdz-cli command-line tool guide
- Supports files up to 100MB
- Fast parsing and rendering (< 2 seconds for 100MB files)
- Memory efficient with streaming processing
- Optimized for development and production use
- ZIP bomb protection
- Path traversal attack prevention
- File size limits
- XSS protection in HTML rendering
- Rust: 1.70+
- Platforms: macOS, Linux, Windows
- Format: MDZ Specification v1.0
- Standards: ZIP, Markdown, HTML5, CSS3
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
Current Version: 0.1.0
Status: Production Ready ✅
Last Updated: 2025-07-21