Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Jinja2 filters #10

Open
shawnmjones opened this issue Jul 10, 2019 · 1 comment

Comments

@shawnmjones
Copy link
Collaborator

commented Jul 10, 2019

Raintale templates are based on Jinja2 templates. With the addition of preferences, Raintale templates are no longer Jinja2 compatible, but Jinja2 filters would still be useful to users.

The differences:

  • Preferences instruct Raintale how to generate the value for a variable. Example: choosing the 3rd best sentence from the document.
  • Filters instruct Jinja2 how to alter the value of a variable after creation. Example: converting the text to uppercase.

Raintale should still support Jinja2 filters.

Preferences are handled like so:
{{ variable|prefer key=value,key2=value2 }}

Jinja2 filters could be added to the mix like so:
{{ variable|prefer key=value,key2=value2|filter1|filter2(arg1, arg2)|filter3 }}

@shawnmjones shawnmjones self-assigned this Jul 10, 2019

@shawnmjones

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 12, 2019

This is currently working in the branch at cf19df1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.