Hello everyone.
I’ve been mulling over some code for a couple of days now, and I can’t get it to work the way I want. I’ve tried solving it with some AI, and although their explanations seemed convincing, the code they provided didn’t work.
What I want is to set the value of the “estado” parameter to “abierto” instead of “open” when invoking the macro. However, for the macro to work properly, that “abierto” value must be internally changed to “open” for the macro to work properly. I’ve tried to solve this problem, among many other ways, with this code, but it simply doesn’t work: I’ve tried solving it, among many other variants, with this code, but it just doesn’t work:
\define advertencia-detalles(tipo:"nota", fuente, titulo, estado, ancho:"100%", clase)
<$let theme-class = {{{ [[$:/palette]get[text]get[color-scheme]else[light]addprefix[theme-]] [<__clase__>] :and[join[ ]] }}}
callout-title = {{{ [<__titulo__>!is[blank]] :else[<__tipo__>titlecase[]] }}}
icon-tiddler = {{{ [all[tiddlers+shadows]tag[$:/tags/TimitAdvertencias/Imagen]contains:callout-type<__tipo__>]
:else[[$:/plugins/timit/advertencia/imagenes/nota]] }}}
source = {{{ [<__fuente__>get[text]else<__fuente__>] }}}
estado-valido = {{{ [<__estado__>match[abierto]then[open]] }}} >
<div class=<<theme-class>> style="width:$ancho$;">
<details data-callout=<<__tipo__>> class="callout $clase$" $estado-valido$>
<summary class="callout-title">
<div class="callout-icon"><$transclude tiddler=<<icon-tiddler>> field=text/></div>
<div class="callout-title-inner"><<callout-title>></div>
<div class="callout-fold">{{$:/plugins/timit/advertencia/imagenes/chevron}}</div>
</summary>
<div class="callout-content">
<$transclude tiddler=<<source>> field=title mode=block />
</div>
</details>
</div>
</$let>
\end advertencia-detalles
I also reassigned the value of the “state” variable to the desired value using another “let,” but that didn’t work either.
<$let // Sobrescribimos la variable 'estado' dentro de este $let
estado = {{{ [<__estado__>match[abierto]then[open]else<__estado__>] }}}
>
I understand that the value I get from transforming “abierto” to “open” isn’t in the same format as it should be, and that’s why it isn’t processed, but I’m not sure how to do that.
Any ideas on how to solve this problem?
Thank you very much.