From 41d372de260d0562716fb9fc7ae6021c6e612fa8 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Sun, 6 May 2018 23:48:11 +0800 Subject: [PATCH] Update documentation for preprocessor (#686) --- book-example/src/format/config.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/book-example/src/format/config.md b/book-example/src/format/config.md index 899caaae..96da0e74 100644 --- a/book-example/src/format/config.md +++ b/book-example/src/format/config.md @@ -58,12 +58,21 @@ This controls the build process of your book. will be created when the book is built (i.e. `create-missing = true`). If this is `false` then the build process will instead exit with an error if any files do not exist. +- **preprocess:** Specify which preprocessors to be applied. Default is `["links", "index"]`. To disable default preprocessors, pass an empty array `[]` in. + + +The following preprocessors are available and included by default: + +- `links`: Expand the `{{# playpen}}` and `{{# include}}` handlebars helpers in a chapter. +- `index`: Convert all chapter files named `README.md` into `index.md`. That is to say, all `README.md` would be rendered to an index file `index.html` in the rendered book. + **book.toml** ```toml [build] build-dir = "build" create-missing = false +preprocess = ["links", "index"] ``` ### HTML renderer options @@ -132,6 +141,11 @@ title = "Example book" authors = ["John Doe", "Jane Doe"] description = "The example book covers examples." +[build] +build-dir = "book" +create-missing = true +preprocess = ["links", "index"] + [output.html] theme = "my-theme" curly-quotes = true