TiddlyWiki5/editions/tw5.com/tiddlers/macros/examples/search-variables Macro (Exa...

36 lines
1.5 KiB
Plaintext

created: 20240427121446051
modified: 20240501121207308
title: search-variables Macro (Examples)
type: text/vnd.tiddlywiki
The following example will list all variables that contain the word "example" in uppercase ''and'' also lowercase, due to the default setting of the <<.olink search>> operator.
While ''the following list will be long'' it should be easy to refine it. It shows all variables known within this tiddler. Using the procedure in a ''different context''. Eg: the sidebar, variables will show ''different values''.
<$macrocall $name=".example" n="1"
eg="""<div><<search-variables >></div>"""/>
<$macrocall $name=".example" n="2"
eg="""<div><$let EXAMPLE="123" >
<<search-variables subfilter:"[search::some[EXAMPLE dumpvariables]]">>
</$let></div>"""/>
Listing only specific varibles can be achieved using the <<.olink search>> operator as a subfilter.
<<.tip """The ''transclusion'' variable is set to eg:"3" so if several "search interfaces" are open in the same tiddler, that type and sort parameters should have no side effects.""">>
<$macrocall $name=".example" n="3"
eg="""<div><$let EXAMPLE="123" transclusion="3">
<<search-variables subfilter:"[search::casesensitive,some[EXAMPLE dumpvariables]]">>
</$let></div>"""/>
<$macrocall $name=".example" n="4"
eg="""<div><<search-variables subfilter:"[prefix[.a]]">></div>"""/>
<$macrocall $name=".example" n="5"
eg="""<div><<search-variables type:"fn" sort:"raw">></div>"""/>
<$macrocall $name=".example" n="6"
eg="""<div><<search-variables type:"fn" sort:"raw" subfilter:"[prefix[.]]">></div>"""/>