|
219 | 219 | //! Expressions can be grouped using parentheses. |
220 | 220 | //! The HTML special characters `&`, `<` and `>` will be replaced with their |
221 | 221 | //! character entities unless the `escape` mode is disabled for a template. |
| 222 | +//! |
| 223 | +//! # Optional functionality |
| 224 | +//! |
| 225 | +//! ## Rocket integration |
| 226 | +//! |
| 227 | +//! Enabling the `with-rocket` feature appends an implementation of Rocket's |
| 228 | +//! `Responder` trait for each template type. This makes it easy to trivially |
| 229 | +//! return a value of that type in a Rocket handler. See |
| 230 | +//! [the example](https://github.com/djc/askama/blob/master/testing/tests/rocket.rs) |
| 231 | +//! from the Askama test suite for more on how to integrate. |
| 232 | +//! |
| 233 | +//! In case a run-time error occurs during templating, a `500 Internal Server |
| 234 | +//! Error` `Status` value will be returned, so that this can be further |
| 235 | +//! handled by your error catcher. |
| 236 | +//! |
| 237 | +//! ## Iron integration |
| 238 | +//! |
| 239 | +//! Enabling the `with-iron` feature appends an implementation of Iron's |
| 240 | +//! `Modifier<Response>` trait for each template type. This makes it easy to |
| 241 | +//! trivially return a value of that type in an Iron handler. See |
| 242 | +//! [the example](https://github.com/djc/askama/blob/master/testing/tests/iron.rs) |
| 243 | +//! from the Askama test suite for more on how to integrate. |
| 244 | +//! |
| 245 | +//! Note that Askama's generated `Modifier<Response>` implementation currently |
| 246 | +//! unwraps any run-time errors from the template. If you have a better |
| 247 | +//! suggestion, please [file an issue](https://github.com/djc/askama/issues/new). |
| 248 | +//! |
| 249 | +//! ## The `json` filter |
| 250 | +//! |
| 251 | +//! Enabling the `serde-json` filter will enable the use of the `json` filter. |
| 252 | +//! This will output formatted JSON for any value that implements the required |
| 253 | +//! `Serialize` trait. |
222 | 254 |
|
223 | 255 | #![allow(unused_imports)] |
224 | 256 | #[macro_use] |
|
0 commit comments