#mdbook #variables #markdown

bin+lib mdbook-variables

mdBook proprocessor for risolve variables configured from book.toml

9 unstable releases (3 breaking)

new 0.4.1 Jan 21, 2026
0.4.0 Nov 27, 2025
0.3.0 Sep 13, 2025
0.2.4 Oct 30, 2023
0.1.0 Mar 3, 2020

#578 in Text processing

Download history 522/week @ 2025-10-01 371/week @ 2025-10-08 397/week @ 2025-10-15 371/week @ 2025-10-22 177/week @ 2025-10-29 156/week @ 2025-11-05 93/week @ 2025-11-12 44/week @ 2025-11-19 79/week @ 2025-11-26 70/week @ 2025-12-03 135/week @ 2025-12-10 108/week @ 2025-12-17 17/week @ 2025-12-31 69/week @ 2026-01-07 92/week @ 2026-01-14

195 downloads per month

MPL-2.0 license

14KB
281 lines

MdBook Variables preprocessor

A simple preprocessor for mdbook, that look for variable in double brackets and replace with some value that come from the book.toml

Example

SimpleFile.md:

## something

a contentent with a variable {{name}} 

book.toml

#... all the basic detail first and then:

[preprocessor.variables.variables]
name= "my wonderful name"

It does support looking for variable values in the environment variables behind a flag

Toml configured variable right now take precedence on environment variables.


[preprocessor.variables]
use_env = true

[preprocessor.variables.variables]
other_variabled_not_in_env= "value"

The implementation got a lot of inspiration and code from the mdbook links preprocessor an mdbook-plantuml.

Support

If you enjoy the use of this, feel free to support the it on Liberapay

Dependencies

~9–13MB
~158K SLoC