1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-29 15:30:47 +00:00

Use the cascade filter run prefix to choose the view template body template

This commit is contained in:
jeremy@jermolene.com 2021-11-04 20:40:59 +00:00
parent ee32eb909f
commit b1cb211f21
6 changed files with 26 additions and 7 deletions

View File

@ -3,14 +3,10 @@ tags: $:/tags/ViewTemplate
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">
<$list filter="[all[current]!has[plugin-type]!field:hide-body[yes]]">
<$let template={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]get[text]] }}}>
<$transclude>
<$transclude tiddler={{{ [<template>!is[blank]] ~[[$:/core/ui/ViewTemplate/body/default]] }}}/>
<$transclude tiddler="$:/language/MissingTiddler/Hint"/>
</$transclude>
</$list>
</$let>
</$reveal>

View File

@ -0,0 +1,3 @@
title: $:/core/ui/ViewTemplate/body/blank
<!-- Intentionally blank -->

View File

@ -0,0 +1,3 @@
title: $:/core/ui/ViewTemplate/body/code
<$codeblock code={{{ [<currentTiddler>get[text]] }}} language={{{ [<currentTiddler>get[type]else[text/vnd.tiddlywiki]] }}}/>

View File

@ -0,0 +1,7 @@
title: $:/core/ui/ViewTemplate/body/default
<$transclude>
<$transclude tiddler="$:/language/MissingTiddler/Hint"/>
</$transclude>

View File

@ -0,0 +1,7 @@
title: $:/config/ViewTemplateBodyFilters/
tags: $:/tags/ViewTemplateBodyFilter
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/]!field:title[$:/core/readme]!field:title[$:/core/icon]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[limit[1]then[$:/core/ui/ViewTemplate/body/code]]
plugin: [has[plugin-type]then[$:/core/ui/ViewTemplate/body/blank]]
hide-body: [field:hide-body[yes]then[$:/core/ui/ViewTemplate/body/blank]]
default: [[$:/core/ui/ViewTemplate/body/default]]

View File

@ -0,0 +1,3 @@
title: $:/tags/ViewTemplateBodyFilter
list: $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/default