#mdbook #variables #env-var #markdown

bin+lib mdbook-variables

mdBook proprocessor for risolve variables configured from book.toml

6 releases

0.2.4 Oct 30, 2023
0.2.3 Aug 5, 2023
0.2.2 Feb 18, 2023
0.2.0 Sep 15, 2021
0.1.0 Mar 3, 2020

#573 in Text processing

Download history 218/week @ 2024-11-21 208/week @ 2024-11-28 232/week @ 2024-12-05 230/week @ 2024-12-12 139/week @ 2024-12-19 74/week @ 2024-12-26 239/week @ 2025-01-02 285/week @ 2025-01-09 281/week @ 2025-01-16 229/week @ 2025-01-23 272/week @ 2025-01-30 236/week @ 2025-02-06 212/week @ 2025-02-13 214/week @ 2025-02-20 200/week @ 2025-02-27 201/week @ 2025-03-06

860 downloads per month

MPL-2.0 license

24KB
238 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.

Dependencies

~13–24MB
~372K SLoC