diff options
author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-03-07 12:18:22 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-03-13 14:41:05 +0100 |
commit | cb5a37dabf9d3abb5b32d24d7da148d9988231b0 (patch) | |
tree | 47ca50b058f3ede7ce66d8be61d3f7ed8ae0dc42 /book/src | |
parent | 40be079d5d0ea988303cd70034d11c92fbb8fa39 (diff) | |
download | askama-cb5a37dabf9d3abb5b32d24d7da148d9988231b0.tar.gz askama-cb5a37dabf9d3abb5b32d24d7da148d9988231b0.tar.bz2 askama-cb5a37dabf9d3abb5b32d24d7da148d9988231b0.zip |
Add documentation for whitespace argument in template derive proc-macro
Diffstat (limited to '')
-rw-r--r-- | book/src/configuration.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/book/src/configuration.md b/book/src/configuration.md index 6e8d581..2311e7d 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -57,6 +57,20 @@ character remaining will be a newline. If you want this to be the default behaviour, you can set `whitespace` to `"minimize"`. +To be noted: you can also configure `whitespace` directly into the `template` +derive proc macro: + +```rust +#[derive(Template)] +#[template(whitespace = "suppress")] +pub struct SomeTemplate; +``` + +If you configure `whitespace` directly into the `template` derive proc-macro, +it will take precedence over the one in your configuration file. So in this +case, if you already set `whitespace = "minimize` into your configuration file, +it will be replaced by `suppress` for this template. + ## Custom syntaxes Here is an example that defines two custom syntaxes: |