-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Allow to have named arguments in macro #885
Comments
I worry that this would be a little foreign to users -- that is, I'm not sure it passes the design test of "it should be obvious how this gets compiled to Rust code". |
Does it really matter? If this is a big enough concern, we can add a new entry in the askama book explaining how it is generated. |
It matters to me -- I think an important design aspect of the templating language for Askama is that people can reason about how their template code gets translated into Rust code. Why don't you write the paragraph that explains this first and we can see how that looks? |
Sure. I'll do that (hopefully) soon. |
So now that #893 is merged, let's come back to this. 😆 So I had in mind to keep a Does this sound like an acceptable approach? |
It'd pretty nice to be able to have named arguments. For example:
Then to be able to call it like this:
It makes the code much better when reading it.
As a first step, only allowing it for macros would be nice, but potentially extending it to filters would be nice too.
The text was updated successfully, but these errors were encountered: