Skip to content

Releases: CompEng0001/mdbook-qr

v1.0.0

15 Jan 08:11

Choose a tag to compare

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 typed Config::get<T>()
  • Updated supports_renderer to 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

15 Nov 09:20

Choose a tag to compare

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

31 Oct 12:59

Choose a tag to compare

Added in v0.1.3

  • Added localhost-qr flag for local mdbook serve builds.
  • QR codes now point to http://127.0.0.1:3000/ when enabled.
  • Auto-creates .gitignore entry 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

29 Oct 07:19

Choose a tag to compare

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.
  • ghpages released

v0.1.1

16 Oct 18:15

Choose a tag to compare

Release 0.1.1

  • Fixed issue with custom.* sub-tables generating QR codes with incomplete definitions.
  • Corrected default file path: src/mdbook_qr_code.png was incorrectly resolved as src/src/mdbook_qr_code.png. It now uses your src_dir as defined in book.toml, resulting in {src_dir}/qr/mdbook_qr_code.png.
  • Custom QR codes now generate when custom.*.marker is defined and placed in a *.md file.
  • If qr-path is not specified, the *.png filename will be derived from custom.*.marker and saved to the default path {src_dir}/qr/{derived_from_marker}.png.
  • html.output.site-url is no longer supported. If qr.url or qr.custom.*.url is not provided, the QR code will be generated using the CI environment variable GITHUB_REPOSITORY.
  • Documentation has been updated to reflect these changes

v0.1.0

14 Oct 11:35

Choose a tag to compare

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.
  • Configurable Appearance

    • Supports [preprocessor.qr] configuration in book.toml.
    • Adjustable:
      • margin
      • fit.width / fit.height
      • background and module colors (#RRGGBBAA or RGBA arrays)
      • Module shapes (square, circle, diamond, etc.)
  • 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
  • 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.

Technical Highlights

  • Built with Rust and designed for mdBook 0.4+
  • Fully documented modules:
    • config – configuration and inheritance
    • html – marker injection
    • preprocessor – mdBook interface
    • util – helper functions
  • Tested on Rust 1.70+

Installation

cargo install mdbook-qr

Then add to your book.toml:

[preprocessor.qr]
enable = true
url = "https://example.com"

Author

CompEng0001