2015-01-18 18:39:00 +00:00
|
|
|
created: 20150117152607000
|
2024-03-10 10:39:16 +00:00
|
|
|
modified: 20240229132501000
|
2015-01-18 18:39:00 +00:00
|
|
|
tags: $:/tags/Macro
|
2024-03-10 10:39:16 +00:00
|
|
|
code-body: yes
|
2022-03-02 17:36:53 +00:00
|
|
|
title: $:/editions/tw5.com/operator-macros
|
2015-01-18 18:39:00 +00:00
|
|
|
|
2024-03-10 10:39:16 +00:00
|
|
|
|
|
|
|
\whitespace trim
|
|
|
|
|
|
|
|
\procedure .operator-examples(op,text:"Examples") <$link to=`$(op)$ Operator (Examples)`><<text>></$link>
|
2015-01-18 18:39:00 +00:00
|
|
|
|
2023-06-18 10:05:06 +00:00
|
|
|
\procedure .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<eg>>/>
|
2024-03-10 10:39:16 +00:00
|
|
|
|
2023-06-18 10:05:06 +00:00
|
|
|
\procedure .operator-example(n,eg,ie)
|
2015-01-18 18:39:00 +00:00
|
|
|
<div class="doc-example">
|
2024-03-10 10:39:16 +00:00
|
|
|
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix<n>]" variable=".state">
|
|
|
|
<$reveal state=<<.state>> type="nomatch" text="show">
|
|
|
|
<code><$text text=<<eg>>/></code>
|
2024-09-02 15:51:15 +00:00
|
|
|
<%if [<ie>!is[blank]] %>
|
2024-03-10 10:39:16 +00:00
|
|
|
<dd>→ <<ie>></dd>
|
2024-09-02 15:51:15 +00:00
|
|
|
<%endif%>
|
2024-03-10 10:39:16 +00:00
|
|
|
<dl>
|
|
|
|
<dd><$button actions=<<.operator-example-tryit-actions>>>Try it</$button></dd>
|
|
|
|
</dl>
|
|
|
|
</$reveal>
|
|
|
|
<$reveal state=<<.state>> type="match" text="show">
|
|
|
|
<$edit-text tiddler=<<.state>> field="filter" tag="input" type=search focus="true"/>
|
|
|
|
<dl>
|
|
|
|
<dd>
|
|
|
|
<$button set=<<.state>> setTo="">Hide</$button>
|
|
|
|
<$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<eg>>>
|
|
|
|
<$button actions=<<.operator-example-tryit-actions>>>Reset</$button>
|
|
|
|
</$reveal>
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
<blockquote class="doc-example-result">
|
|
|
|
<ul>
|
|
|
|
<$list filter={{{[<.state>get[filter]]}}} emptyMessage="(empty)">
|
|
|
|
<li><$link><$view field="title"/></$link></li>
|
|
|
|
</$list>
|
|
|
|
</ul>
|
|
|
|
</blockquote>
|
|
|
|
</$reveal>
|
|
|
|
</$list>
|
|
|
|
</div>
|
2015-01-18 18:39:00 +00:00
|
|
|
\end
|
|
|
|
|
2024-03-10 10:39:16 +00:00
|
|
|
\procedure .inline-operator-example(eg)
|
|
|
|
<code>
|
|
|
|
<$text text=<<eg>>/>
|
|
|
|
</code>
|
|
|
|
<span class="tc-tiny-gap">evaluates to</span>
|
|
|
|
<$list filter=<<eg>> emptyMessage="(empty)">
|
|
|
|
<code class="tc-tiny-gap-left"><$text text=<<currentTiddler>>/></code>
|
|
|
|
</$list>
|
2019-02-07 11:19:06 +00:00
|
|
|
\end
|
|
|
|
|
2015-01-18 18:39:00 +00:00
|
|
|
\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-02-03 19:29:25 +00:00
|
|
|
\define .s-matching-is-case-sensitive() In looking for matches for <<.place S>>, capital and lowercase letters are treated as different.
|
2015-01-24 21:18:44 +00:00
|
|
|
|
2024-03-10 10:39:16 +00:00
|
|
|
\procedure .node-only-operator()
|
2015-01-24 21:18:44 +00:00
|
|
|
|
|
|
|
<$macrocall $name=".note" _="This operator is <<.em not>> available when ~TiddlyWiki is running in a web browser."/>
|
|
|
|
|
|
|
|
\end
|