-
Notifications
You must be signed in to change notification settings - Fork 115
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
Feature Request: support {{if !myvariable}} #899
Comments
Yes, there's a few issues open with this, for now indeed you have to go with your own custom stuff (eg defining your own One reason behind this is that it quickly blows up to providing a full coding environment in moustaches which I think is undesirable (expands the surface a lot). In the wraps there's an option to pass a Julia code string that gets evaluated, in fact you could also do that now with |
thank you for your explanation. understood. I would say that for my case the In case you consider adding |
the thought is to add this kind of stuff:
with the following intent: the So this would be equivalent to the following (here in a
you could pass that to |
thank you. If you would allow for such a It should be the same amount of security and way more intuitive to use. |
It's not a question of security, it's a question of parsing. There needs to be a way for Franklin to know where are the boundaries of the function. And there needs to be a distinction with |
the distinction could be
versus
however I think I now understand what you mean, because currently Franklin actually has a different semantics
does not mean inserting the value of x, but passing
in the context here |
@schlichtanders I've now implemented this in Xranklin (the in-dev next version) and it looks like this: same as before:
new:
so basically the new stuff are these "e-string" where you can specify some Julia logic and indicate what variables to get from the local environment using a Any feedback on this? |
@tlienart thank you for pinging - awesome to see that this is coming soon. one feedback immediately popping into my mind: Not everything is nicely representable as a string.
|
Yes I agree & this is actually just a matter of where things are interpreted; what actually gets passed is an array of string one of which is an "e-string", the hfun then does what it wants with it but most likely will just evaluate it and there it will be whatever value structure or whatever. So I misrepresented this in my previous comment, it will in fact be similar to what you described Thanks for the feedback! |
I'm sorry if this is a dumb question. What if instead of e-string, we define <!-- with bool variables -->
{{ if my_boolean_var }}
<p>...</p>
{{ end }}
<!-- without arguments -->
{{ if my_condition() }}
<p>...</p>
{{ end }}
<!-- with arguments -->
{{ if my_condition(arg) }}
<p>...</p>
{{ end }} |
it would be nice to have a simple way to negate an if statement.
Currently you have to write
It would be nice to just write
My current Franklin.jl just stops working as soon as I try this
using Franklin v0.10.59 and Julia 1.6.1
The text was updated successfully, but these errors were encountered: