I like to store the output of a procedure or a macro into a variable. The purpose here is to use the contrastcolour macro.
\procedure foregroundColor()
<$transclude $variable="contrastcolour"
target=<<colour>> fallbackTarget=<<fallbackTarget>>
colourA=<<colourA>> colourB=<<colourB>> />
\end foregroundColor
\procedure tag-pill-style(colour)
<$let
backgroundColor=<<colour>>
fallbackTarget={{$palette$##tag-background}}
colourA={{$palette$##foreground}}
colourB={{$palette$##background}}
>
background-color:<<backgroundColor>>;
fill:rgb(<<foregroundColor>>);
color:rgb(<<foregroundColor>>);
</$let>
\end tag-pill-style
Example
<$wikify name=nstyle text="""<<tag-pill-style black>>""" >
<div style=<<nstyle>> >
Hello My New Style
</div>
</$wikify>
This produces:
How can I remove $wikify and store the results in a variable?
I know the below scripts do not work.
<-- Does NOT Work -->
<div style=`${[<tag-pill-style black>]}$` >
Hello My New Style
</div>
<-- Does NOT Work -->
<div style={{{ [<tag-pill-style black>] }}} >
Hello My New Style
</div>