summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2025-01-03 21:54:17 +0200
committerAsko Nõmm <asko@nmm.ee>2025-01-03 21:54:17 +0200
commite1af30fad78b2740312d631b0d4a701e30d915df (patch)
tree4e1d531f70b2818f43ff07f39a96aa4d868e09fd /README.md
parent61c0b0d134d05c1647fa3356486d209bac87d8f6 (diff)
Implement `InnerPartial` and `OuterPartial` parsers.
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 11 insertions, 5 deletions
diff --git a/README.md b/README.md
index 7578e80..d002ea2 100644
--- a/README.md
+++ b/README.md
@@ -266,19 +266,25 @@ If the `slug` key is `hello-world`.
## Modifiers
-All interpolated values in expressions can be modified using modifiers. Modifiers are applied to the value of the attribute, and they can be chained, like so:
+All interpolated expressions can be modified using modifiers. Modifiers are applied to the value of the attribute, and they can be chained, like so:
```html
<h1 inner-text="{title | Uppercase | Reverse}"></h1>
```
-Note that if you have nothing other than the interpolated variable in the attribute, then you can omit the curly brackets, and so
-this would also work:
+Note that if you have nothing other than the interpolated variable in the attribute, then you can omit the curly brackets, and so this would also work:
```html
<h1 inner-text="title | Uppercase | Reverse"></h1>
```
+Modifiers can also take arguments which are passed within
+parentheses `(` and `)`, and can be either `int`, `float`, `str` or `bool`. For example:
+
+```html
+<h1 inner-text="some_var | SomeModifier(123, 'asd', true)"></h1>
+```
+
### `date`
Parses the value into a formatted date string.
@@ -342,10 +348,10 @@ HTMTL is built upon the [Dompa](https://github.com/askonomm/dompa) HTML parser,
- `htmtl.parsers.GenericValue` - Parser the `:*` attributes.
- `htmtl.parsers.If` - Parser the `if` attributes. (**soon**)
- `htmtl.parsers.Unless` - Parser the `unless` attributes. (**soon**)
-- `htmtl.parsers.InnerPartial` - Parser the `inner-partial` attributes. (**soon**)
+- `htmtl.parsers.InnerPartial` - Parser the `inner-partial` attributes.
- `htmtl.parsers.InnerHtml` - Parser the `inner-html` attributes.
- `htmtl.parsers.InnerText` - Parser the `inner-text` attributes.
-- `htmtl.parsers.OuterPartial` - Parser the `outer-partial` attributes. (**soon**)
+- `htmtl.parsers.OuterPartial` - Parser the `outer-partial` attributes.
- `htmtl.parsers.OuterHtml` - Parser the `outer-html` attributes.
- `htmtl.parsers.OuterText` - Parser the `outer-text` attributes.
- `htmtl.parsers.Foreach` - Parses the `foreach` attributes. (**soon**)