[{"title":"$:/editions/tw5.com/operator-macros","created":"20150117152607000","modified":"20150228114306000","tags":"$:/tags/Macro","text":"\\define .operator-examples(op,text:\"Examples\") <$link to=\"$op$ Operator (Examples)\">$text$</$link>\n\n\\define .operator-example(n,eg,ie)\n<div class=\"doc-example\">\n<$list filter=\"[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]\" variable=\".state\">\n<$reveal state=<<.state>> type=\"nomatch\" text=\"show\">\n\t`$eg$`\n\t<$macrocall $name=\".if\" cond=\"\"\"$ie$\"\"\" then=\"\"\"<dd>&rarr; $ie$</dd>\"\"\"/>\n\t<dl>\n\t<dd><$button actions=\"\"\"<$action-setfield $tiddler=<<.state>> text=\"show\" filter=<<__eg__>>/>\n\"\"\">Try it</$button></dd>\n\t</dl>\n</$reveal>\n<$reveal state=<<.state>> type=\"match\" text=\"show\">\n\t<div class=\"tc-search tc-advanced-search\">\n\t<$edit-text tiddler=<<.state>> field=\"filter\" tag=\"input\" type=search/>\n\t</div>\n\t<dl>\n\t<dd><$button set=<<.state>> setTo=\"\">Hide</$button></dd>\n\t</dl>\n\t<$list filter=\"[<.state>get[filter]]\" variable=\".filter\">\n\t<blockquote class=\"doc-example-result\">\n\t<ul><$list filter=<<.filter>> emptyMessage=\"(empty)\">\n\t<li><$link><$view field=\"title\"/></$link></li>\n\t</$list></ul>\n\t</blockquote>\n\t</$list>\n</$reveal>\n</$list>\n\\end\n\n\\define .inline-operator-example(eg)\n<code><$text text=<<__eg__>>/></code> evaluates to <$list filter=<<__eg__>> emptyMessage=\"(empty)\"> <code><$text text=<<currentTiddler>>/></code> </$list>\n\\end\n\n\\define .this-is-operator-example() This example tiddler is used to illustrate some of the [[Filter Operators]].\n\\define .using-days-of-week() These examples make use of the [[Days of the Week]] tiddler.\n\\define .s-matching-is-case-sensitive() In looking for matches for <<.place S>>, capital and lowercase letters are treated as different.\n\n\\define .node-only-operator()\n\n<$macrocall $name=\".note\" _=\"This operator is <<.em not>> available when ~TiddlyWiki is running in a web browser.\"/>\n\n\\end\n"}]