feat: add syntax highlighting and code block styling with theme support

This commit is contained in:
2025-10-21 08:34:46 -04:00
parent 062d743481
commit d788c9d267
75 changed files with 4783 additions and 830 deletions
+26 -2
View File
@@ -1,9 +1,33 @@
<!DOCTYPE html>
<html lang="en" data-theme="light">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ObsiWatcher - Obsidian Vault Viewer</title>
<title>ObsiViewer - Obsidian Vault Viewer</title>
<script>
(function () {
try {
const key = 'obsiviewer.preferences.v1';
const raw = localStorage.getItem(key);
const prefs = raw ? JSON.parse(raw) : null;
const html = document.documentElement;
function apply(mode, theme) {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const dark = mode === 'system' ? prefersDark : (mode === 'dark');
html.classList.toggle('dark', !!dark);
if (theme) html.setAttribute('data-theme', theme);
}
if (prefs && prefs.mode && prefs.theme) {
apply(prefs.mode, prefs.theme);
} else {
// défaut : system + light tokens
apply('system', 'light');
}
} catch (e) { /* no-op */ }
})();
</script>
<script type="importmap">
{
"imports": {