-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How to override Jinja2 block_start_string #43
Milestone
Comments
Thanks for the prompt response @kblomqvist and very glad to read its on your plans:) |
Can you point me where in there source could I hard-code this settings? until is done "properly" ? |
elgalu
added a commit
to elgalu/yasha
that referenced
this issue
Apr 5, 2018
A note to myself. Jinja's defaults could be overridden by local keys defined in Yasha's file extensions. # extension.py
BLOCK_START_STRING = '{%'
BLOCK_END_STRING = '%}'
VARIABLE_START_STRING = '{{'
VARIABLE_END_STRING = '}}'
COMMENT_START_STRING = '{#'
COMMENT_END_STRING = '#}'
LINE_STATEMENT_PREFIX = None
LINE_COMMENT_PREFIX = None
TRIM_BLOCKS = False
LSTRIP_BLOCKS = False
NEWLINE_SEQUENCE = '\n'
KEEP_TRAILING_NEWLINE = False |
@elgalu Could you try if https://github.com/kblomqvist/yasha#template-syntax works for you? |
Works!! Thanks |
kblomqvist
added a commit
that referenced
this issue
May 1, 2018
While writing the test I realized that the output would meet with my expectations if --keep-trailing-newline was set by default.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Hi, I'm trying to override certain Jinja2 environment defaults like
block_start_string
:I'm loading that extension file with
yasha -e my_extension.py
however it doesn't take effect as I don't know how to activate thatjinja_env
I'm creating.Thanks for maintaining this project!
The text was updated successfully, but these errors were encountered: