Searching the archives I don’t find anything about using a variable as the html data-attribute itself (not as its value), i.e <div data-HERE >hey</div>
The only way I succeed is by using a macro for text substitution like so
\define mymacro(foo) <div data-$(foo)$="true" >MY DIV</div>
<<mymacro bar>>
but this is not optimal because the div is actually already inside a procedure among other html stuff (see illustration here below) and it would make the code harder to read if I had to externalize my div:
\procedure myproc(foo)
<div>something</div>
<div data-<<foo>>=true >MY DIV</div>
<div>something</div>
\end
<<myproc bar>>
Is there a syntax that can work directly in the procedure? I’ve tried everything I can come up with. The forum has questions about variables as the attribute values, or as attributes in a wikitext widget, but I can’t find any where the question is “variable as a html attribute”.
Thank you!