1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-03 18:53:28 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/filters/examples/insertafter Operator (Examples).tid
Robin Munn 18d8173dcc
New insertafter filter operator (#6771)
* Implement insertafter operator (like insertbefore)

Currently, the behavior of insertafter if the target is not found is to
append the inserted tiddler to the end of the list, like insertbefore
does. In the next commit, we'll add a suffix to customize what both
insertafter and insertbefore do when the target is not found.

* Add failing tests for insertafter suffixes

Also includes tests for insertbefore suffixes (start/end), since we'll
be implementing both of those at the same time.

* Add start/end suffixes for insertafter/before

The tests that exercise the start/end suffixes now pass.
2022-07-13 17:08:17 +01:00

29 lines
1005 B
Plaintext

created: 20220223004441865
modified: 20220223004441865
tags: [[Operator Examples]] [[insertafter Operator]]
title: insertafter Operator (Examples)
type: text/vnd.tiddlywiki
\define after-title() Friday
\define missing-title() Yesterday
\define display-variable(name)
''<$text text=<<__name__>>/>'': <code><$text text={{{ [<__name__>getvariable[]] }}}/></code>
\end
These examples use the following predefined variables:
* <<display-variable after-title>>
* <<display-variable missing-title>>
<<.operator-example 1 """[list[Days of the Week]insertafter[Today]]""">>
<<.operator-example 2 """[list[Days of the Week]insertafter[Today],[Tuesday]]""">>
<<.operator-example 3 """[list[Days of the Week]insertafter[Today],<after-title>]""">>
<<.operator-example 4 """[list[Days of the Week]insertafter:after-title[Today]]""">>
<<.operator-example 5 """[list[Days of the Week]insertafter[Today],<missing-title>]""">>
<<.operator-example 6 """[list[Days of the Week]insertafter:missing-title[Today]]""">>