Skip to content

Variable formatting functions #23

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Satyam
Copy link

@Satyam Satyam commented Oct 17, 2023

Provides an option to add formatters to value outputs.

It doesn't really make sense to pre-process the values with its formatted version just before the template. That would require to make a full copy of an entire table, with the memory and processing resources it takes, when it can really be processed on-the fly while it is being interpolated into the template.

It also allows for some fancy processing as shown in the last test in the test suite below where the render function itself is the formatter, allowing for the recursive processing of a tree-like data structure of an indeterminate depth.

Fixes jasonmoo#7
Any value tag can be followed by the name of one or several functions to
process the raw value into a form suitable for display.
Contains source, modified Readme and test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant