1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Use the testcase widget for the $action-deletetiddler widget examples (#8242)

This commit is contained in:
btheado 2024-06-08 11:51:55 -04:00 committed by GitHub
parent 1a57d08feb
commit 7ec8334005
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
caption: action-deletetiddler caption: action-deletetiddler
created: 20141025120850184 created: 20141025120850184
modified: 20141106173455527 modified: 20240608152211834
tags: Widgets ActionWidgets tags: Widgets ActionWidgets
title: ActionDeleteTiddlerWidget title: ActionDeleteTiddlerWidget
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -25,18 +25,20 @@ The ''action-deletetiddler'' widget is invisible. Any content within it is ignor
! Examples ! Examples
Here is an example of a button that deletes the tiddler HelloThere: <$testcase>
<$data title=Description text="Delete a specific tiddler"/>
<$macrocall $name='wikitext-example-without-html' <$data title=Narrative text="""Use the $tiddler attribute of the $action-deletefield widget to delete the "~HelloThere" tiddler"""/>
src='<$button> <$data $tiddler="HelloThere"/>
<$action-deletetiddler $tiddler="HelloThere"/> <$data title=Output text="""<$button actions="<$action-deletetiddler $tiddler=HelloThere/>">
Delete "~HelloThere" Delete "~HelloThere"
</$button>'/> </$button>"""/>
</$testcase>
Here is an example of a button that deletes all tiddlers tagged [[TableOfContents]]: <$testcase>
<$data title=Description text="Delete tiddlers matching a filter"/>
<$macrocall $name='wikitext-example-without-html' <$data title=Narrative text="""Use the $filter attribute of the $action-deletefield widget to delete all tiddlers tagged "~TableOfContents" """/>
src='<$button> <$data $filter="[tag[TableOfContents]]"/>
<$action-deletetiddler $filter="[tag[TableOfContents]]"/> <$data title=Output text="""<$button actions='<$action-deletetiddler $filter="[tag[TableOfContents]]"/>'>
Delete tiddlers tagged "~TableOfContents" Delete tiddlers tagged "~TableOfContents"
</$button>'/> </$button>"""/>
</$testcase>