-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
254 lines (234 loc) · 7.4 KB
/
index.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
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<title>Glassflame</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Interaction scripts -->
<script type="module" src="src/index.mjs"></script>
<!-- Global style -->
<style>
@import "style/base.css";
@import "style/light.css";
@import "style/dark.css";
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<!-- Templates -->
<template id="template-landing">
<style>
.landing {
margin-left: var(--margins);
margin-right: var(--margins);
max-width: calc(100vw - var(--margins) * 2);
}
.landing-form {
display: flex;
flex-direction: column;
gap: 8px;
}
.landing-form label {
display: flex;
flex-direction: row;
}
.landing-form label span {
width: calc(var(--margins) * 4);
}
.landing-form input {
flex-grow: 1;
}
.landing-form input[type="submit"] {
flex-grow: 0;
}
a {
color: var(--color-accent);
}
</style>
<div class="landing">
<h2>
What is this?
</h2>
<p>
Glassflame is a web viewer for <a href="https://obsidian.md/">Obsidian</a>-like vaults!
</p>
<p>
It's currently in the Alpha development stage, so some features are still missing, but it's already functional!
</p>
<p>
Please report bugs, suggest features, and leave feedback at <a href="https://github.com/Steffo99/obsidian-file-index/issues">the project's issue tracker</a>!
</p>
<h2>
How do I browse a Vault?
</h2>
<p>
To browse a vault, enter its details here:
</p>
<form class="landing-form">
<label>
<span>Vault base URL</span>
<input type="url" name="vault" required placeholder="https://raw.githubusercontent.com/Steffo99/appunti-magistrali/main/">
</label>
<label>
<span>File path</span>
<input type="text" name="path" placeholder="8 - Crittografia applicata/2 - Comunicazione simmetrica/3 - Indistinguibilità/★ mappa concettuale.canvas">
</label>
<input type="submit" value="Open">
</form>
<p>
Alternatively, browse an example vault, such as:
</p>
<ul>
<li><a href="./?vault=https%3A%2F%2Fraw.githubusercontent.com%2FSteffo99%2Fappunti-universitari%2Fmain%2F&path=★ appunti magistrali.md" style="--color-accent: #D14224;">Steffo's University Notes</a></li>
<li><a href="./?vault=https%3A%2F%2Fraw.githubusercontent.com%2Fobsidianmd%2Fobsidian-help%2Fmaster%2Fen%2F&path=Home.md" style="--color-accent: #8A5CF5;">Obsidian's own documentation</a> (no wikilinks)</li>
</ul>
<h2>
Wikilinks are not working!
</h2>
<p>
To resolve Wikilinks, full knowledge of a Vault's contents is required.
</p>
<p>
Obsidian does not include a list of files in a Vault anywhere in it, because it operates under the assumption that this would be trivial to do via the file system.
</p>
<p>
Glassflame, running on the web, does not have this ability, and needs to somehow learn about it.
</p>
<p>
To solve this problem, the <a href="https://github.com/Steffo99/obsidian-file-index"><code>file-index</code></a> plugin was developed; once installed in a given Vault, and once the <code>file-index.json</code> file it generates is published, Glassflame will be able to resolve Wikilinks.
</p>
</div></template>
<template id="template-vault">
<style>
.vault {
margin-left: var(--margins);
margin-right: var(--margins);
}
</style>
<div class="vault">
<slot name="vault-child"></slot>
</div></template>
<template id="template-canvas">
<style>
.canvas {
position: relative;
display: flex;
width: max-content;
height: max-content;
margin-top: 64px;
margin-bottom: 64px;
background-image: url("./style/dot.png");
}
</style>
<div class="canvas">
<slot name="canvas-nodes">{Canvas nodes}</slot>
<slot name="canvas-edges">{Canvas edges}</slot>
</div></template>
<template id="template-display">
<slot name="display-container">{Displayed content}</slot></template>
<template id="template-node-group">
<style>
.node {
outline: var(--node-group-border-width) solid var(--color-canvas);
background-color: color-mix(in srgb, var(--color-canvas) 20%, var(--color-background));
border-radius: 0 8px 8px 8px;
padding: 12px;
}
.node-group-label {
position: relative;
bottom: 14px;
left: -12px;
transform: translateY(-100%);
display: inline-block;
outline: var(--node-group-border-width) solid var(--color-canvas);
background-color: color-mix(in srgb, var(--color-canvas) 20%, var(--color-background));
border-radius: 8px 8px 0 0;
padding: 12px;
}
.node-group-label-title {
margin: 0;
}
</style>
<div class="canvas-item node node-group">
<aside class="node-group-label">
<h1 class="node-group-label-title"><slot name="node-group-label">{Group label}</slot></h1>
</aside>
</div></template>
<template id="template-node-file">
<style>
.node {
outline: var(--node-file-border-width) solid var(--color-canvas);
background-color: color-mix(in srgb, var(--color-canvas) 10%, var(--color-background));
border-radius: 8px;
padding: 12px;
}
.node-file {
overflow-x: clip;
overflow-y: scroll;
}
.node-file-label {
font-size: 2em;
margin-block-start: .67em;
margin-block-end: .67em;
}
</style>
<article class="canvas-item node node-file">
<h1 class="node-file-label">
<slot name="node-file-label">{Node title}</slot>
</h1>
<slot name="node-file-contents">{Node contents}</slot>
</article></template>
<template id="template-node-text">
<style>
.node {
outline: var(--node-file-border-width) solid var(--color-canvas);
background-color: color-mix(in srgb, var(--color-canvas) 10%, var(--color-background));
border-radius: 8px;
padding: 12px;
}
.node-text {
overflow-x: clip;
overflow-y: scroll;
}
</style>
<article class="canvas-item node node-text">
<slot name="node-text-contents">{Node contents}</slot>
</article></template>
<template id="template-edge">
<style>
.edge {
}
</style>
<div class="canvas-item edge">
<slot name="edge-svg">{Edge SVG}</slot>
</div></template>
<template id="template-markdown">
<style>
.markdown {
}
</style>
<div class="markdown">
<slot name="markdown-document">{Markdown text}</slot>
</div></template>
<template id="template-frontmatter">
<style>
.frontmatter {
opacity: 50%;
}
</style>
<div class="frontmatter">
<slot name="frontmatter-contents">{Markdown text}</slot>
</div></template>
<template id="template-hashtag">
<style>
.hashtag {
background-color: color-mix(in srgb, var(--color-accent) 20%, transparent);
color: var(--color-accent);
}
</style>
<span class="hashtag"><slot name="hashtag-tag">{#Hashtag}</slot></span></template>
<template id="template-wikilink">
<slot name="wikilink-anchor">{Wikilink}</slot></template>
<template id="template-math">
<slot name="math-katex">{Math}</slot></template>
</head>
<body is="x-browse"></body>
</html>