mdbook_header_footer

Crates.iomdbook_header_footer
lib.rsmdbook_header_footer
version
sourcesrc
created_at2024-09-13 07:45:42.851035
updated_at2024-12-07 00:13:30.363589
descriptionmdBook preprocessor to prepend header and append footer to certain chapters
homepage
repositoryhttps://github.com/SichangHe/mdbook_header_footer
max_upload_size
id1373457
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Steven Hé (Sīchàng) (SichangHe)

documentation

README

mdBook-Header-Footer

This mdBook preprocessor prepends headers and appends footers to all chapters in the book whose URL path match the corresponding regex. The headers and footers are two lists of object with the regex and padding string fields, where regex specifies what Regex the URL path needs to match and padding specifies what to pad. regex is optional, if not specified, it will match all paths (.*).

For example, if you add the following to your book.toml:

[preprocessor.header-footer]
headers = [{ regex = "^notes/", padding = "Notes\n" }]
footers = [{ padding = "\nHaha" }]

Then, all chapters whose URL path starts with notes/ will have Notes plus a newline prepended to the top of the chapter; all chapters will have a newline plus Haha appended to the bottom of the chapter.

Installation

cargo install mdbook_header_footer

Debugging

We use tracing-subscriber with the env-filter feature to emit logs. Please configure the log level by setting the RUST_LOG environment variable.

Commit count: 11

cargo fmt