-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
[Question] Changing delimiters? #121
Comments
It is possible, but it has not been implemented. Since a few releases there is a per-crate configuration file that we could stick the configuration in, but wiring that up to the parser would need some work. Would you be interested in working on that? If not, maybe @botika would like to help? |
Nice to help! You can assign it to me now. |
I can't assign it to you, but feel free to take it. 👍 The trick here will be to figure out how to parametrize the parser's input type with the configuration. |
I've seen it xD, anything that I do not see clearly I mention it for gitter. |
Your work so far is great, I have confidence you can figure out most of it! Much appreciated. |
This has been implemented, thanks to @botika for getting it done! |
This looks great, thanks for considering this feature addition. I'm excited to try it out in one of my projects. |
I'm getting the following error when trying to set a custom syntax:
My
I'm left a little confused since the error suggests a character must be shared, which in my case is Update: Nevermind, I found my issue in the docs:
As error message mentioning the start or ending with the same character would be helpful in that it is more specific than just sharing a character. Thanks again for implementing this. |
Given multiple custom syntaxes like in the docs examples:
Is there an example or documentation of how to use different syntax for different template files? Update: And once again, I should just read the docs more carefully:
Looks like I have everything I need. Thanks! |
@lukehsiao glad you managed to figure things out! I'll see if we can improve the error message. |
With the template delimiters as
{{
}}
{%
, etc., is there a way to use askama in content that heavily uses these curly braces and%
? For example, if I wanted to use askama to template a LaTeX section like this:Trying to template
name.last
I would assume that this would fail due to the conflicting use of
{}
and%
.Using jinja's options in Python, I am able to switch delimiters:
which allows me to make a template that looks like the following and parses correctly:
Is similar functionality possible in askama, or am I stuck? Is it impossible to use askama in templates that already use curly braces and percentage signs?
The text was updated successfully, but these errors were encountered: