1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-24 22:33:16 +00:00

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`.
This commit is contained in:
Tobias Beer 2015-01-11 11:55:22 +01:00
parent 2ff7e0c6c6
commit 80631b35ea
4 changed files with 29 additions and 45 deletions

View File

@ -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.
<<tw-code "$:/core/ui/MoreSideBar/Types">>
!! 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.
<<tw-code-link "$:/core/macros/timeline">>

View File

@ -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]]">
<div class="tc-menu-list-item">
<$view field="type"/>
<$list filter="[type{!!type}!is[system]sort[title]]">
<div class="tc-menu-list-subitem">
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
</div>
</$list>
```
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]]">
<div class="tc-menu-list-item">
<$view field="modified" format="date" template="DDth MMM YYYY"/>
<$list filter="[sameday{!!modified}!is[system]!sort[modified]]">
<div class="tc-menu-list-subitem">
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
</div>
</$list>
```
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.

View File

@ -28,3 +28,13 @@ Renders as:
$src$ $src$
\end \end
\define tw-code(tiddler)
<pre><code><$view tiddler="$tiddler$" format="text"/></code></pre>
\end
\define tw-code-link(tiddler)
[[$tiddler$]]:
<<tw-code $tiddler$>>
\end

View File

@ -61,7 +61,7 @@ Displays as:
!! Grouped Lists !! 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 ! Content and Attributes