mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-10-03 01:10:45 +00:00
61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
created: 20150117152607000
|
|
modified: 20150119193041000
|
|
title: $:/editions/tw5.com/operator-macros
|
|
tags: $:/tags/Macro
|
|
|
|
\define .operator-def(input,parameter,paramName,output)
|
|
<table><tr>
|
|
<th align="left">input</th>
|
|
<td>$input$</td>
|
|
</tr><tr>
|
|
<th align="left">parameter<$macrocall $name=".if" cond="$paramName$" then=" <<.place '$paramName$'>>"/></th>
|
|
<td>$parameter$</td>
|
|
</tr><tr>
|
|
<th align="left">output</th>
|
|
<td>$output$</td>
|
|
</tr></table>
|
|
\end
|
|
|
|
\define .operator-def-suffix(input,suffix,suffixName,parameter,paramName,output)
|
|
<table><tr>
|
|
<th align="left">input</th>
|
|
<td>$input$</td>
|
|
</tr><tr>
|
|
<th align="left">suffix <<.place "$suffixName$">></th>
|
|
<td>$suffix$</td>
|
|
</tr><tr>
|
|
<th align="left">parameter<$macrocall $name=".if" cond="$paramName$" then=" <<.place '$paramName$'>>"/></th>
|
|
<td>$parameter$</td>
|
|
</tr><tr>
|
|
<th align="left">output</th>
|
|
<td>$output$</td>
|
|
</tr></table>
|
|
\end
|
|
|
|
\define .operator-examples(op) <$link to="$op$ Operator (Examples)">Examples</$link>
|
|
|
|
\define .operator-example(n,eg,ie)
|
|
<div class="doc-example">
|
|
`$eg$`
|
|
<<.if cond:"$ie$" then:"<dd>$ie$</dd>">>
|
|
<$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.
|
|
\define .node-only-operator() This operator is <<.em not>> available when ~TiddlyWiki is running in a web browser.
|