mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Text-slicer: Introduce separate static templates
Much easier to have separate sets of templates for interactive vs static document trees
This commit is contained in:
parent
cc4bef9c0e
commit
0be82ea7fb
@ -1,4 +1,3 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/exporters/full-doc
|
||||
tags: $:/tags/ViewTemplate
|
||||
|
||||
<$list filter="[list<currentTiddler>!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler" listItem="item"/>
|
||||
<$list filter="[list<currentTiddler>!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler" listItem="item"/>
|
||||
|
@ -21,7 +21,10 @@ $:/config/plugins/tiddlywiki/text-slicer/heading-status/$(currentTiddler)$
|
||||
|
||||
<$checkbox tiddler=<<config-show-toolbar>> field="text" checked="yes" unchecked="no" default="no"> Show toolbar</$checkbox>
|
||||
|
||||
{{||$:/plugins/tiddlywiki/text-slicer/ui/view-document-button}}
|
||||
<$button>
|
||||
<$action-sendmessage $message="tm-open-window" $param=<<currentTiddler>> template="$:/plugins/tiddlywiki/text-slicer/exporters/full-doc"/>
|
||||
View document
|
||||
</$button>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -8,8 +8,6 @@ $(tv-heading-status-config-title)$/$(currentTiddler)$
|
||||
<$set name="tv-heading-status-config-title" value=<<config-heading-status>>>
|
||||
<div class="tc-document-tiddler">
|
||||
<div class="tc-document-tiddler-toolbar">
|
||||
|
||||
<$list filter="[<tv-show-gadgets>prefix[yes]]" variable="hasToolbar">
|
||||
<$reveal type="nomatch" state=<<tv-heading-status-config-title>> text="open" default=<<tv-default-heading-state>>>
|
||||
<$button set=<<tv-heading-status-config-title>> setTo="open" class="tc-btn-invisible">
|
||||
{{$:/core/images/down-arrow}}
|
||||
@ -20,8 +18,6 @@ $(tv-heading-status-config-title)$/$(currentTiddler)$
|
||||
{{$:/core/images/right-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
</$list>
|
||||
|
||||
</div>
|
||||
<$link tag="$level$" class="tc-document-tiddler-link">
|
||||
<$view field="text"/>
|
||||
|
@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/document
|
||||
|
||||
<$list filter="[list<currentTiddler>!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler" listItem="item"/>
|
10
plugins/tiddlywiki/text-slicer/templates/static/heading.tid
Normal file
10
plugins/tiddlywiki/text-slicer/templates/static/heading.tid
Normal file
@ -0,0 +1,10 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/heading
|
||||
|
||||
\define body(level:"h1")
|
||||
<$level$>
|
||||
<$view field="text"/>
|
||||
</$level$>
|
||||
<$list filter="[tag<currentTiddler>!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler" listItem="item"/>
|
||||
\end
|
||||
|
||||
<$macrocall $name="body" level={{!!toc-heading-level}}/>
|
7
plugins/tiddlywiki/text-slicer/templates/static/item.tid
Normal file
7
plugins/tiddlywiki/text-slicer/templates/static/item.tid
Normal file
@ -0,0 +1,7 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/item
|
||||
|
||||
<$link tag="li" class="tc-document-tiddler-link">
|
||||
|
||||
<$transclude/>
|
||||
|
||||
</$link>
|
9
plugins/tiddlywiki/text-slicer/templates/static/list.tid
Normal file
9
plugins/tiddlywiki/text-slicer/templates/static/list.tid
Normal file
@ -0,0 +1,9 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/list
|
||||
|
||||
\define body(type:"ul")
|
||||
<$type$>
|
||||
<$list filter={{!!text}} template="$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler" listItem="item"/>
|
||||
</$type$>
|
||||
\end
|
||||
|
||||
<$macrocall $name="body" type={{!!toc-list-type}}/>
|
@ -0,0 +1,7 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/paragraph
|
||||
|
||||
<$link tag="div" class="tc-document-tiddler-link">
|
||||
|
||||
<$transclude/>
|
||||
|
||||
</$link>
|
21
plugins/tiddlywiki/text-slicer/templates/static/tiddler.tid
Normal file
21
plugins/tiddlywiki/text-slicer/templates/static/tiddler.tid
Normal file
@ -0,0 +1,21 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/tiddler
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="document">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/static/document" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="heading">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/static/heading" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="paragraph">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/static/paragraph" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="list">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/static/list" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="item">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/static/item" mode="block"/>
|
||||
</$reveal>
|
@ -5,12 +5,8 @@ tags: $:/tags/AboveStory
|
||||
|
||||
<$set name="tv-default-heading-state" value="closed">
|
||||
|
||||
<$set name="tv-show-gadgets" value="yes">
|
||||
|
||||
<$list filter="[toc-type[document]!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/interactive/document"/>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</$scrollable>
|
||||
|
@ -1,7 +1,5 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/ui/toolbar/tiddler-toolbar
|
||||
|
||||
<$list filter="[<tv-show-gadgets>prefix[yes]]" variable="hasToolbar">
|
||||
<div class="tc-slice-toolbar">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TextSlicerToolbar]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||
</div>
|
||||
</$list>
|
||||
|
@ -1,6 +0,0 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/ui/view-document-button
|
||||
|
||||
<$button>
|
||||
<$action-sendmessage $message="tm-open-window" $param=<<currentTiddler>> template="$:/plugins/tiddlywiki/text-slicer/exporters/full-doc"/>
|
||||
View document
|
||||
</$button>
|
@ -13,14 +13,10 @@ tags: $:/tags/ViewTemplate
|
||||
|
||||
<$set name="tv-default-heading-state" value="open">
|
||||
|
||||
<$set name="tv-show-gadgets" value="yes">
|
||||
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler"/>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</div>
|
||||
|
||||
</$reveal>
|
||||
|
Loading…
Reference in New Issue
Block a user