From e1af30fad78b2740312d631b0d4a701e30d915df Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Fri, 3 Jan 2025 21:54:17 +0200 Subject: Implement `InnerPartial` and `OuterPartial` parsers. --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'README.md') 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

``` -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

``` +Modifiers can also take arguments which are passed within +parentheses `(` and `)`, and can be either `int`, `float`, `str` or `bool`. For example: + +```html +

+``` + ### `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**) -- cgit v1.2.3