#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

#434 in Text processing

Download history 32/week @ 2024-07-20 67/week @ 2024-07-27 36/week @ 2024-08-03 39/week @ 2024-08-10 51/week @ 2024-08-17 36/week @ 2024-08-24 54/week @ 2024-08-31 93/week @ 2024-09-07 59/week @ 2024-09-14 92/week @ 2024-09-21 44/week @ 2024-09-28 80/week @ 2024-10-05 117/week @ 2024-10-12 219/week @ 2024-10-19 209/week @ 2024-10-26 229/week @ 2024-11-02

794 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

~11–22MB
~327K SLoC