From cb5a37dabf9d3abb5b32d24d7da148d9988231b0 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 7 Mar 2023 12:18:22 +0100 Subject: Add documentation for whitespace argument in template derive proc-macro --- book/src/configuration.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'book/src/configuration.md') 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: -- cgit