-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstandalone_esm.html
More file actions
59 lines (51 loc) · 2 KB
/
standalone_esm.html
File metadata and controls
59 lines (51 loc) · 2 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Standalone Example - SquibView</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><circle cx='16' cy='16' r='14' fill='%23f57c00' stroke='%23000' stroke-width='1'/><path d='M2 16h28M16 2a14 14 0 0114 14 14 14 0 01-14 14 14 14 0 01-14-14A14 14 0 0116 2zm0 0v28M9 16a7 7 0 0014 0 7 7 0 00-14 0z' fill='none' stroke='%23000' stroke-width='1'/></svg>">
<!-- SquibView CSS -->
<link rel="stylesheet" href="../dist/squibview.min.css">
<!-- Base example styles -->
<link rel="stylesheet" href="examples.css">
<style>
/* Page-specific overrides */
#editor {
height: calc(100vh - 120px);
}
</style>
</head>
<body>
<div class="example-header">
<h1 class="example-title">SquibView Standalone Example (ESM)</h1>
<div class="example-version" id="version-display"></div>
<p class="example-description">
All-inclusive build (3.6MB) with everything pre-bundled - no external dependencies. Works offline, in airgapped environments, or where CDN access is blocked.
</p>
</div>
<div class="editor-container">
<div id="editor"></div>
</div>
<script type="module">
// Import SquibView from the standalone ESM build
import SquibView from '../dist/squibview.standalone.esm.min.js';
// Set version display from the library
if (SquibView.version && SquibView.version.version) {
document.getElementById("version-display").textContent = `Version ${SquibView.version.version}`;
}
// Load default content
fetch('./sample-content.md')
.then(response => response.text())
.then(content => {
// Initialize SquibView
const editor = new SquibView('#editor', {
initialContent: content,
showControls: true,
titleShow: false,
initialView: 'split'
});
});
</script>
</body>
</html>