mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 10:49:43 +00:00
18d8173dcc
* 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.
29 lines
1005 B
Plaintext
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]]""">>
|