From 1f2dc3ad0cd64625f8b4c3dde6cab6c73fb73e15 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Wed, 3 Feb 2016 17:10:12 -0500 Subject: [PATCH] docs: layouts are multi-generational --- docs/layouts.rst | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/layouts.rst b/docs/layouts.rst index bd006b1f..c93c51cb 100644 --- a/docs/layouts.rst +++ b/docs/layouts.rst @@ -140,8 +140,22 @@ From a design point of view, you can also extract out a base design and have you Those fluent in Yaml may notice that ``extends`` key is similar to Yaml's `merge keys `_. Technically, you can use these together - but I just recommend sticking with ``extends`` since it does what merge keys do *and more*. If you do choose to use both ``extends`` and Yaml merge keys, the Yaml merge keys are processed first (upon Yaml parsing), then ``extends`` (after parsing). -Yes, ``extends`` Supports Multiple Inheritance ----------------------------------------------- +Yes, ``extends`` is Multi-Generational +-------------------------------------- + +As you might expect, ``extends`` can be composed multiple times:: + + socrates: + x: 100 + plato: + extends: socrates + x: += 10 # evaluates to 150 + aristotle: + extends: plato + x: += 20 # evaluates to 150 + +Yes, ``extends`` has Multiple Inheritance +----------------------------------------- If you want to extend multiple parents, it looks like this::