-
Notifications
You must be signed in to change notification settings - Fork 1
/
tag-overview.js
44 lines (39 loc) · 1.1 KB
/
tag-overview.js
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
// ---- Configuration ----------------------------------------------------------
let tags = [];
// ---- Main -------------------------------------------------------------------
let data = {
tags: tags.map(x => ({ name: x, content: Draft.query('', 'inbox', [ x ]).map(y => y.title)}))
}
let template = `<html>
<head>
<style>
* {
font-family: 'Monaco';
font-size: 9pt;
}
table {
width: 80%;
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
}
td {
border-bottom: 1px solid gray;
}
tr:nth-child(2) td {
border-top: 1px solid gray;
}
</style>
</head>
<body>
{{#tags}}
<table>
<tr><th>{{name}}</th></tr>
{{#content}}
<tr><td>{{.}}</td></tr>
{{/content}}
</table>
{{/tags}}
</body>
</html>`;
HTMLPreview.create().show(MustacheTemplate.createWithTemplate(template).render(data));