Added pragmas, template inheritance docs

This commit is contained in:
Adam Fowler
2021-03-25 09:43:01 +00:00
parent b331d4c440
commit 87068659b3
3 changed files with 45 additions and 1 deletions

View File

@@ -20,7 +20,11 @@ Initially the stack will consist of the root context object you want to render.
## Tags
All tags are surrounded by a double curly bracket `{{}}`. When a tag has a reference to a key the associated value will be searched for from the context at the top of the context stack. If the value cannot be found then the next context down will be searched and so on until either a value is found or we have reached the bottom of the stack. If no value is found the output for that value is `nil`.
All tags are surrounded by a double curly bracket `{{}}`. When a tag has a reference to a key, the key will be searched for from the context at the top of the context stack and the associated value will be output. If the key cannot be found then the next context down will be searched and so on until either a key is found or we have reached the bottom of the stack. If no key is found the output for that value is `nil`.
A tag can be used to reference a child value from the associated value of a key by using dot notation in a similar manner to Swift. eg in `{{main.sub}}` the first context is searched for the `main` key. If a value is found, that value is used as a context and the key `sub` is used to search within that context and so on.
If you want to only search for values in the context at the top of the stack then prefix the variable name with a "." eg `{{.key}}`
## Tag types