1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 02:27:19 +00:00

Document splitbefore and storyviews operators

This commit is contained in:
Astrid Elocson 2015-01-26 14:42:22 +00:00
parent 89163e0e85
commit baceb21fbb
6 changed files with 60 additions and 3 deletions

View File

@ -0,0 +1,8 @@
created: 20150126143216000
modified: 20150126143901000
tags: [[splitbefore Operator]] [[Operator Examples]]
title: splitbefore Operator (Examples)
type: text/vnd.tiddlywiki
<$macrocall $name=".operator-example" n="1" eg="2015-01-26 2014-07-19 2013 +[splitbefore[-]]"/>
<$macrocall $name=".operator-example" n="2" eg="[[green trees]splitbefore[ee]]"/>

View File

@ -0,0 +1,7 @@
created: 20150126142047000
modified: 20150126142124000
tags: [[storyviews Operator]] [[Operator Examples]]
title: storyviews Operator (Examples)
type: text/vnd.tiddlywiki
<<.operator-example 1 "[storyviews[]]">>

View File

@ -0,0 +1,25 @@
created: 20150126142522000
modified: 20150126143945000
tags: [[Filter Operators]] [[String Operators]]
title: splitbefore Operator
type: text/vnd.tiddlywiki
caption: splitbefore
purpose: select a delimited prefix from each input title
<$macrocall $name=".operator-def"
input="a [[selection of titles|Title Selection]]"
parameter="a string of characters marking the end of the prefix"
paramName="s"
output="the prefix, up to and including <<.place S>>, of each input title"
/>
Each input title is processed in turn.
* A title that contains <<.place s>> contributes everything up to and including <<.place s>>.
* A title that doesn't contain <<.place s>> simply contributes itself to the output.
Contributions are [[dominantly appended|Dominant Append]] to the output.
The <<.clink "`toc`" TableOfContentsMacro>> macros use this operator with `/` as the parameter.
<<.operator-examples "splitbefore">>

View File

@ -0,0 +1,17 @@
created: 20150126141718000
modified: 20150126142035000
tags: [[Filter Operators]] [[Special Operators]]
title: storyviews Operator
type: text/vnd.tiddlywiki
caption: storyviews
purpose: select the names of all the story views
<$macrocall $name=".operator-def"
input="ignored"
parameter="none"
output="the name of each story view"
/>
The names are those exported by [[modules|Modules]] whose <<.field module-type>> is <<.value storyview>>.
<<.operator-examples "storyviews">>

View File

@ -1,5 +1,5 @@
created: 20150117152607000 created: 20150117152607000
modified: 20150126092438000 modified: 20150126144131000
title: $:/editions/tw5.com/operator-macros title: $:/editions/tw5.com/operator-macros
tags: $:/tags/Macro tags: $:/tags/Macro
@ -11,9 +11,9 @@ tags: $:/tags/Macro
then="""<tr><th align="left">`!` input</th><td>$negationInput$</td></tr>""" then="""<tr><th align="left">`!` input</th><td>$negationInput$</td></tr>"""
else=""/> else=""/>
<$macrocall $name=".if" cond="""$suffix$""" <$macrocall $name=".if" cond="""$suffix$"""
then="""<tr><th align="left">[[suffix|Filter Step]]</th><td><<.place "$suffixName$:">> $suffix$</td></tr>""" then="""<tr><th align="left">[[suffix|Filter Step]]</th><td><<.place "$suffixName$">> = $suffix$</td></tr>"""
else=""/> else=""/>
<tr><th align="left">[[parameter|Filter Parameter]]</th><td><$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$:'>>" else=""/>$parameter$</td></tr> <tr><th align="left">[[parameter|Filter Parameter]]</th><td><$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$'>> = " else=""/>$parameter$</td></tr>
<tr><th align="left">output</th><td>$output$</td></tr> <tr><th align="left">output</th><td>$output$</td></tr>
<$macrocall $name=".if" cond="""$negationOutput$""" <$macrocall $name=".if" cond="""$negationOutput$"""
then="""<tr><th align="left">`!` output</th><td>$negationOutput$</td></tr>""" then="""<tr><th align="left">`!` output</th><td>$negationOutput$</td></tr>"""