diff options
author | Tom Milligan <tom.milligan@uipath.com> | 2023-04-02 09:59:27 +0100 |
---|---|---|
committer | Tom Milligan <tommilligan@users.noreply.github.com> | 2023-04-03 11:52:05 +0100 |
commit | 55a654dfcabe44ab8a9b416861aa474791b6bff3 (patch) | |
tree | 694e5322bb9a94c1163ed91ab7415bf7c6c9824b | |
parent | a2f664cac347fe7ec1d345f9e315f578a42fced7 (diff) |
doc: option for processing included files
-rw-r--r-- | README.md | 11 | ||||
-rw-r--r-- | integration/book.toml | 1 | ||||
-rw-r--r-- | integration/expected/book.toml | 1 | ||||
-rw-r--r-- | integration/expected/chapter_1_main.html | 9 | ||||
-rw-r--r-- | integration/src/chapter_1.md | 2 | ||||
-rw-r--r-- | integration/src/common_warning.md | 3 |
6 files changed, 27 insertions, 0 deletions
@@ -136,6 +136,17 @@ on_failure = "bail" This may be useful for non-interative workflows. +### Process included files + +You can ensure that content inlined with `{{#include}}` is also processed by [setting the `after` option](https://rust-lang.github.io/mdBook/format/configuration/preprocessors.html#require-a-certain-order): + +```toml +[preprocessor.admonish] +after = ["links"] +``` + +This will expand `include` directives, before expanding `admonish` blocks. + ### Semantic Versioning Guarantees provided are as follows: diff --git a/integration/book.toml b/integration/book.toml index d0165d1..7abcfdb 100644 --- a/integration/book.toml +++ b/integration/book.toml @@ -10,6 +10,7 @@ title = "mdbook-admonish-integration" [preprocessor.admonish] command = "mdbook-admonish" assets_version = "2.0.0" # do not edit: managed by `mdbook-admonish install` +after = ["links"] [output] diff --git a/integration/expected/book.toml b/integration/expected/book.toml index d0165d1..7abcfdb 100644 --- a/integration/expected/book.toml +++ b/integration/expected/book.toml @@ -10,6 +10,7 @@ title = "mdbook-admonish-integration" [preprocessor.admonish] command = "mdbook-admonish" assets_version = "2.0.0" # do not edit: managed by `mdbook-admonish install` +after = ["links"] [output] diff --git a/integration/expected/chapter_1_main.html b/integration/expected/chapter_1_main.html index a4030da..0e25358 100644 --- a/integration/expected/chapter_1_main.html +++ b/integration/expected/chapter_1_main.html @@ -53,4 +53,13 @@ No title, only body <p>Hidden on load</p> </div> </details> +<div id="admonition-warning" class="admonition warning"> +<div class="admonition-title"> +<p>Warning</p> +<p><a class="admonition-anchor-link" href="#admonition-warning"></a></p> +</div> +<div> +<p>This is a commonly shared warning!</p> +</div> +</div> diff --git a/integration/src/chapter_1.md b/integration/src/chapter_1.md index 9b574c4..cfbc723 100644 --- a/integration/src/chapter_1.md +++ b/integration/src/chapter_1.md @@ -21,3 +21,5 @@ No title, only body ```admonish collapsible=true Hidden on load ``` + +{{#include common_warning.md}} diff --git a/integration/src/common_warning.md b/integration/src/common_warning.md new file mode 100644 index 0000000..e960e59 --- /dev/null +++ b/integration/src/common_warning.md @@ -0,0 +1,3 @@ +```admonish warning +This is a commonly shared warning! +``` |