You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no idea if this is actually already supported because the docs are very incomplete, but I'm having a frustrating time trying to figure out how to generate a <meter> tag whose list of attributes is generated by embedded D code. (It's not just the values of the attributes that are unknown, but whether or not certain attributes even appear in the tag in the first place. The former is easy; the latter I'm having a really hard time with.) Is this even remotely possible, or do I have to generate the tag from D code and inject it into the output?
I found something about &attributes online in the Jade Template spec, but it seems Diet doesn't support this syntax. If such a thing is not yet supported by Diet, it would be very nice if this feature could be added. Perhaps something along the lines of:
html
body
- auto attrs = [ "min": "0", "max": "100" ];
- if (hasOptimal) attrs["optimal"] = optimalValue;
meter(value=#{value})&attributes(attrs)
Or if this feature already exists in some form, please at least mention it in the docs.
The text was updated successfully, but these errors were encountered:
There is currently just one way implemented to have attributes omitted at runtime, which is having the type of argument given as a string or char array and setting the value to null.
But I didn't know about the &attributes syntax until now, and it unfortunately conflicts with the i18n syntax foo& This is translated text, so something else will have to be used for Diet.
OK, using null strings to suppress attributes should suffice for now. I can work with that.
I'm not too concerned about the exact syntax for transforming an AA into an attribute list, and honestly I think the &attributes syntax is rather ugly. But having some way of doing this would be very nice. Thanks!
P.S. Also, is the null string thing documented anywhere? I don't remember seeing a reference to it. It would be nice to at least mention it somewhere so that people like me can find the information. :)
I have no idea if this is actually already supported because the docs are very incomplete, but I'm having a frustrating time trying to figure out how to generate a
<meter>
tag whose list of attributes is generated by embedded D code. (It's not just the values of the attributes that are unknown, but whether or not certain attributes even appear in the tag in the first place. The former is easy; the latter I'm having a really hard time with.) Is this even remotely possible, or do I have to generate the tag from D code and inject it into the output?I found something about
&attributes
online in the Jade Template spec, but it seems Diet doesn't support this syntax. If such a thing is not yet supported by Diet, it would be very nice if this feature could be added. Perhaps something along the lines of:Or if this feature already exists in some form, please at least mention it in the docs.
The text was updated successfully, but these errors were encountered: