v0.1.0
Release 0.1.0 — Initial Public Release
This is the first stable release of mdbook-qr, a preprocessor plugin for mdBook that automatically generates and embeds QR codes in your documentation.
Features
-
Automatic QR Code Generation
- Creates PNG QR codes using
fast-qr. - Inserts an
<img>tag wherever{{QR_CODE}}appears in a chapter.
- Creates PNG QR codes using
-
Configurable Appearance
- Supports
[preprocessor.qr]configuration inbook.toml. - Adjustable:
marginfit.width/fit.heightbackgroundandmodulecolors (#RRGGBBAAor RGBA arrays)- Module shapes (
square,circle,diamond, etc.)
- Supports
-
Custom QR Profiles
- Define additional markers under
[preprocessor.qr.custom.*]. - Each inherits defaults from
[preprocessor.qr]unless overridden. - Example:
[preprocessor.qr.custom.footer] marker = "{{QR_FOOTER}}" url = "https://github.com/CompEng0001" fit.width = 128 shape.diamond = true
- Define additional markers under
-
Intelligent Path Handling
- Resolves output image paths relative to each chapter.
- Normalises Windows/Unix paths for valid HTML output.
-
Warnings & Validation
- Detects:
- Missing markers or URLs
- Duplicate markers
- Image-path collisions
- Fails gracefully without breaking the build.
- Detects:
Technical Highlights
- Built with Rust and designed for mdBook 0.4+
- Fully documented modules:
config– configuration and inheritancehtml– marker injectionpreprocessor– mdBook interfaceutil– helper functions
- Tested on Rust 1.70+
Installation
cargo install mdbook-qrThen add to your book.toml:
[preprocessor.qr]
enable = true
url = "https://example.com"