Crates.io | mdbook-tera |
lib.rs | mdbook-tera |
version | 0.5.1 |
source | src |
created_at | 2020-02-27 02:19:34.315984 |
updated_at | 2022-07-10 07:22:07.144234 |
description | Tera preprocessor for mdBook |
homepage | https://github.com/avitex/mdbook-tera |
repository | https://github.com/avitex/mdbook-tera |
max_upload_size | |
id | 212932 |
size | 42,058 |
Tera preprocessor for mdBook
API documentation hosted on docs.rs.
$ mdbook-tera --help
mdbook-tera 0.5.1
A mdBook preprocessor that renders Tera
USAGE:
mdbook-tera [OPTIONS] [SUBCOMMAND]
OPTIONS:
-h, --help Print help information
--json <FILE> Sets context from JSON file
--template-include <GLOB> Include tera templates matching a glob expression [default:
**/*.tera]
--template-root <PATH> Root directory to include templates from [default: ./src]
--toml <FILE> Sets context from TOML file
-V, --version Print version information
SUBCOMMANDS:
help Print this message or the help of the given subcommand(s)
supports Check whether a renderer is supported by this preprocessor
First install the tera preprocessor.
cargo install mdbook-tera
Then in your book.toml
file, add the tera preprocessor as below.
# Default options, load a TOML context file from ./src/context.toml
[preprocessor.tera]
[preprocessor.tera]
command = "mdbook-tera --json ./src/context.json"
See example-book
for a basic usage.
Simply define your values in the context.toml
file, and use them in tera statements.
You can access the book context with the key ctx
.
# My Heading
{{ my_value }}