-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBook Display Template.tid
108 lines (107 loc) · 3.79 KB
/
Book Display Template.tid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
tags: $:/tags/ViewTemplate
title: $:/plugins/OokTech/TiddlyLivre/Book Display Template
type: text/vnd.tiddlywiki
<$list
filter='[<currentTiddler>tag[Book]]'
>
<h1
style='text-align:center;font-size:3em;'
>
<$view
field='caption'
>
<$view
field='title'
/>
</$view>
</h1>
<div
style='text-align:center'
>
Jump to chapter:
<$list
filter='[book<currentTiddler>tag[Chapter]nsort[order]]'
variable=thisChapter
>
<$list
filter='[<thisChapter>!field:title{$:/settings/TiddlyLivre!!chapter}]'
variable=dummy
emptyMessage="""<$count filter='[[dummy]][book<currentTiddler>tag[Chapter]nsort[order]allbefore<thisChapter>]'/>"""
>
<$button
class='tc-btn-invisible tc-tiddlylink'
>
<$count
filter='[[dummy]][book<currentTiddler>tag[Chapter]nsort[order]allbefore<thisChapter>]'
/>
<$macrocall
$name=OpenChapter
Chapter=<<thisChapter>>
/>
</$button>
</$list>
</$list>
</div>
<$list
variable=FirstChapter
filter='[book<currentTiddler>tag[Chapter]nsort[order]first[]]'
>
<$list
variable=CurrentChapter
filter='[list[$:/StoryList]after<currentTiddler>get[title]][[dummy]]+[limit[1]]'
>
<$list
variable=NextChapter
filter='[book<currentTiddler>tag[Chapter]nsort[order]after<CurrentChapter>][[dummy]]+[limit[1]]'
>
<$list
variable=PreviousChapter
filter='[book<currentTiddler>tag[Chapter]nsort[order]before<CurrentChapter>][[dummy]]+[limit[1]]'
>
<div
style='text-align:center'
>
<$list
filter='[<PreviousChapter>has[book]]'
variable=dummy
>
<$button>
{{$:/core/images/chevron-left}}
Previous
<$macrocall
$name=OpenChapter
Chapter=<<PreviousChapter>>
/>
</$button>
</$list>
<$list
filter='[[$:/settings/TiddlyLivre]!book<currentTiddler>]'
variable=dummy
>
<$button>
Open Book
<$macrocall
$name=OpenChapter
Chapter=<<FirstChapter>>
/>
</$button>
</$list>
<$list
filter='[<NextChapter>has[book]]'
variable=dummy
>
<$button>
Next
{{$:/core/images/chevron-right}}
<$macrocall
$name=OpenChapter
Chapter=<<NextChapter>>
/>
</$button>
</$list>
</div>
</$list>
</$list>
</$list>
</$list>
</$list>