2015-01-18 18:39:00 +00:00
|
|
|
created: 20150117152607000
|
2015-01-26 14:42:22 +00:00
|
|
|
modified: 20150126144131000
|
2015-01-18 18:39:00 +00:00
|
|
|
title: $:/editions/tw5.com/operator-macros
|
|
|
|
tags: $:/tags/Macro
|
|
|
|
|
2015-01-24 21:18:44 +00:00
|
|
|
\define .operator-def(input,negationInput,suffix,suffixName,parameter,paramName,output,negationOutput)
|
|
|
|
<table class="doc-table">
|
|
|
|
<tr><th align="left">purpose</th><td>{{!!purpose}}</td></tr>
|
|
|
|
<tr><th align="left">[[input|Filter Syntax]]</th><td>$input$</td></tr>
|
|
|
|
<$macrocall $name=".if" cond="""$negationInput$"""
|
|
|
|
then="""<tr><th align="left">`!` input</th><td>$negationInput$</td></tr>"""
|
|
|
|
else=""/>
|
|
|
|
<$macrocall $name=".if" cond="""$suffix$"""
|
2015-01-26 14:42:22 +00:00
|
|
|
then="""<tr><th align="left">[[suffix|Filter Step]]</th><td><<.place "$suffixName$">> = $suffix$</td></tr>"""
|
2015-01-24 21:18:44 +00:00
|
|
|
else=""/>
|
2015-01-26 14:42:22 +00:00
|
|
|
<tr><th align="left">[[parameter|Filter Parameter]]</th><td><$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$'>> = " else=""/>$parameter$</td></tr>
|
2015-01-24 21:18:44 +00:00
|
|
|
<tr><th align="left">output</th><td>$output$</td></tr>
|
|
|
|
<$macrocall $name=".if" cond="""$negationOutput$"""
|
|
|
|
then="""<tr><th align="left">`!` output</th><td>$negationOutput$</td></tr>"""
|
|
|
|
else=""/>
|
|
|
|
</table>
|
2015-01-18 18:39:00 +00:00
|
|
|
\end
|
|
|
|
|
2015-01-24 21:18:44 +00:00
|
|
|
\define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$</$link>
|
2015-01-18 18:39:00 +00:00
|
|
|
|
|
|
|
\define .operator-example(n,eg,ie)
|
|
|
|
<div class="doc-example">
|
|
|
|
`$eg$`
|
2015-01-24 21:18:44 +00:00
|
|
|
<$macrocall $name=".if" cond="""$ie$""" then="""<dd>→ $ie$</dd>"""/>
|
2015-01-18 18:39:00 +00:00
|
|
|
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state">
|
|
|
|
<$reveal state=<<.state>> type="nomatch" text="show">
|
|
|
|
<dl>
|
|
|
|
<dd><$button set=<<.state>> setTo="show">Try it</$button></dd>
|
|
|
|
</dl>
|
|
|
|
</$reveal>
|
|
|
|
<$reveal state=<<.state>> type="match" text="show">
|
|
|
|
<dl>
|
|
|
|
<dd><$button set=<<.state>> setTo="">Hide</$button></dd>
|
|
|
|
</dl>
|
|
|
|
<ul><$list filter="$eg$" emptyMessage="(empty)">
|
|
|
|
<li><$link><$view field="title"/></$link></li>
|
|
|
|
</$list></ul>
|
|
|
|
</$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.
|
2015-01-24 21:18:44 +00:00
|
|
|
\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
|