From 80631b35ea68cb38e73230bf30784c405eb6870a Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sun, 11 Jan 2015 11:55:22 +0100 Subject: [PATCH] updated NestedLists, renamed to GroupedLists added tw-code macro Didn't implement the codeblock widget as suggested here... https://github.com/Jermolene/TiddlyWiki5/pull/1332#discussion_r22762157 ...because it would only return `undefined`. --- .../tiddlers/demonstrations/GroupedLists.tid | 18 ++++++++ .../tiddlers/demonstrations/NestedLists.tid | 44 ------------------- .../tiddlers/system/wikitext-macros.tid | 10 +++++ .../tw5.com/tiddlers/widgets/ListWidget.tid | 2 +- 4 files changed, 29 insertions(+), 45 deletions(-) create mode 100644 editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid delete mode 100644 editions/tw5.com/tiddlers/demonstrations/NestedLists.tid diff --git a/editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid b/editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid new file mode 100644 index 000000000..d656ecbe9 --- /dev/null +++ b/editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid @@ -0,0 +1,18 @@ +title: GroupedLists +tags: ListWidget +created: 20150106180000000 +modified: 20150106180000000 + +The following sidebar tabs give examples of grouped lists created by nesting. + +!! Types Tab + +For the [[Types|$:/core/ui/MoreSideBar/Types]] tab, the outer list filter as shown below selects each discrete value found in the `type` field. The inner list filter selects all the (non-system) tiddlers with that type. + +<> + +!! Recent Tab + +The list in the [[Recent|$:/core/ui/SideBar/Recent]] tab is generated using the TimelineMacro. Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field. + +<> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid b/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid deleted file mode 100644 index b6142e7a6..000000000 --- a/editions/tw5.com/tiddlers/demonstrations/NestedLists.tid +++ /dev/null @@ -1,44 +0,0 @@ -title: NestedLists -tags: ListWidget -created: 20150106180000000 -modified: 20150106180000000 - -The following sidebar tabs give examples of grouped lists created by nesting. - -!! Types Tab - -The list in the [[Types|$:/core/ui/MoreSideBar/Types]] tab is generated with this markup: - -``` -<$list filter="[!is[system]has[type]each[type]sort[type]]"> -
-<$view field="type"/> -<$list filter="[type{!!type}!is[system]sort[title]]"> -
-<$link to={{!!title}}><$view field="title"/> -
- -
- -``` - -The outer list filter selects each discrete value found in the `type` field. The inner list filter selects all the (non-system) tiddlers with that type. - -!! Recent Tab - -The list in the [[Recent|$:/core/ui/SideBar/Recent]] tab is generated with this markup: - -``` -<$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]"> -
-<$view field="modified" format="date" template="DDth MMM YYYY"/> -<$list filter="[sameday{!!modified}!is[system]!sort[modified]]"> -
-<$link to={{!!title}}><$view field="title"/> -
- -
- -``` - -Here, the outer list filter selects each discrete day found in the `modified` field, while the inner list filter selects all the tiddlers dated the same day in the `modified` field. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/system/wikitext-macros.tid b/editions/tw5.com/tiddlers/system/wikitext-macros.tid index f919d3fce..78705fc24 100644 --- a/editions/tw5.com/tiddlers/system/wikitext-macros.tid +++ b/editions/tw5.com/tiddlers/system/wikitext-macros.tid @@ -28,3 +28,13 @@ Renders as: $src$ \end + +\define tw-code(tiddler) +
<$view tiddler="$tiddler$" format="text"/>
+\end + +\define tw-code-link(tiddler) +[[$tiddler$]]: + +<> +\end \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ListWidget.tid b/editions/tw5.com/tiddlers/widgets/ListWidget.tid index 7bb88cbce..3894c9170 100644 --- a/editions/tw5.com/tiddlers/widgets/ListWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/ListWidget.tid @@ -61,7 +61,7 @@ Displays as: !! Grouped Lists -See NestedLists for how to generate nested and grouped lists using the ListWidget. +See GroupedLists for how to generate nested and grouped lists using the ListWidget. ! Content and Attributes