-
Notifications
You must be signed in to change notification settings - Fork 15
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
piping inside javascript expressions #87
Comments
As far as I can tell this is the way Vento is designed - expressions are JavaScript only, pipes are a separate Vento concept that only works in specific tags in specific ways. I'll give a quick example anyways: https://livecodes.io/?x=id/x2dgdsr593y
This code runs and results in Replacing the https://livecodes.io/?x=id/p7yyyzwhzdv
Results in different output (on the playground just the raw input text is shown, so I assume an error is occuring). |
Related: the following works: {{ set c = post.data.description |> renderMd }}
{{ Card({
class: "p-summary",
content: c
}) }} The following does not {{ Card({
class: "p-summary",
content: post.data.description |> renderMd
}) }} |
One other: parens break it: We've skimmed the code and believe this issue is a bug report, but are not sure where yet. |
Vento pipes must be always at the end of the tag. Maybe, when pipes are implemented natively in JavaScript, this feature can be removed from Vento. Currently, the And pipes in the |
So I suppose that's why the card example doesn't work as well? Is there any way it could be supported anywhere? I’m especially interested in support for
Yes, this would be nice. I assume the implementation is just adding a
Maybe, I was having issues with it, maybe related to the first issue, the at the end part. A couple other things:
|
It's hard because it requires to transpile the javascript code (currently, Vento only takes the js code and run it as is). Filters are stored in the
Yes, take a look to how is implemented in
It's not possible because tags apply the filters differently. For example
Yes, as said in the first comment, you can run |
I'll do both of these in a couple days if you don't 10x dev me first! First just need to wrap up this monster: |
Great! |
Hi, first I wanted to apologise for the flurry of issues, both me and @uncenter are converting large sites to vento out of similar frustrations with nunjucks to you
this issue regards some unintuitive behaviour. As far as we can tell, "javascript-like" expressions like
if
andfor
break the pipe syntaxgroupby
is a filter, but it is inaccessible here because of the precedingfor
clause, where groupby is defined as a filter. I hope the code above demonstrates an intuitive usecase for supporting this behaviour.The text was updated successfully, but these errors were encountered: