Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for list-template and list-empty widgets for specifying l…
- Loading branch information
Showing
7 changed files
with
198 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
editions/test/tiddlers/tests/data/list-widget/WithExplicitTemplates.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
title: ListWidget/WithExplicitTemplates | ||
description: List widget with explicit templates | ||
type: text/vnd.tiddlywiki-multiple | ||
tags: [[$:/tags/wiki-test-spec]] | ||
|
||
+ | ||
title: Output | ||
|
||
\whitespace trim | ||
|
||
\procedure test(filter) | ||
<$list filter=<<filter>>> | ||
<$list-template> | ||
<$text text=<<currentTiddler>>/> | ||
</$list-template> | ||
<$list-empty> | ||
None! | ||
</$list-empty> | ||
</$list> | ||
\end | ||
|
||
<<test "1 2 3">> | ||
|
||
<<test "">> | ||
|
||
+ | ||
title: ExpectedResult | ||
|
||
<p>123</p><p>None!</p> |
32 changes: 32 additions & 0 deletions
32
editions/test/tiddlers/tests/data/list-widget/WithExplicitTemplatesInBlockMode.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
title: ListWidget/WithExplicitTemplatesInBlockMode | ||
description: List widget with explicit templates in block mode | ||
type: text/vnd.tiddlywiki-multiple | ||
tags: [[$:/tags/wiki-test-spec]] | ||
|
||
+ | ||
title: Output | ||
|
||
\whitespace trim | ||
|
||
\procedure test(filter) | ||
<$list filter=<<filter>>> | ||
|
||
<$list-template> | ||
<$text text=<<currentTiddler>>/> | ||
</$list-template> | ||
|
||
<$list-empty> | ||
None! | ||
</$list-empty> | ||
|
||
</$list> | ||
\end | ||
|
||
<<test "1 2 3">> | ||
|
||
<<test "">> | ||
|
||
+ | ||
title: ExpectedResult | ||
|
||
123None! |
33 changes: 33 additions & 0 deletions
33
...ions/test/tiddlers/tests/data/list-widget/WithExplicitTemplatesOverriddenByAttributes.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
title: ListWidget/WithExplicitTemplatesOverriddenByAttributes | ||
description: List widget with explicit templates | ||
type: text/vnd.tiddlywiki-multiple | ||
tags: [[$:/tags/wiki-test-spec]] | ||
|
||
+ | ||
title: Output | ||
|
||
\whitespace trim | ||
|
||
\procedure test(filter) | ||
<$list filter=<<filter>> emptyMessage="Zero" template="Template"> | ||
<$list-template> | ||
<$text text=<<currentTiddler>>/> | ||
</$list-template> | ||
<$list-empty> | ||
None! | ||
</$list-empty> | ||
</$list> | ||
\end | ||
|
||
<<test "1 2 3">> | ||
|
||
<<test "">> | ||
|
||
+ | ||
title: Template | ||
|
||
<$text text=<<currentTiddler>>/><$text text=<<currentTiddler>>/> | ||
+ | ||
title: ExpectedResult | ||
|
||
<p>112233</p><p>Zero</p> |
25 changes: 25 additions & 0 deletions
25
editions/test/tiddlers/tests/data/list-widget/WithLimit.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
title: ListWidget/WithLimit | ||
description: List widget with limit | ||
type: text/vnd.tiddlywiki-multiple | ||
tags: [[$:/tags/wiki-test-spec]] | ||
|
||
+ | ||
title: Output | ||
|
||
Zero: <$list filter="1 2 3 4" limit="0" template="Template"/> | ||
|
||
One: <$list filter="1 2 3 4" limit="1" template="Template"/> | ||
|
||
Two: <$list filter="1 2 3 4" limit="2" template="Template"/> | ||
|
||
Minus Two: <$list filter="1 2 3 4" limit="-2" template="Template"/> | ||
|
||
+ | ||
title: Template | ||
|
||
<$text text=<<currentTiddler>>/> | ||
+ | ||
title: ExpectedResult | ||
|
||
<p>Zero: </p><p>One: 1</p><p>Two: 12</p><p>Minus Two: 34 | ||
</p> |
26 changes: 26 additions & 0 deletions
26
editions/test/tiddlers/tests/data/list-widget/WithMissingTemplate.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
title: ListWidget/WithMissingTemplate | ||
description: List widget with explicit templates | ||
type: text/vnd.tiddlywiki-multiple | ||
tags: [[$:/tags/wiki-test-spec]] | ||
|
||
+ | ||
title: Output | ||
|
||
\whitespace trim | ||
|
||
\procedure test(filter) | ||
<$list filter=<<filter>>> | ||
<$list-empty> | ||
None! | ||
</$list-empty> | ||
</$list> | ||
\end | ||
|
||
<<test "1 2 3">> | ||
|
||
<<test "">> | ||
|
||
+ | ||
title: ExpectedResult | ||
|
||
<p><span><a class="tc-tiddlylink tc-tiddlylink-missing" href="#1">1</a></span><span><a class="tc-tiddlylink tc-tiddlylink-missing" href="#2">2</a></span><span><a class="tc-tiddlylink tc-tiddlylink-missing" href="#3">3</a></span></p><p>None!</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4c9c85a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
tiddlywiki5 – ./
tiddlywiki5.vercel.app
tiddlywiki5-git-master-jermolene.vercel.app
tiddlywiki5-jermolene.vercel.app