created: 20150117152607000
modified: 20150127203427000
title: $:/editions/tw5.com/operator-macros
tags: $:/tags/Macro
\define .operator-suffix-name(suffixName)
<$macrocall $name=".if" cond="""$suffixName$""" then="<<.place '$suffixName$'>> = " else=""/>
\end
\define .operator-def(input,negationInput,suffix,suffixName,parameter,paramName,output,negationOutput)
purpose | {{!!purpose}} |
[[input|Filter Syntax]] | $input$ |
<$macrocall $name=".if" cond="""$negationInput$"""
then="""`!` input | $negationInput$ |
"""
else=""/>
<$macrocall $name=".if" cond="""$suffix$"""
then="""[[suffix|Filter Step]] | <<.operator-suffix-name "$suffixName$">>$suffix$ |
"""
else=""/>
[[parameter|Filter Parameter]] | <$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$'>> = " else=""/>$parameter$ |
output | $output$ |
<$macrocall $name=".if" cond="""$negationOutput$"""
then="""`!` output | $negationOutput$ |
"""
else=""/>
\end
\define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$$link>
\define .operator-example(n,eg,ie)
`$eg$`
<$macrocall $name=".if" cond="""$ie$""" then="""
→ $ie$"""/>
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state">
<$reveal state=<<.state>> type="nomatch" text="show">
- <$button set=<<.state>> setTo="show">Try it$button>
$reveal>
<$reveal state=<<.state>> type="match" text="show">
- <$button set=<<.state>> setTo="">Hide$button>
<$list filter="$eg$" emptyMessage="(empty)">
- <$link><$view field="title"/>$link>
$list>
$reveal>
$list>
\end
\define .this-is-operator-example() This example tiddler is used to illustrate some of the [[Filter Operators]].
\define .using-days-of-week() These examples make use of the [[Days of the Week]] tiddler.
\define .s-matching-is-case-sensitive() In looking for matches for <<.place s>>, capital and lowercase letters are treated as different.
\define .node-only-operator()
<$macrocall $name=".note" _="This operator is <<.em not>> available when ~TiddlyWiki is running in a web browser."/>
\end