1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Text-slicer: Add selectable output views

This commit is contained in:
Jermolene 2015-08-17 11:16:53 -04:00
parent 74bd6e8232
commit f443719223
2 changed files with 26 additions and 1 deletions

View File

@ -4,16 +4,38 @@ title: $:/plugins/tiddlywiki/text-slicer/templates/display-document
$:/plugins/tiddlywiki/text-slicer/config/show-toolbar/$(currentTiddler)$
\end
\define config-view-type()
$:/plugins/tiddlywiki/text-slicer/config/view-type/$(currentTiddler)$
\end
\define display-document()
<<display-heading-tiddler level:'h1'>>
\end
\define display-tiddler()
<$set name="tv-show-toolbar" value={{$(config-show-toolbar)$}}>
View: <$select tiddler=<<config-view-type>> default="display-document">
<option value="display-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)$}}>
<$macrocall $name="toc-tabbed-internal-nav" tag=<<currentTiddler>>/>
<$list filter="[field:title[$(config-view-type)$]]" variable="listItem" emptyMessage="""
<$macrocall $name="display-document" 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>

View File

@ -0,0 +1,3 @@
title: $:/plugins/tiddlywiki/text-slicer/templates/toc-entry
<$transclude/>