1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Fix previews of filtered palettes

This commit is contained in:
Jeremy Ruston 2024-11-14 17:40:58 +00:00
parent c2ee0727a5
commit 3faf9bae5c

View File

@ -3,15 +3,16 @@ title: $:/snippets/currpalettepreview
\whitespace trim \whitespace trim
\procedure colour-div-filtered(class,styleName,styleColour) \procedure colour-div-filtered(class,styleName,styleColour)
\function colour(name) [<currentTiddler>getindex<name>] :else[<currentTiddler>get[palette-import]getindex<name>] :else[[none]] :map[subfilter<currentTiddler>] \function colour(name) [<colour-palette>getindex<name>] :else[<colour-palette>get[palette-import]getindex<name>] :else[[none]] :map[subfilter<currentTiddler>] +[join[ ]]
<$let colour-filter={{{ [<currentTiddler>getindex<styleColour>] }}}>
<!-- Note the join, needed to cope with palette entries containing spaces --> <!-- Note the join, needed to cope with palette entries containing spaces -->
<$let colour-result={{{ [subfilter<colour-filter>join[ ]] }}}> <$let
colour-palette=<<currentTiddler>>
colour-result={{{ [function[colour],<styleColour>] +[join[ ]] }}}
>
<div class=<<class>> style={{{ [<styleName>addsuffix[:]addsuffix<colour-result>addsuffix[;]] }}}> <div class=<<class>> style={{{ [<styleName>addsuffix[:]addsuffix<colour-result>addsuffix[;]] }}}>
<$slot $name="ts-raw" $depth="2"/> <$slot $name="ts-raw" $depth="2"/>
</div> </div>
</$let> </$let>
</$let>
\end colour-div-filtered \end colour-div-filtered
\procedure colour-div-wikified(class,styleName,styleColour) \procedure colour-div-wikified(class,styleName,styleColour)