Merge branch 'tiddlywiki-com'

This commit is contained in:
jeremy@jermolene.com 2022-01-11 17:51:32 +00:00
commit 54bfb28063
8 changed files with 76 additions and 27 deletions

View File

@ -1,5 +1,5 @@
created: 20140410103123179 created: 20140410103123179
modified: 20210830010231559 modified: 20211217141224284
tags: Filters tags: Filters
title: Filter Operators title: Filter Operators
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -10,18 +10,21 @@ type: text/vnd.tiddlywiki
<td>{{!!op-purpose}}</td> <td>{{!!op-purpose}}</td>
<td align="center"><$list filter="[all[current]tag[Common Operators]]">✓</$list></td> <td align="center"><$list filter="[all[current]tag[Common Operators]]">✓</$list></td>
<td align="center"><$list filter="[all[current]tag[Negatable Operators]]">`!`</$list></td> <td align="center"><$list filter="[all[current]tag[Negatable Operators]]">`!`</$list></td>
<td align="center"><$list filter="[all[current]tag[Selection Constructors]!tag[Selection Constructors: Conditional]]">`C`</$list><$list filter="[all[current]tag[Selection Constructors]tag[Selection Constructors: Conditional]]">`C?`</$list></td>
</tr></$list> </tr></$list>
\end \end
\define .group-heading(_) \define .group-heading(_)
<tr class="doc-table-subheading"><th colspan="4" align="center">$_$</th></tr> <tr class="doc-table-subheading"><th colspan="5" align="center">$_$</th></tr>
\end \end
A <<.def "filter operator">> is a predefined keyword attached to an individual [[step|Filter Step]] of a [[filter|Filters]]. It defines the particular action of that step. A <<.def "filter operator">> is a predefined keyword attached to an individual [[step|Filter Step]] of a [[filter|Filters]]. It defines the particular action of that step.
''Important:'' Each first [[step|Filter Step]] of a [[filter run|Filter Run]] not given any input titles receives the output of <$link to="all Operator">[all[tiddlers]]</$link> as its input. ''Important:'' Each first [[step|Filter Step]] of a [[filter run|Filter Run]] not given any input titles receives the output of <$link to="all Operator">[all[tiddlers]]</$link> as its input.
The following table lists all core operators, the most common ones marked ✓. The last column indicates whether an operator allows ''negation'' using the <$link to="Filter Step"><code>!</code> prefix</$link>. For specifics as to each operator's negated output please refer to its documentation. The following table lists all core operators, the most common ones marked ✓. The `!` column indicates whether an operator allows ''negation'' using the <$link to="Filter Step"><code>!</code> prefix</$link>. For specifics as to each operator's negated output please refer to its documentation.
Most steps process the [[selection of titles|Title Selection]] that are supplied as their input, but a few [[construct an entirely new selection|Selection Constructors]] instead, as indicated by the last column. A `C?` indicates it might construct a new selection, depending on usage. For specifics as to each operator's selection creation please refer to its documentation.
<table> <table>
<tr> <tr>
@ -29,6 +32,7 @@ The following table lists all core operators, the most common ones marked ✓. T
<th align="left">Purpose</th> <th align="left">Purpose</th>
<th align="center">✓</th> <th align="center">✓</th>
<th align="center">`!`</th> <th align="center">`!`</th>
<th align="center">`C`</th>
</tr> </tr>
<<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[Mathematics Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">> <<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[Mathematics Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">>
<<.group-heading "Order Operators">> <<.group-heading "Order Operators">>
@ -45,6 +49,6 @@ The following table lists all core operators, the most common ones marked ✓. T
<<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[Mathematics Operators]!tag[String Operators]!tag[Tag Operators]tag[Special Operators]sort[]]">> <<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[Mathematics Operators]!tag[String Operators]!tag[Tag Operators]tag[Special Operators]sort[]]">>
</table> </table>
A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameter]]. A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameter]].
Most steps process the [[selection of titles|Title Selection]] that are supplied as their input, but a few [[construct an entirely new selection|Selection Constructors]] instead. For the exact rules, see [[Filter Syntax]]. For the exact rules, see [[Filter Syntax]].

View File

@ -1,11 +1,11 @@
caption: all caption: all
created: 20140410103123179 created: 20140410103123179
modified: 20161128185445034 modified: 20211217135719266
op-input: ignored, unless the parameter is empty op-input: ignored, unless the parameter is empty
op-output: the titles that belong to all the specified categories op-output: the titles that belong to all the specified categories
op-parameter: zero or more categories op-parameter: zero or more categories
op-purpose: find all titles of a fundamental category op-purpose: find all titles of a fundamental category
tags: [[Filter Operators]] [[Common Operators]] [[Selection Constructors]] tags: [[Filter Operators]] [[Common Operators]] [[Selection Constructors]] [[Selection Constructors: Conditional]]
title: all Operator title: all Operator
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki

View File

@ -1,6 +1,6 @@
caption: subfilter caption: subfilter
created: 20181031175129475 created: 20181031175129475
modified: 20211030223407188 modified: 20211217135706478
op-input: a [[selection of titles|Title Selection]] passed as input to the subfilter op-input: a [[selection of titles|Title Selection]] passed as input to the subfilter
op-neg-input: a [[selection of titles|Title Selection]] passed as input to the subfilter op-neg-input: a [[selection of titles|Title Selection]] passed as input to the subfilter
op-neg-output: those input titles that are <<.em not>> returned from the subfilter <<.place S>> op-neg-output: those input titles that are <<.em not>> returned from the subfilter <<.place S>>
@ -8,7 +8,7 @@ op-output: the [[selection of titles|Title Selection]] returned from the subfilt
op-parameter: a [[filter expression|Filter Expression]] op-parameter: a [[filter expression|Filter Expression]]
op-parameter-name: S op-parameter-name: S
op-purpose: select titles from the operand interpreted as a [[filter expression|Filter Expression]] op-purpose: select titles from the operand interpreted as a [[filter expression|Filter Expression]]
tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]] tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]] [[Selection Constructors: Conditional]]
title: subfilter Operator title: subfilter Operator
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki

View File

@ -1,5 +1,5 @@
created: 20160424150551727 created: 20160424150551727
modified: 20190115162340362 modified: 20211230153027382
tags: Learning tags: Learning
title: Concatenating text and variables using macro substitution title: Concatenating text and variables using macro substitution
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -9,9 +9,7 @@ It's a frequent use case in ~TiddlyWiki that you will want to put the results of
You might, for instance want to set up a template for your customer database, where links will automatically refer to additional contact information about your customer. Inside your tiddler, you might try something like this: You might, for instance want to set up a template for your customer database, where links will automatically refer to additional contact information about your customer. Inside your tiddler, you might try something like this:
<<.bad-example "`[[Additional Info|<<currentTiddler>>-Contact]]`">>
|warning|k
|@@font-size:1.5em;&#9888;@@ Warning:<br/> Don't do it this way!| `[[Additional Info|<<currentTiddler>>-Contact]]` |
But that won't work. If you try this, the link will be interpreted very literally, and will attempt to take you to: But that won't work. If you try this, the link will be interpreted very literally, and will attempt to take you to:
@ -29,9 +27,7 @@ Create a macro at the top of the tiddler like this:
You might be tempted to invoke the new macro like this: You might be tempted to invoke the new macro like this:
|warning|k <<.bad-example "`<<linkup <<currentTiddler>> >>`">>
|@@font-size:1.5em;&#9888;@@ Warning:<br/> Don't do it this way!| `<<linkup <<currentTiddler>> >>` |
But if you do, you will find that `<<currentTiddler>>` doesn't get rendered, but instead gets passed literally. But if you do, you will find that `<<currentTiddler>>` doesn't get rendered, but instead gets passed literally.
@ -53,10 +49,4 @@ Notice that in this case we don't pass an argument. Instead, we reference the va
``` ```
<<linkup>> <<linkup>>
``` ```
<style>
.warning code {background-color:#ffff80}
table.warning {background-color:#ffff80;}
</style>

View File

@ -1,5 +1,5 @@
created: 20150117152607000 created: 20150117152607000
modified: 201804111739 modified: 20211230150413997
tags: $:/tags/Macro tags: $:/tags/Macro
title: $:/editions/tw5.com/doc-macros title: $:/editions/tw5.com/doc-macros
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -113,6 +113,20 @@ This is an example tiddler. See [[Table-of-Contents Macros (Examples)]].
</$list> </$list>
\end \end
\define .bad-example(eg)
<table class="doc-bad-example">
<tbody>
<tr class="evenRow">
<td><span class="tc-inline-style" style="font-size:1.5em;">&#9888;</span> Warning:<br> Don't do it this way!</td>
<td>
$eg$
</td>
</tr>
</tbody>
</table>
\end
\define .link-badge(text,link,colour) \define .link-badge(text,link,colour)
<a href=<<__link__>> class="doc-link-badge" style="background-color:$colour$;" target="_blank" rel="noopener noreferrer"><$text text=<<__text__>>/></a> <a href=<<__link__>> class="doc-link-badge" style="background-color:$colour$;" target="_blank" rel="noopener noreferrer"><$text text=<<__text__>>/></a>
\end \end

View File

@ -1,5 +1,5 @@
created: 20150117152612000 created: 20150117152612000
modified: 20211124164948726 modified: 20211230150725145
tags: $:/tags/Stylesheet tags: $:/tags/Stylesheet
title: $:/editions/tw5.com/doc-styles title: $:/editions/tw5.com/doc-styles
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -133,6 +133,10 @@ td svg {
padding-left: 20px; padding-left: 20px;
} }
.doc-bad-example code, .doc-bad-example pre, table.doc-bad-example {
background-color:#ffff80;
}
.doc-table th, .doc-table tr { .doc-table th, .doc-table tr {
vertical-align: top; vertical-align: top;
} }

View File

@ -1,6 +1,6 @@
caption: Linking caption: Linking
created: 20131205155230596 created: 20131205155230596
modified: 20160607095245257 modified: 20211230145939554
tags: WikiText tags: WikiText
title: Linking in WikiText title: Linking in WikiText
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -80,3 +80,40 @@ You can also use the extended syntax to force an external link:
See the LinkWidget for details of the underlying widget used to implement tiddler links, including macros that can be used to customise its behaviour. See the LinkWidget for details of the underlying widget used to implement tiddler links, including macros that can be used to customise its behaviour.
! Generating dynamic links
[[Linking in WikiText]] does not lend itself well to creating dynamic links. The reason is because this WikiText link:
```
[[link to myself|Linking in WikiText]]
```
is shorthand for using the LinkWidget and TextWidget like this:
```
<$link to="Linking in WikiText">
<$text text="link to myself"/>
</$link>
```
Since both the link title ("link to myself") and the link target ("Linking in ~WikiText") are used as widget attributes, no WikiText expansion takes place.
For example, an attempt to use a [[reference|TextReference]] and a [[variable|Variables]] to dynamically generate a link like this:
<<.bad-example "`[[{{!!caption}}|<<currentTiddler>>]]`">>
is the same as trying to use the LinkWidget and TextWidget like this:
<<.bad-example """```
<$link to="<<currentTiddler>>">
<$text text="{{!!caption}}"/>
</$link>
```""">>
This will not work as desired. Content inside of quoted widget attributes is [[treated as a literal value|HTML in WikiText]] and protected from WikiText expansion, so it will render like this:
<<.bad-example "[[{{!!caption}}|<<currentTiddler>>]]">>
In order to get the desired result, the LinkWidget can be used directly like this:
<<wikitext-example-without-html src:"<$link to=<<currentTiddler>>>{{!!caption}}</$link>">>
See also another example of [[constructing dynamic links|Concatenating text and variables using macro substitution]].

View File

@ -368,7 +368,7 @@ Mark Kerrigan, @markkerrigan, 2019/08/24
Stefan Schuster-Teupke, @StefanSTFG, 2019/08/26 Stefan Schuster-Teupke, @StefanSTFG, 2019/08/26
Nils-Hero Lindemann, @heronils, 2019/08/26 Nils Lindemann, @nilslindemann, 2022/01/10
Marica Odagaki, @ento, 2019/08/30 Marica Odagaki, @ento, 2019/08/30