napi/viewer.html

30 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Mis Notas</title>
<script src="/marked.min.js"></script>
<style>
body { max-width: 800px; margin: 2em auto; font-family: sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'EmojiOne Color'; padding: 0 1.5em; line-height: 1.6; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; }
th, td { border: 1px solid #ccc; padding: .4em .8em; text-align: left; }
th { background: #f5f5f5; font-weight: bold; }
code { background: #f4f4f4; padding: .1em .3em; border-radius: 3px; font-size: .9em; }
pre { background: #f4f4f4; padding: 1em; border-radius: 4px; overflow-x: auto; }
blockquote { border-left: 3px solid #ccc; margin: 0; padding-left: 1em; color: #555; }
h1 { border-bottom: 2px solid #eee; padding-bottom: .3em; }
h2 { border-bottom: 1px solid #eee; padding-bottom: .2em; }
</style>
</head>
<body>
<div id="out">Cargando...</div>
<script>
fetch('/notas.md')
.then(r => { if (!r.ok) throw new Error(r.status); return r.text(); })
.then(md => document.getElementById('out').innerHTML = marked.parse(md))
.catch(e => document.getElementById('out').textContent = 'Error cargando notas: ' + e);
</script>
</body>
</html>