From d536030c5dbd256cd4557cc50a663e883d380b16 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Tue, 27 Jan 2015 20:38:30 +0000 Subject: [PATCH] Adjust documentation following pull #1422 --- editions/tw5.com/tiddlers/filters/each.tid | 14 ++++++++++---- editions/tw5.com/tiddlers/filters/eachday.tid | 4 ++-- .../tw5.com/tiddlers/system/operator-macros.tid | 8 ++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/editions/tw5.com/tiddlers/filters/each.tid b/editions/tw5.com/tiddlers/filters/each.tid index 4f381fc20..04c3e02f8 100644 --- a/editions/tw5.com/tiddlers/filters/each.tid +++ b/editions/tw5.com/tiddlers/filters/each.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150124164957000 +modified: 20150127202915000 tags: [[Filter Operators]] [[Group Operators]] title: each Operator type: text/vnd.tiddlywiki @@ -8,13 +8,19 @@ purpose: select one of each group of input titles by field <$macrocall $name=".operator-def" input="a [[selection of titles|Title Selection]]" -parameter="the name of a [[field|TiddlerFields]]" +suffix="optionally, `list`" +parameter="the name of a [[field|TiddlerFields]], defaulting to <<.field title>>" paramName="f" output="a selection containing the first input title encountered for each distinct value of field <<.place f>>" /> -Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined, and as long as the value has not been encountered before, the title is appended to the output set. +Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined. -If a tiddler doesn't contain field <<.place f>>, or contains it but with an empty value, then it contributes nothing to the output. +;each +:As long as the field's value has not been encountered before, the title is appended to the output. +;each:list +:The value is treated as a [[title list|Title List]]. Each title in the list considered in turn. If it has not been encountered before, it is appended to the output. + +If a tiddler doesn't contain field <<.place f>>, it is treated as if the field's value was empty. <<.operator-examples "each">> diff --git a/editions/tw5.com/tiddlers/filters/eachday.tid b/editions/tw5.com/tiddlers/filters/eachday.tid index d8c8ff20a..07f459761 100644 --- a/editions/tw5.com/tiddlers/filters/eachday.tid +++ b/editions/tw5.com/tiddlers/filters/eachday.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150124214554000 +modified: 20150127202806000 tags: [[Filter Operators]] [[Group Operators]] [[Date Operators]] title: eachday Operator type: text/vnd.tiddlywiki @@ -13,7 +13,7 @@ paramName="f" output="a selection containing the first input title encountered for each distinct value (ignoring times of day) of field <<.place f>>" /> -Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined, and as long as this indicates a date that has not been encountered before, the title is appended to the output set. +Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined, and as long as this indicates a date that has not been encountered before, the title is appended to the output. If a tiddler doesn't contain field <<.place f>>, it contributes nothing to the output. diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid index b56c48cd3..631c15f10 100644 --- a/editions/tw5.com/tiddlers/system/operator-macros.tid +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -1,8 +1,12 @@ created: 20150117152607000 -modified: 20150126144131000 +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) @@ -11,7 +15,7 @@ tags: $:/tags/Macro then="""""" else=""/> <$macrocall $name=".if" cond="""$suffix$""" -then="""""" +then="""""" else=""/>
purpose{{!!purpose}}
`!` input$negationInput$
[[suffix|Filter Step]]<<.place "$suffixName$">> = $suffix$
[[suffix|Filter Step]]<<.operator-suffix-name "$suffixName$">>$suffix$
[[parameter|Filter Parameter]]<$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$'>> = " else=""/>$parameter$
output$output$