aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-03-12 20:53:13 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-03-12 20:53:13 +0100
commit2585a4dae0dc88b9814c0c06c9489e2b86a1aa6d (patch)
treed08d302a3b572a2ceec73442b2011d9546bc969c
parentfe00fabd5c45fae4c6049bc4762d1fae7463a42e (diff)
downloadaskama-2585a4dae0dc88b9814c0c06c9489e2b86a1aa6d.tar.gz
askama-2585a4dae0dc88b9814c0c06c9489e2b86a1aa6d.tar.bz2
askama-2585a4dae0dc88b9814c0c06c9489e2b86a1aa6d.zip
Add some documentation about inheritance pitfalls
-rw-r--r--askama/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/askama/src/lib.rs b/askama/src/lib.rs
index e70194b..9126a99 100644
--- a/askama/src/lib.rs
+++ b/askama/src/lib.rs
@@ -105,6 +105,8 @@
//!
//! The `block` tags define three blocks that can be filled in by child
//! templates. The base template defines a default version of the block.
+//! A base template must define one or more blocks in order to be enable
+//! inheritance.
//!
//! ### Child template
//!
@@ -133,6 +135,11 @@
//! have a field called `_parent` of the type used as the base template
//! context. Blocks can only refer to the context of their own template.
//!
+//! Note that, if the base template lives in another module than the child
+//! template, the child template's module should import all symbols from the
+//! base template's module in order for it to find the trait definition that
+//! supports the inheritance mechanism.
+//!
//! ## HTML escaping
//!
//! Askama does not yet support automatic escaping. Care must be taken to