From cf8dcc15e408297e8db8a4901aa496f06d27a227 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 11 Apr 2022 21:00:32 +0200 Subject: [PATCH] Add documentation for "config" parameter --- book/src/creating_templates.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/book/src/creating_templates.md b/book/src/creating_templates.md index 406a8255d..e087ede5c 100644 --- a/book/src/creating_templates.md +++ b/book/src/creating_templates.md @@ -84,10 +84,17 @@ recognized: struct HelloTemplate<'a> { ... } ``` * `syntax` (as `syntax = "foo"`): set the syntax name for a parser defined - in the configuration file. The default syntax , "default", is the one + in the configuration file. The default syntax , "default", is the one provided by Askama. ```rust #[derive(Template)] #[template(path = "hello.html", syntax = "foo")] struct HelloTemplate<'a> { ... } - ``` \ No newline at end of file + ``` +* `config` (as `config = "config_file_path"`): set the path for the config file + to be used. The path is interpreted as relative to your crate root. + ```rust + #[derive(Template)] + #[template(path = "hello.html", config = "config.toml")] + struct HelloTemplate<'a> { ... } + ```