diff --git a/guide/leaf.md b/guide/leaf.md index b70bbd9c..720622c7 100644 --- a/guide/leaf.md +++ b/guide/leaf.md @@ -105,6 +105,52 @@ The double token, `##` indicates a chain. If the previous tag fails, this tag wi } ``` +#### Extending + +```swift +/// base.leaf + +#import("html") + +/// html.leaf +#extend("base") + +#export("html") { + +} +``` + +Leaf renders this as: + +```html + + +``` + +#### Embedding + +```swift +/// base.leaf + +#import("html") + +/// html.leaf +#extend("base") + +#export("html") { + #embed("body") +} + +/// body.leaf + +``` +Leaf renders this as: + +```html + + +``` + ### Custom Tags Look at the existing tags for advanced scenarios, let's look at a basic example by creating `Index` together. This tag will take two arguments, an array, and an index to access.