mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 00:50:28 +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:
parent
2ff7e0c6c6
commit
80631b35ea
18
editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid
Normal file
18
editions/tw5.com/tiddlers/demonstrations/GroupedLists.tid
Normal 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">>
|
@ -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.
|
@ -28,3 +28,13 @@ Renders as:
|
||||
$src$
|
||||
|
||||
\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
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user