Skip to content

Commit

Permalink
build: fix templating
Browse files Browse the repository at this point in the history
  • Loading branch information
thebaptiste committed Jul 19, 2023
1 parent 5475ef4 commit 4e3399a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .metwork-framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a [jinja2](http://jinja.pocoo.org/) extension to use [humanize](https://

## Syntax

The generic syntax is `{{ 'VALUE'|humanize_{humanize_fn}([humanize_fn_args]) }}`.
The generic syntax is `{% raw %}{{ 'VALUE'|humanize_{humanize_fn}([humanize_fn_args]) }}{% endraw %}`.

Following [humanize](https://python-humanize.readthedocs.io/) functions are currently mapped:

Expand All @@ -25,7 +25,7 @@ have to use:

```
The file size is: {{ 30000000|humanize_naturalsize(binary=False, gnu=True) }}
The file size is: {% raw %}{{ 30000000|humanize_naturalsize(binary=False, gnu=True) }}{% endraw %}
```

Expand All @@ -47,7 +47,7 @@ from jinja2 import Template, Environment
# We load the extension in a jinja2 Environment
env = Environment(extensions=["jinja2_humanize_extension.HumanizeExtension"])

template = env.from_string("The file size is : {{ 30000000|humanize_naturalsize() }}")
template = env.from_string("The file size is : {% raw %}{{ 30000000|humanize_naturalsize() }}{% endraw %}")
result = template.render()

# [...]
Expand Down

0 comments on commit 4e3399a

Please sign in to comment.