Releases: CompEng0001/mdbook-qr
v1.0.0
Full Changelog: v0.1.3...v1.0.0
This release migrates the preprocessor from the legacy mdBook 0.4 API to the mdBook 0.5 preprocessor architecture. It marks a breaking compatibility boundary and establishes a stable baseline for future development.
Breaking changes
-
Requires mdBook ≥ 0.5
-
Drops compatibility with mdBook 0.4.x
-
Binary must be built against
mdbook-preprocessor 0.5.x
What’s new / changed
-
Migrated from mdbook crate APIs to mdbook-preprocessor
-
Updated Book traversal:
Book.sections->Book::iter()/for_each_chapter_mut
-
Updated configuration handling:
- Replaced
get_preprocessor()with typedConfig::get<T>()
- Replaced
-
Updated
supports_rendererto match mdBook 0.5 contract -
Improved mdBook version compatibility checks using semantic versioning
-
No changes required to existing
[preprocessor.qr]configuration syntax
v0.1.4
Added in V0.1.4
-
Fix issue where UTF-8 char boundaries not interpreted correctly (f8f87d5)
- Replaced byte-wise iteration with UTF-8–safe char iteration to prevent
- panics when encountering multi-byte characters (e.g. ‘•’) in HTML
-
More adherence to rust formatting
-
mdbook example now uses
localhost-qr
Full Changelog: v0.1.3...v0.1.4
v0.1.3
Added in v0.1.3
- Added
localhost-qrflag for localmdbook servebuilds. - QR codes now point to
http://127.0.0.1:3000/when enabled. - Auto-creates
.gitignoreentry for{book.src}/mdbook_qr/qr_localhost.png(or matching{book.src}). - Fixed image path always written to
{book.src}/mdbook_qr/qr_localhost.png.
v0.1.2
Release v0.1.2
- Fixed how marker is replaced with html whilst in a a fence block
- when included in a admonish fence block the QR code is generated and rendered.
~~~admonish {{QR_CODE}} ~~~ - Other fence blocks are ignored.
- when included in a admonish fence block the QR code is generated and rendered.
- ghpages released
v0.1.1
Release 0.1.1
- Fixed issue with
custom.*sub-tables generating QR codes with incomplete definitions. - Corrected default file path:
src/mdbook_qr_code.pngwas incorrectly resolved assrc/src/mdbook_qr_code.png. It now uses yoursrc_diras defined inbook.toml, resulting in{src_dir}/qr/mdbook_qr_code.png. - Custom QR codes now generate when
custom.*.markeris defined and placed in a*.mdfile. - If
qr-pathis not specified, the*.pngfilename will be derived fromcustom.*.markerand saved to the default path{src_dir}/qr/{derived_from_marker}.png. html.output.site-urlis no longer supported. Ifqr.urlorqr.custom.*.urlis not provided, the QR code will be generated using the CI environment variableGITHUB_REPOSITORY.- Documentation has been updated to reflect these changes
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"