-
Notifications
You must be signed in to change notification settings - Fork 4
/
options.html
330 lines (320 loc) · 19.2 KB
/
options.html
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Booksidian: Options</title>
<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
</head>
<body>
<div class="container mb-3">
<div class="row mt-3">
<h1><img src="booksidian.png" alt="booksidian logo"/> Booksidian Options</h1>
</div>
<ul class="nav nav-tabs" id="template-options-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="tab-gr" data-bs-toggle="tab" data-bs-target="#options-gr" type="button" role="tab" aria-controls="options-gr" aria-selected="true">Books (Goodreads)</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="tab-yt" data-bs-toggle="tab" data-bs-target="#options-yt" type="button" role="tab" aria-controls="options-yt" aria-selected="false">Videos (YouTube)</button>
</li>
</ul>
<div class="tab-content" id="template-options-tab-content">
<div class="tab-pane fade show active" id="options-gr" role="tabpanel" aria-labelledby="options-gr">
<div class="row mt-3">
<h3>File Options</h3>
</div>
<div class="row">
<div class="form-floating col-6 mb-3 mt-3 ml-auto gx-1">
<input type="text" class="form-control" id="vault">
<label for="vault">Vault</label>
</div>
</div>
<div class="row">
<div class="form-floating col-6 mb-3 mt-3 ml-auto gx-1">
<input type="text" class="form-control" id="file_location">
<label for="file_location">New note location (leave empty for top-level note)</label>
</div>
</div>
<div class="row mt-3">
<h3>Template Options</h3>
</div>
<div class="row">
<div class="col-6">
<p>
You can use book information in the note title and content templates - parameter names
are surrounded with double curly braces - for example, <code>{{ short title }}</code>. The preview pane
will show you how your template will render with an example book.
</p>
</div>
<div class="col-6">
<button class="btn btn-outline-primary" type="button" data-bs-toggle="collapse" data-bs-target="#param_table" aria-expanded="false" aria-controls="param_table">
Show available parameters
</button>
</div>
<div class="collapse mt-3" id="param_table">
<div class="card card-body">
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped">
<thead>
<tr>
<th scope="col">Parameter Name</th>
<th scope="col">Description</th>
<th scope="col">Example Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>full_title</code></td>
<td>The full title of the book. Note that this may include colons, which aren't legal note name in Obsidian (use <code>short_title</code> instead)</td>
<td class="booksidian_template">{{ full_title }}</td>
</tr>
<tr>
<td><code>short_title</code></td>
<td>the title of the book up to the first colon</td>
<td class="booksidian_template">{{ short_title }}</td>
</tr>
<tr>
<td><code>publication_year</code></td>
<td>the publication year of the book's first edition</td>
<td class="booksidian_template">{{ publication_year }}</td>
</tr>
<tr>
<td><code>formatted_authors</code></td>
<td>a comma separated list of authors, surrounded with Obsidian link notation</td>
<td class="booksidian_template">{{ formatted_authors }}</td>
</tr>
<tr>
<td><code>cover_image_url</code></td>
<td>a URL for the main Goodreads cover image</td>
<td class="booksidian_template">{{ cover_image_url }}</td>
</tr>
<tr>
<td><code>cover_image</code></td>
<td>same as the above URL, but embedded as a Markdown image</td>
<td class="booksidian_template">{{ cover_image }}</td>
</tr>
<tr>
<td><code>abstract</code></td>
<td>the book's description from the page</td>
<td class="booksidian_template">{{ abstract }}</td>
</tr>
<tr>
<td><code>series</code></td>
<td>the book's series data</td>
<td class="booksidian_template">{{ series }}</td>
</tr>
<tr>
<td><code>rating</code></td>
<td>the book's rating on a 5 star scale</td>
<td class="booksidian_template">{{ rating }}</td>
</tr>
<tr>
<td><code>rating_count</code></td>
<td>the book's number of ratings</td>
<td class="booksidian_template">{{ rating_count }}</td>
</tr>
<tr>
<td><code>total_pages</code></td>
<td>the number of pages in the book</td>
<td class="booksidian_template">{{ total_pages }}</td>
</tr>
<tr>
<td><code>isbn13</code></td>
<td>the book's ISBN-13 ID (may not exist)</td>
<td class="booksidian_template">{{ isbn13 }}</td>
</tr>
<tr>
<td><code>item_url</code></td>
<td>the URL for this book on Goodreads</td>
<td class="booksidian_template">{{ item_url }}</td>
</tr>
<tr>
<td><code>date</code></td>
<td>
Displays the current date and time according to the
<a href="https://moment.github.io/luxon/#/formatting?id=table-of-tokens">specified format</a>.
Defaults to <code>yyyy-MM-dd</code> if no format is specified. Specify a format
with a colon after the variable name.
</td>
<td>
<code>{{ date }}</code> → <span class="booksidian_template">{{ date }}</span><br/>
<code>{{ date:yyyy-MM }}</code> → <span class="booksidian_template">{{ date:yyyy-MM }}</span><br/>
<code>{{ date:DDDD }}</code> → <span class="booksidian_template">{{ date:DDDD}}</span><br/>
<code>{{ date:HH:mm }}</code> → <span class="booksidian_template">{{ date:HH:mm }}</span><br/>
</td>
</tr>
<tr>
<td><code>time</code></td>
<td>same as <code>date</code>, but defaults to <code>HH:mm</code></td>
<td class="booksidian_template">{{ time }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-6 mb-3 form-floating mt-3 ml-auto gx-1">
<input type="text" class="form-control" id="note_title">
<label for="note_title" class="form-label">Note title template (you can use book parameters here!)</label>
</div>
<div class="col-6 mb-3 form-floating mt-3 ml-auto gx-1">
<input type="text" class="form-control" id="note_title_preview" placeholder="preview" disabled>
<label for="note_title_preview" class="form-label">Note title preview</label>
</div>
</div>
<div class="row">
<div class="col-6 mb-3 form-floating mt-3 ml-auto gx-1">
<textarea class="form-control" id="note_content" style="height: 300px"></textarea>
<label for="note_content" class="form-label">Note content template (you can use book parameters here!)</label>
</div>
<div class="col-6 mb-3 form-floating mt-3 ml-auto gx-1">
<textarea class="form-control" id="note_content_preview" style="height: 300px" placeholder="preview" disabled></textarea>
<label for="note_content_preview" class="form-label">Note content preview</label>
</div>
</div>
</div>
<!-- YOUTUBE !-->
<div class="tab-pane fade" id="options-yt" role="tabpanel" aria-labelledby="options-yt">
<div class="row mt-3">
<h3>File Options</h3>
</div>
<div class="row">
<div class="form-floating col-6 mb-3 mt-3 ml-auto gx-1">
<input type="text" class="form-control" id="vault-yt">
<label for="vault-yt">Vault</label>
</div>
</div>
<div class="row">
<div class="form-floating col-6 mb-3 mt-3 ml-auto gx-1">
<input type="text" class="form-control" id="file_location_yt">
<label for="file_location_yt">New note location (leave empty for top-level note)</label>
</div>
</div>
<div class="row mt-3">
<h3>Template Options</h3>
</div>
<div class="row">
<div class="col-6">
<p>
You can use book information in the note title and content templates - parameter names
are surrounded with double curly braces - for example, <code>{{ short title }}</code>. The preview pane
will show you how your template will render with an example video.
</p>
</div>
<div class="col-6">
<button class="btn btn-outline-primary" type="button" data-bs-toggle="collapse" data-bs-target="#param_table_yt" aria-expanded="false" aria-controls="param_table_yt">
Show available parameters
</button>
</div>
<div class="collapse mt-3" id="param_table_yt">
<div class="card card-body">
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped">
<thead>
<tr>
<th scope="col">Parameter Name</th>
<th scope="col">Description</th>
<th scope="col">Example Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>full_title</code></td>
<td>The full title of the video. Note that this may include characters which aren't legal note names in Obsidian (use <code>short_title</code> instead)</td>
<td class="booksidian_template_yt">{{ full_title }}</td>
</tr>
<tr>
<td><code>short_title</code></td>
<td>the title of the video up to the first illegal character</td>
<td class="booksidian_template_yt">{{ short_title }}</td>
</tr>
<tr>
<td><code>channel</code></td>
<td>the YouTube channel name</td>
<td class="booksidian_template_yt">{{ channel }}</td>
</tr>
<tr>
<td><code>date</code></td>
<td>
Displays the current date and time according to the
<a href="https://moment.github.io/luxon/#/formatting?id=table-of-tokens">specified format</a>.
Defaults to <code>yyyy-MM-dd</code> if no format is specified. Specify a format
with a colon after the variable name.
</td>
<td>
<code>{{ date }}</code> → <span class="booksidian_template_yt">{{ date }}</span><br/>
<code>{{ date:yyyy-MM }}</code> → <span class="booksidian_template_yt">{{ date:yyyy-MM }}</span><br/>
<code>{{ date:DDDD }}</code> → <span class="booksidian_template_yt">{{ date:DDDD}}</span><br/>
<code>{{ date:HH:mm }}</code> → <span class="booksidian_template_yt">{{ date:HH:mm }}</span><br/>
</td>
</tr>
<tr>
<td><code>time</code></td>
<td>same as <code>date</code>, but defaults to <code>HH:mm</code></td>
<td class="booksidian_template_yt">{{ time }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-6 mb-3 form-floating mt-3 ml-auto gx-1">
<input type="text" class="form-control" id="note_title_yt">
<label for="note_title_yt" class="form-label">Note title template (you can use video parameters here!)</label>
</div>
<div class="col-6 mb-3 form-floating mt-3 ml-auto gx-1">
<input type="text" class="form-control" id="note_title_preview_yt" placeholder="preview" disabled>
<label for="note_title_preview_yt" class="form-label">Note title preview</label>
</div>
</div>
<div class="row">
<div class="col-6 mb-3 form-floating mt-3 ml-auto gx-1">
<textarea class="form-control" id="note_content_yt" style="height: 300px"></textarea>
<label for="note_content_yt" class="form-label">Note content template (you can use video parameters here!)</label>
</div>
<div class="col-6 mb-3 form-floating mt-3 ml-auto gx-1">
<textarea class="form-control" id="note_content_preview_yt" style="height: 300px" placeholder="preview" disabled></textarea>
<label for="note_content_preview_yt" class="form-label">Note content preview</label>
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-6 mb-3">
<div class="row justify-content-md-left">
<div class="col-md-auto">
<button class="btn btn-primary" id="save">Save</button>
</div>
<div class="col-md-auto">
<button class="btn btn-secondary" id="restore_defaults">Restore Defaults</button>
</div>
<div class="col-md-auto">
<div id="status"></div>
</div>
</div>
</div>
</div>
</div>
<footer class="text-lg-start bg-light text-muted fixed-bottom">
<div class="container text-center">
<div><a href="https://github.com/Nurdok/booksidian">Homepage</a> | <a href="https://github.com/Nurdok/booksidian/issues/new">Report Issue</a></div>
</div>
</footer>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="third_party/jquery-3.6.0.min.js"></script>
<script src="third_party/popper.min.js"></script>
<script src="third_party/bootstrap.bundle.min.js"></script>
<script type="module" src="options.js"></script>
</body>
</html>