1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 20:10:03 +00:00
TiddlyWiki5/plugins/tiddlywiki/text-slicer/template-display-document.tid
Jermolene abd8201aaa Text-slicer refactoring
Substantially cleaning up the main slicer code
2015-08-29 15:23:31 +01:00

48 lines
1.3 KiB
Plaintext

title: $:/plugins/tiddlywiki/text-slicer/templates/display-document
\define config-show-toolbar()
$:/plugins/tiddlywiki/text-slicer/config/show-toolbar/$(currentTiddler)$
\end
\define config-view-type()
$:/plugins/tiddlywiki/text-slicer/config/view-type/$(currentTiddler)$
\end
\define toc-document()
<<display-heading-tiddler level:'h1'>>
\end
\define display-document()
<$set name="tv-show-toolbar" value={{$(config-show-toolbar)$}}>
View: <$select tiddler=<<config-view-type>> default="toc-tabbed-internal-nav">
<option value="toc-document">Document</option>
<option value="toc-selective-expandable">Outline</option>
<option value="toc-tabbed-internal-nav">Tabbed outline</option>
</$select>
<$checkbox tiddler=<<config-show-toolbar>> field="text" checked="yes" unchecked="no" default="no"> Show toolbar</$checkbox>
<div class='tc-table-of-contents'>
<$set name="tv-show-toolbar" value={{$(config-show-toolbar)$}}>
<$list filter="[field:title[$(config-view-type)$]]" variable="listItem" emptyMessage="""
<$macrocall $name="toc-tabbed-internal-nav" tag=<<currentTiddler>> template="$:/plugins/tiddlywiki/text-slicer/templates/toc-entry"/>
""">
<$macrocall $name={{$(config-view-type)$}} tag=<<currentTiddler>> template="$:/plugins/tiddlywiki/text-slicer/templates/toc-entry"/>
</$list>
</$set>
</div>
</$set>
\end
<<display-document>>