Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
250 lines (223 loc) · 13.6 KB
/
Copy pathindex.html
File metadata and controls
250 lines (223 loc) · 13.6 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<!-- Only local scripts, styles and fonts; no network requests. Remote images in documents are held back by the app until allowed. -->
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self' file:; style-src 'self' file:; font-src 'self' file:; img-src 'self' file: data: blob: https: http:; media-src 'self' file: data: blob: https: http:; connect-src 'none'; object-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'" />
<title>Better MD viewer — Read local markdown files in your browser, on-device</title>
<meta name="description" content="Better MD viewer is a zero-install, on-device reader for local markdown folders. Renders .md, .markdown, and .txt files entirely in your browser — no uploads, no account, no server. Free." />
<meta name="keywords" content="markdown viewer, md reader, local markdown, offline markdown, browser markdown reader, on-device, private notes reader" />
<meta name="robots" content="index,follow,max-image-preview:large" />
<meta name="theme-color" content="#2e3440" />
<link rel="canonical" href="https://asilachev.github.io/better-md-viewer/" />
<!-- Favicons. Bump ?v= when the icon changes; browsers cache favicons hard. -->
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg?v=2" />
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32.png?v=2" />
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png?v=2" />
<!-- Open Graph -->
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Better MD viewer" />
<meta property="og:title" content="Better MD viewer — Read local markdown, on-device" />
<meta property="og:description" content="Zero-install, on-device reader for local markdown folders. No uploads, no account, no server." />
<meta property="og:locale" content="en_US" />
<meta property="og:url" content="https://asilachev.github.io/better-md-viewer/" />
<meta property="og:image" content="https://asilachev.github.io/better-md-viewer/docs/social.png" />
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Better MD viewer — Read local markdown, on-device" />
<meta name="twitter:description" content="Zero-install, on-device reader for local markdown folders. No uploads, no server." />
<meta name="twitter:image" content="https://asilachev.github.io/better-md-viewer/docs/social.png" />
<link rel="stylesheet" href="assets/fonts/fonts.css">
<link rel="stylesheet" href="assets/style.css">
<!-- Structured data: SoftwareApplication -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Better MD viewer",
"description": "Zero-install, on-device reader for local markdown folders. Renders .md, .markdown, and .txt files entirely in your browser.",
"applicationCategory": "UtilitiesApplication",
"operatingSystem": "Web Browser",
"browserRequirements": "Requires a modern browser. File System Access API supported in Chromium-based browsers; upload fallback elsewhere.",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"featureList": [
"Open local folders via File System Access API or upload",
"Drag-and-drop folders or individual .md / .markdown / .txt files",
"Collapsible folder tree with name and full-text search",
"Live reload when files change on disk",
"Links, images and anchors between files in the folder",
"GitHub alerts, footnotes and heading anchors",
"Recent-folder memory via IndexedDB (up to 5)",
"Keyboard navigation (⌘O, j/k, /)",
"Tweakable typography and btop-inspired themes",
"Rendering via Marked with DOMPurify sanitization"
],
"isAccessibleForFree": true,
"inLanguage": "en"
}
</script>
</head>
<body>
<div class="app" id="app">
<header class="topbar">
<button class="icon-btn" id="sidebarToggle" type="button" title="Toggle sidebar (⌘B)" aria-label="Toggle sidebar" aria-controls="sidebar" aria-expanded="true">
<svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><path d="M6 2.5v11"/></svg>
</button>
<div class="brand"><span>better</span><i class="mark" aria-hidden="true"></i><b>md</b></div>
<div class="top-meta">
<span class="status" title="Files are read and rendered in this tab; nothing is uploaded">
<svg width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="7" width="10" height="7" rx="1.5"/><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"/></svg>
<span>On-device</span><span class="dot-sep">·</span><span id="fileCount">no files</span>
</span>
<button class="icon-btn" id="settingsBtn" type="button" title="Settings" aria-label="Settings" aria-expanded="false" aria-controls="tweaks">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
</button>
</div>
</header>
<aside class="sidebar" id="sidebar">
<div class="side-actions">
<button class="btn" id="openFolderBtn" type="button">
<svg width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><path d="M1.5 4.5v8a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H8L6.5 3.5H2.5a1 1 0 0 0-1 1z"/></svg>
<span>Open folder</span>
</button>
<button class="btn ghost" id="openFilesBtn" type="button">
<svg width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><path d="M4 1.5h5l3 3V14a.5.5 0 0 1-.5.5h-7A.5.5 0 0 1 4 14V2a.5.5 0 0 1 0-.5z M9 1.5V4.5h3"/></svg>
<span>Select files</span>
</button>
</div>
<div class="search-wrap" id="searchWrap">
<svg class="mag" width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5 14 14"/></svg>
<input class="search" id="searchInput" type="text" placeholder="Filter files…" spellcheck="false" aria-label="Filter files"/>
<button class="search-mode" id="contentSearchBtn" type="button" aria-pressed="false" title="Also search inside files" aria-label="Also search inside files">
<svg width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><path d="M3 4h10M3 8h10M3 12h6"/></svg>
</button>
</div>
<nav class="side-sections" id="sideSections" aria-label="File list">
<div id="recentsSection"></div>
<div id="filesSection"></div>
</nav>
</aside>
<div class="sidebar-resizer" id="sidebarResizer" role="separator" aria-orientation="vertical" aria-label="Resize sidebar" title="Drag to resize · double-click to reset" tabindex="0"></div>
<main class="main" id="main">
<div class="crumbs" id="crumbs">
<span class="meta">No document selected</span>
</div>
<div class="reader" id="reader" tabindex="0">
<div class="splash" id="splash">
<section class="splash-hero" aria-labelledby="hero-title">
<div class="splash-card">
<div class="eyebrow">On-device markdown reader</div>
<h1 id="hero-title">Read your markdown, locally.</h1>
<p>A clean reader for local <code>.md</code> files. Nothing uploads. Nothing tracks.</p>
<button class="splash-resume" id="splashResume" type="button" hidden>
<span class="resume-label">Continue reading</span>
<span class="resume-name"></span>
<span class="resume-file"></span>
</button>
<div class="splash-drop" id="splashDrop" role="button" tabindex="0" aria-label="Open folder or drop files">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 15V3"/><path d="m7 8 5-5 5 5"/><path d="M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4"/></svg>
<div class="splash-drop-title">Drag a folder or files here</div>
<div class="splash-drop-sub">⌘O to open · .md · .markdown · .txt</div>
</div>
<div class="splash-row">
<div class="splash-feat">
<div class="lbl">01 · On-device</div>
<div class="txt">Rendering happens in your browser. Your notes never leave your machine.</div>
</div>
<div class="splash-feat">
<div class="lbl">02 · Zero install</div>
<div class="txt">No account, no desktop app, no server. Open the page and pick a folder.</div>
</div>
<div class="splash-feat">
<div class="lbl">03 · Resumable</div>
<div class="txt">Recent folders are remembered locally so you land where you left off.</div>
</div>
</div>
</div>
</section>
</div>
</div>
<nav class="outline" id="outline" aria-label="On this page" hidden></nav>
<div class="drop-over" id="dropOver">
<div class="box">Drop folder or .md files to read</div>
</div>
</main>
</div>
<!-- Settings -->
<div class="tweaks" id="tweaks" role="dialog" aria-label="Settings">
<h4>Settings</h4>
<div class="row">
<label for="tw-size">Body font size</label>
<input type="range" id="tw-size" min="14" max="22" step="1"/>
</div>
<div class="row">
<label for="tw-width">Reading width</label>
<input type="range" id="tw-width" min="56" max="140" step="1"/>
</div>
<div class="row">
<span class="row-label" id="tw-face-label">Body face</span>
<div class="seg" role="radiogroup" aria-labelledby="tw-face-label">
<label><input type="radio" name="tw-face" value="sans"/>Sans</label>
<label><input type="radio" name="tw-face" value="serif"/>Serif</label>
</div>
</div>
<div class="row">
<label for="tw-theme">Theme</label>
<select id="tw-theme">
<option value="system">Match system</option>
<option value="slate">Slate</option>
<option value="paper">Paper</option>
<option value="catppuccin-latte">Catppuccin Latte</option>
<option value="catppuccin-mocha">Catppuccin Mocha</option>
<option value="gruvbox-light">Gruvbox Light</option>
<option value="gruvbox-dark">Gruvbox Dark</option>
<option value="solarized-light">Solarized Light</option>
<option value="solarized-dark">Solarized Dark</option>
<option value="tokyo-night">Tokyo Night</option>
<option value="nord">Nord</option>
<option value="dracula">Dracula</option>
<option value="one-dark">One Dark</option>
</select>
</div>
<div class="row">
<label for="tw-outline">Outline of headings</label>
<input type="checkbox" id="tw-outline"/>
</div>
<div class="row">
<span class="row-label" id="tw-remote-label">Remote images</span>
<div class="seg" role="radiogroup" aria-labelledby="tw-remote-label">
<label><input type="radio" name="tw-remote" value="block"/>Ask first</label>
<label><input type="radio" name="tw-remote" value="load"/>Always load</label>
</div>
</div>
<div class="tweaks-foot">
<span class="tweaks-hint">Changes apply live</span>
</div>
</div>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<div class="modal-wrap" id="safariNote" hidden>
<div class="modal-card" role="dialog" aria-modal="true" aria-labelledby="safariNoteTitle">
<div class="modal-eyebrow">Heads up — browser wording</div>
<h3 id="safariNoteTitle">Your browser will say <em>"Upload"</em>. Nothing actually uploads.</h3>
<p>Safari and Firefox don't yet support the modern folder-access API. They fall back to a file-input prompt that's labelled <em>"Upload N files to this site"</em>.</p>
<p>Better MD viewer ignores that wording. Your files are read into this tab and rendered locally. Nothing is sent over the network — you can confirm in your browser's Network tab.</p>
<div class="modal-actions">
<button class="btn ghost" id="safariNoteCancel" type="button">Cancel</button>
<button class="btn" id="safariNoteContinue" type="button">Got it — open folder</button>
</div>
<label class="modal-dismiss"><input type="checkbox" id="safariNoteHide" /> Don't show this again</label>
</div>
</div>
<input type="file" id="filePicker" hidden accept=".md,.markdown,.txt" multiple />
<input type="file" id="dirPicker" hidden webkitdirectory directory multiple />
<script src="assets/marked.min.js" defer></script>
<script src="assets/purify.min.js" defer></script>
<script src="assets/highlight.min.js" defer></script>
<script src="assets/app.js" defer></script>
</body>
</html>