Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Last updated: Thursday 15 January 2026 @ 07:46:58

Welcome to mdbook-qr

Crates.io version Downloads Docs.rs CI status

An mdBook preprocessor that generates and embeds a QR code for your book, powered by fast-qr.

It produces a PNG image during the build and replaces {{QR_CODE}} markers in chapters with an <img> tag pointing to the generated QR code.


Compatibility

mdbook-qr versionmdbook versionsNotes
v1.*.*v0.5.*Requires API changes introduced in mdbook 0.5.*
v0.*.*v0.4.*Not compatible with 0.5.*+

For all options see Documentation chapter.

Live Configuration Example

As seen from this page the current preprocessor configuration is:

[preprocessor.qr]
enable = true
qr-path = "figures/mdbook-qr-code.png"
margin = 1
shape.rectangle = true
background = "#FFFFFFFF"
module =  "#000000FF"

Then, in any Markdown file:

{{QR_CODE}}

During the build, this is replaced with:

 <img src="./figures/mdbook-qr-code.png?" alt="QR code" style="height:200px;width:200px" loading="eager">

…and rendered as:

QR code