-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
89 lines (88 loc) · 3.3 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
<!doctype html>
<html>
<head>
<link data-trunk rel="copy-file" href="assets/simple-notify.min.js" />
<link data-trunk rel="copy-file" href="assets/split-grid.js" />
<link data-trunk rel="copy-file" href="assets/index.js" />
<link data-trunk rel="css" href="assets/index.css" />
<link data-trunk rel="css" href="assets/simple-notify.min.css" />
<link data-trunk rel="copy-file" href="assets/favicon.ico" />
<link
data-trunk
rel="copy-dir"
href="assets/fonts/"
data-target-path="fonts"
/>
<link defer data-trunk rel="rust" data-wasm-opt="s" />
<!-- JS -->
<script data-trunk src="./simple-notify.min.js"></script>
<script data-trunk src="./index.js"></script>
<script data-trunk src="./split-grid.js"></script>
</head>
<body>
<div class="content">
<textarea id="code" autofocus placeholder="= My first title"></textarea>
<div class="gutter-col gutter-col-1"></div>
<div id="output">
<embed id="pdf" type="application/pdf" />
</div>
</div>
<div id="footer">
<button id="settings-button">Settings</button>
<button id="package-button">Packages</button>
<button id="about-button">About</button>
<div class="buffer"></div>
<a href="https://typst.app/docs/" target="_blank">Typst</a>
<a href="https://github.com/data-niklas/typst_live" target="_blank">Github</a>
<label id="version">
<link data-trunk rel="inline" href="version.txt" type="html" />
</label>
</div>
<dialog id="package-dialog">
<h1>Installed packages</h1>
<table>
<thead>
<tr>
<th>Namespace</th>
<th>Name</th>
<th>Version</th>
<th></th>
</tr>
</thead>
<tbody id="package-list"></tbody>
</table>
<h1>Install package</h1>
<input
type="text"
id="package-input"
placeholder="@namespace/name:version"
/>
</dialog>
<dialog id="settings-dialog">
<h2>Save:</h2>
<div class="row">
Automatically
<input type="checkbox" class="toggle" id="save-toggle" /><label
class="toggle"
for="save-toggle"
>Toggle</label
>
Ctrl+S
</div>
</dialog>
<dialog id="about-dialog">
<h2>Goal</h2>
<p>Creating a quick and simple way to test Typst code without needing to install Typst.</p>
<h2>How to install packages</h2>
<p>
Packages consist of a <b>namespace</b>, <b>name</b> and <b>version</b>. To install a package, go to <b>Packages -> Install package</b>. Then paste your package into the input field and press enter.<br>The package needs to be in the format <b>@namespace/name:version</b>.
<br>Example: <b>@preview/syntree:0.1.0</b><br>
Usually you would obtain that string by copying from an import directive in your Typst document.<br>Currently only packages under the preview namespace are supported. For a list of all packages, visit <a href="https://typst.app/docs/packages/">the official Typst page</a>
</p>
</dialog>
<dialog aria-modal="true" id="loading-dialog">
<p id="fonts-dl-step">Downloading fonts <span class="spinner"/></p>
<p id="typst-step">Initializing typst <span class="spinner"/></p>
<dialog>
</body>
</html>