1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-05 23:10:28 +00:00

Make preview templates tag driven and extensible

This commit is contained in:
Jeremy Ruston 2024-11-08 09:12:48 +00:00
parent 250e57cd79
commit 1be89a28bf
10 changed files with 72 additions and 33 deletions

View File

@ -0,0 +1,8 @@
title: $:/core/ui/Palettes/Preview/Sidebar/Search
tags: $:/tags/Preview/SideBar
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-sidebar-search" styleName="background-color" styleColour="background">
<$colour.div class="tc-palette-preview-thumbnail-sidebar-search-box">
</$colour.div>
</$colour.div>

View File

@ -0,0 +1,7 @@
title: $:/core/ui/Palettes/Preview/Sidebar/Subtitle
tags: $:/tags/Preview/SideBar
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-sidebar-subtitle">
a non-linear personal web notebook
</$colour.div>

View File

@ -0,0 +1,7 @@
title: $:/core/ui/Palettes/Preview/Sidebar/Title
tags: $:/tags/Preview/SideBar
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-sidebar-title">
~TiddlyWiki
</$colour.div>

View File

@ -0,0 +1,10 @@
title: $:/core/ui/Palettes/Preview/Tiddler
tags: $:/tags/Preview/Story
\parameters (title)
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-tiddler" styleName="background-color" styleColour="tiddler-background">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Preview/Tiddler]!has[draft.of]]" variable="componentTitle">
<$transclude $tiddler=<<componentTitle>> title=<<title>>/>
</$list>
</$colour.div>

View File

@ -0,0 +1,7 @@
title: $:/core/ui/Palettes/Preview/Tiddler/Body
tags: $:/tags/Preview/Tiddler
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-tiddler-body" styleName="color" styleColour="foreground">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras non arcu ultricies, egestas odio tempus, vestibulum ipsum. Praesent diam lorem, elementum in venenatis eget, tincidunt quis lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam efficitur velit tortor, sit amet tristique felis viverra sit amet. Nullam posuere facilisis purus sed consectetur. Integer vel elit euismod, posuere ligula et, dictum tellus. Donec in odio diam. Sed metus magna, placerat at ligula et, imperdiet sagittis ex.
</$colour.div>

View File

@ -0,0 +1,14 @@
title: $:/core/ui/Palettes/Preview/Tiddler/Header
tags: $:/tags/Preview/Tiddler
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-tiddler-header">
<$colour.div class="tc-palette-preview-thumbnail-tiddler-title" styleName="color" styleColour="tiddler-title-foreground">
<$text text=<<title>>/>
</$colour.div>
<$colour.div class="tc-palette-preview-thumbnail-tiddler-toolbar" styleName="fill" styleColour="tiddler-controls-foreground">
{{$:/core/images/down-arrow}}
{{$:/core/images/edit-button}}
{{$:/core/images/close-button}}
</$colour.div>
</$colour.div>

View File

@ -0,0 +1,7 @@
title: $:/core/ui/Palettes/Preview/Tiddler/Subtitle
tags: $:/tags/Preview/Tiddler
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-tiddler-subtitle" styleName="color" styleColour="tiddler-subtitle-foreground">
Motovun Jack
</$colour.div>

View File

@ -25,44 +25,19 @@ title: $:/snippets/currpalettepreview
<%endif%>
\end $colour.div
\procedure palette-preview-thumbnail-tiddler(title)
<$colour.div class="tc-palette-preview-thumbnail-tiddler" styleName="background-color" styleColour="tiddler-background">
<$colour.div class="tc-palette-preview-thumbnail-tiddler-header">
<$colour.div class="tc-palette-preview-thumbnail-tiddler-title" styleName="color" styleColour="tiddler-title-foreground">
<$text text=<<title>>/>
</$colour.div>
<$colour.div class="tc-palette-preview-thumbnail-tiddler-toolbar" styleName="fill" styleColour="tiddler-controls-foreground">
{{$:/core/images/down-arrow}}
{{$:/core/images/edit-button}}
{{$:/core/images/close-button}}
</$colour.div>
</$colour.div>
<$colour.div class="tc-palette-preview-thumbnail-tiddler-subtitle" styleName="color" styleColour="tiddler-subtitle-foreground">
Motovun Jack
</$colour.div>
<$colour.div class="tc-palette-preview-thumbnail-tiddler-body" styleName="color" styleColour="foreground">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras non arcu ultricies, egestas odio tempus, vestibulum ipsum. Praesent diam lorem, elementum in venenatis eget, tincidunt quis lacus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam efficitur velit tortor, sit amet tristique felis viverra sit amet. Nullam posuere facilisis purus sed consectetur. Integer vel elit euismod, posuere ligula et, dictum tellus. Donec in odio diam. Sed metus magna, placerat at ligula et, imperdiet sagittis ex.
</$colour.div>
</$colour.div>
\end palette-preview-thumbnail-tiddler
\procedure palette-preview-thumbnail()
<$colour.div class="tc-palette-preview-thumbnail" styleName="background-color" styleColour="page-background">
<$colour.div class="tc-palette-preview-thumbnail-story">
<<palette-preview-thumbnail-tiddler "HelloThere">>
<<palette-preview-thumbnail-tiddler "Getting Started">>
<$list filter="HelloThere GettingStarted" variable="title">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Preview/Story]!has[draft.of]]" variable="componentTitle">
<$transclude $tiddler=<<componentTitle>> title=<<title>>/>
</$list>
</$list>
</$colour.div>
<$colour.div class="tc-palette-preview-thumbnail-sidebar" styleName="color" styleColour="sidebar-foreground">
<$colour.div class="tc-palette-preview-thumbnail-sidebar-title">
~TiddlyWiki
</$colour.div>
<$colour.div class="tc-palette-preview-thumbnail-sidebar-subtitle">
a non-linear personal web notebook
</$colour.div>
<$colour.div class="tc-palette-preview-thumbnail-sidebar-search" styleName="background-color" styleColour="background">
<$colour.div class="tc-palette-preview-thumbnail-sidebar-search-box">
</$colour.div>
</$colour.div>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Preview/SideBar]!has[draft.of]]" variable="componentTitle">
<$transclude $tiddler=<<componentTitle>> title=<<title>>/>
</$list>
</$colour.div>
</$colour.div>
\end palette-preview-thumbnail

View File

@ -0,0 +1,2 @@
title: $:/tags/Preview/SideBar
list: $:/core/ui/Palettes/Preview/Sidebar/Title $:/core/ui/Palettes/Preview/Sidebar/Subtitle $:/core/ui/Palettes/Preview/Sidebar/Search

View File

@ -0,0 +1,2 @@
title: $:/tags/Preview/Tiddler
list: $:/core/ui/Palettes/Preview/Tiddler/Header $:/core/ui/Palettes/Preview/Tiddler/Subtitle $:/core/ui/Palettes/Preview/Tiddler/Body