mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-01 22:46:48 +00:00
Major updates to text-slicer plugin
* In the interests of performance and expressiveness, switched to using a Sax parser instead of a DOM implementation. * Use extensible declarative rules to control the slicing process * Added new optional set of rules for slicing by heading, where the paragraphs underneath a heading are packed into the same tiddler as the heading * Added a modal dialogue for specifying parameters when slicing in the browser
This commit is contained in:
@@ -22,12 +22,12 @@ $:/state/plugins/tiddlywiki/text-slicer/heading-status/$(currentTiddler)$
|
||||
<div class="tc-sliced-document">
|
||||
<div class="tc-sliced-document-header">
|
||||
<div class="tc-document-tiddler-toolbar">
|
||||
<$reveal type="nomatch" state=<<config-document-status>> text="close" default="open">
|
||||
<$reveal type="nomatch" state=<<config-document-status>> text="close" default="open" tag="div">
|
||||
<$button set=<<config-document-status>> setTo="close" class="tc-btn-invisible">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<config-document-status>> text="close" default="open">
|
||||
<$reveal type="match" state=<<config-document-status>> text="close" default="open" tag="div">
|
||||
<$button set=<<config-document-status>> setTo="open" class="tc-btn-invisible">
|
||||
{{$:/core/images/right-arrow}}
|
||||
</$button>
|
||||
@@ -35,7 +35,7 @@ $:/state/plugins/tiddlywiki/text-slicer/heading-status/$(currentTiddler)$
|
||||
</div>
|
||||
<h1 class="tc-sliced-document-title">''Document'': <$link><$view field="title"/></$link></h1>
|
||||
</div>
|
||||
<$reveal type="nomatch" state=<<config-document-status>> text="close" default="open">
|
||||
<$reveal type="nomatch" state=<<config-document-status>> text="close" default="open" tag="div">
|
||||
{{||$:/plugins/tiddlywiki/text-slicer/ui/document/header}}
|
||||
<div class='tc-sliced-document-body'>
|
||||
<$set name="tv-show-toolbar" value={{$(config-show-toolbar)$}}>
|
||||
|
||||
@@ -8,12 +8,12 @@ $(tv-heading-status-config-title)$/$(tv-heading-status-config-prefix)$/$(current
|
||||
<$set name="tv-heading-status-config-title" value=<<config-heading-status>>>
|
||||
<div class="tc-document-tiddler">
|
||||
<div class="tc-document-tiddler-toolbar">
|
||||
<$reveal type="nomatch" state=<<tv-heading-status-config-title>> text="close" default=<<tv-default-heading-state>>>
|
||||
<$reveal type="nomatch" state=<<tv-heading-status-config-title>> text="close" default=<<tv-default-heading-state>> tag="div">
|
||||
<$button set=<<tv-heading-status-config-title>> setTo="close" class="tc-btn-invisible">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<tv-heading-status-config-title>> text="close" default=<<tv-default-heading-state>>>
|
||||
<$reveal type="match" state=<<tv-heading-status-config-title>> text="close" default=<<tv-default-heading-state>> tag="div">
|
||||
<$button set=<<tv-heading-status-config-title>> setTo="open" class="tc-btn-invisible">
|
||||
{{$:/core/images/right-arrow}}
|
||||
</$button>
|
||||
@@ -22,7 +22,7 @@ $(tv-heading-status-config-title)$/$(tv-heading-status-config-prefix)$/$(current
|
||||
<$link tag="$level$" class="tc-document-tiddler-link">
|
||||
<$transclude/>
|
||||
</$link>
|
||||
<$reveal type="nomatch" state=<<tv-heading-status-config-title>> text="close" default=<<tv-default-heading-state>>>
|
||||
<$reveal type="nomatch" state=<<tv-heading-status-config-title>> text="close" default=<<tv-default-heading-state>> tag="div">
|
||||
<$list filter="[list<currentTiddler>!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler"/>
|
||||
</$reveal>
|
||||
</div>
|
||||
|
||||
@@ -1,45 +1,28 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler
|
||||
|
||||
\define if(condition,then,else)
|
||||
<$list filter="""$condition$ +[limit[1]]""" emptyMessage="""$else$""" variable="ignore">
|
||||
$then$
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define include-component(type)
|
||||
<<if "[{!!toc-type}prefix[$type$]]" """
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/$type$" mode="block"/>
|
||||
""">>
|
||||
\end
|
||||
|
||||
<$list filter="[<tv-show-toolbar>prefix[yes]]" variable="hasToolbar">
|
||||
{{||$:/plugins/tiddlywiki/text-slicer/ui/tiddler/toolbar}}
|
||||
</$list>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="document">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/document" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="heading">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/heading" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="paragraph">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/paragraph" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="note">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/note" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="list">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/list" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="item">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/item" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="image">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/image" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="def-list">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/def-list" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="term">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/term" mode="block"/>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state="!!toc-type" text="definition">
|
||||
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/definition" mode="block"/>
|
||||
</$reveal>
|
||||
<<include-component "document">>
|
||||
<<include-component "heading">>
|
||||
<<include-component "paragraph">>
|
||||
<<include-component "note">>
|
||||
<<include-component "list">>
|
||||
<<include-component "item">>
|
||||
<<include-component "image">>
|
||||
<<include-component "def-list">>
|
||||
<<include-component "term">>
|
||||
<<include-component "definition">>
|
||||
|
||||
Reference in New Issue
Block a user