-
Notifications
You must be signed in to change notification settings - Fork 87
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
Implement 'slice' filter #141
Comments
I can do this. Please feel free to assign. |
Thanks a lot! |
One notice before the implementation. There are two types of lists in the Jinja2C++ engine: which supports indexing and which doesn't (generator-based lists, lists over the forward-only iterators etc.). For lists with indexing available it's possible to use generators to produce slicing. For lists without indexing it's better to make a sliced copy of the original list. |
Implement
slice
filter according the jinja2 documentation:For instance,
slice(3, 0)
applied to the list[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
should give the list of lists of three items each:The text was updated successfully, but these errors were encountered: