mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Improve text-slicer macros
Encapsulate tiddler display so that we can detect draft tiddlers and display them through their own template
This commit is contained in:
parent
d938c10144
commit
9ec38eef32
@ -1,21 +1,25 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/macros
|
||||
tags: $:/tags/Macro
|
||||
|
||||
\define display-tiddler()
|
||||
<$list filter="[draft.of<currentTiddler>limit[1]]" editTemplate="$:/core/ui/EditTemplate" emptyMessage="""<$transclude mode='block'/>"""/>
|
||||
\end
|
||||
|
||||
\define display-heading-tiddler(level:"h1")
|
||||
<$level$><$view field="title"/></$level$>
|
||||
<$list filter='[tag<currentTiddler>]'>
|
||||
<$list filter='[tag<currentTiddler>!has[draft.of]]'>
|
||||
<$tiddler>
|
||||
<$transclude mode='block'/>
|
||||
<<display-tiddler>>
|
||||
</$tiddler>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define display-list-tiddler(type:"ol")
|
||||
<$type$>
|
||||
<$list filter='[tag<currentTiddler>]'>
|
||||
<$list filter='[tag<currentTiddler>!has[draft.of]]'>
|
||||
<li>
|
||||
<$tiddler>
|
||||
<$transclude mode='block'/>
|
||||
<<display-tiddler>>
|
||||
</$tiddler>
|
||||
</li>
|
||||
</$list>
|
||||
|
Loading…
Reference in New Issue
Block a user