mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-29 14:47:40 +00:00
Text-slicer: add support for exclude filters
The exclude filter `+[tag[intro]]` will produce a document that only includes the paragraphs with the tag “intro”. These are derived from the paragraphs in the original document with the CSS class “intro”.
This commit is contained in:
@@ -21,10 +21,14 @@ $:/config/plugins/tiddlywiki/text-slicer/heading-status/$(currentTiddler)$
|
||||
|
||||
<$set name="tv-show-toolbar" value={{$(config-show-toolbar)$}}>
|
||||
|
||||
<$set name="tv-exclude-filter" value={{!!toc-exclude-filter}}>
|
||||
|
||||
<$list filter="[list<currentTiddler>!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler" listItem="item"/>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/interactive/item
|
||||
|
||||
\define body()
|
||||
<$link tag="li" class="tc-document-tiddler-link">
|
||||
|
||||
<$transclude/>
|
||||
|
||||
</$link>
|
||||
\end
|
||||
|
||||
<<body>>
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/interactive/list
|
||||
|
||||
\define body(type:"ul")
|
||||
<$type$>
|
||||
<$list filter={{!!text}} template="$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler" listItem="item"/>
|
||||
</$type$>
|
||||
\end
|
||||
|
||||
<$macrocall $name="body" type={{!!toc-list-type}}/>
|
||||
{{||$:/plugins/tiddlywiki/text-slicer/templates/static/list}}
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/interactive/paragraph
|
||||
|
||||
\define body()
|
||||
<$link tag="div" class="tc-document-tiddler-link">
|
||||
|
||||
<$list filter="""[all[current]] $(tv-exclude-filter)$""" listItem="item">
|
||||
|
||||
<$transclude/>
|
||||
|
||||
</$list>
|
||||
|
||||
</$link>
|
||||
\end
|
||||
|
||||
<<body>>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/document
|
||||
|
||||
<$set name="tv-exclude-filter" value={{!!toc-exclude-filter}}>
|
||||
|
||||
<$list filter="[list<currentTiddler>!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler" listItem="item"/>
|
||||
|
||||
</$set>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/item
|
||||
|
||||
<$link tag="li" class="tc-document-tiddler-link">
|
||||
\define body()
|
||||
<li class="tc-document-tiddler-link">
|
||||
|
||||
<$transclude/>
|
||||
|
||||
</$link>
|
||||
</li>
|
||||
\end
|
||||
|
||||
<<body>>
|
||||
|
||||
@@ -2,7 +2,9 @@ title: $:/plugins/tiddlywiki/text-slicer/templates/static/list
|
||||
|
||||
\define body(type:"ul")
|
||||
<$type$>
|
||||
<$list filter="""[all[current]] $(tv-exclude-filter)$""" listItem="item">
|
||||
<$list filter={{!!text}} template="$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler" listItem="item"/>
|
||||
</$list>
|
||||
</$type$>
|
||||
\end
|
||||
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/templates/static/paragraph
|
||||
|
||||
<$link tag="div" class="tc-document-tiddler-link">
|
||||
\define body()
|
||||
<div class="tc-document-tiddler-link">
|
||||
|
||||
<$list filter="""[all[current]] $(tv-exclude-filter)$""" listItem="item">
|
||||
|
||||
<$transclude/>
|
||||
|
||||
</$link>
|
||||
</$list>
|
||||
|
||||
</div>
|
||||
\end
|
||||
|
||||
<<body>>
|
||||
|
||||
@@ -4,7 +4,7 @@ title: $:/plugins/tiddlywiki/text-slicer/ui/document/header
|
||||
|
||||
''Document'': <$link><$view field="title"/></$link>
|
||||
|
||||
''Exclude tags'': <$edit-text field="toc-exclude-tags"/>
|
||||
''Exclude filter'': <$edit-text field="toc-exclude-filter"/>
|
||||
|
||||
<$checkbox tiddler=<<config-show-toolbar>> field="text" checked="yes" unchecked="no" default="no"> Show toolbar</$checkbox>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user