@wipcomputer/markdown-viewer 1.0.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/markdown-viewer.html +16 -16
- package/package.json +1 -1
- package/server.js +12 -0
- package/vendor/auto-render.min.js +1 -0
- package/vendor/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/vendor/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/vendor/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/vendor/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/vendor/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/vendor/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/vendor/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/vendor/fonts/KaTeX_Main-Bold.woff +0 -0
- package/vendor/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/vendor/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/vendor/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/vendor/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/vendor/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/vendor/fonts/KaTeX_Main-Italic.woff +0 -0
- package/vendor/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/vendor/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Main-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/vendor/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/vendor/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/vendor/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/vendor/fonts/KaTeX_Math-Italic.woff +0 -0
- package/vendor/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Script-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/vendor/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/vendor/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/vendor/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/vendor/github-dark.min.css +10 -0
- package/vendor/github.min.css +10 -0
- package/vendor/highlight.min.js +1213 -0
- package/vendor/katex.min.css +1 -0
- package/vendor/katex.min.js +1 -0
- package/vendor/marked.min.js +69 -0
- package/vendor/mermaid.min.js +2029 -0
- /package/{bbedit-preview-template.html → _not-used/bbedit-preview-template.html} +0 -0
package/markdown-viewer.html
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>WIP Computer: Live .md Viewer</title>
|
|
7
|
-
<!-- Markdown parser -->
|
|
8
|
-
<script src="
|
|
9
|
-
<!-- Syntax highlighting -->
|
|
10
|
-
<link rel="stylesheet" href="
|
|
11
|
-
<script src="
|
|
12
|
-
<!-- Mermaid for diagrams -->
|
|
13
|
-
<script src="
|
|
14
|
-
<!-- KaTeX for math -->
|
|
15
|
-
<link rel="stylesheet" href="
|
|
16
|
-
<script src="
|
|
17
|
-
<script src="
|
|
7
|
+
<!-- Markdown parser (bundled, no CDN) -->
|
|
8
|
+
<script src="/vendor/marked.min.js"></script>
|
|
9
|
+
<!-- Syntax highlighting (bundled, no CDN) -->
|
|
10
|
+
<link rel="stylesheet" href="/vendor/github.min.css" id="highlight-theme">
|
|
11
|
+
<script src="/vendor/highlight.min.js"></script>
|
|
12
|
+
<!-- Mermaid for diagrams (bundled, no CDN) -->
|
|
13
|
+
<script src="/vendor/mermaid.min.js"></script>
|
|
14
|
+
<!-- KaTeX for math (bundled, no CDN) -->
|
|
15
|
+
<link rel="stylesheet" href="/vendor/katex.min.css">
|
|
16
|
+
<script src="/vendor/katex.min.js"></script>
|
|
17
|
+
<script src="/vendor/auto-render.min.js"></script>
|
|
18
18
|
<style>
|
|
19
19
|
:root {
|
|
20
20
|
--bg-primary: #fcfbf9;
|
|
@@ -1312,10 +1312,10 @@
|
|
|
1312
1312
|
// Update highlight.js theme
|
|
1313
1313
|
const highlightTheme = document.getElementById('highlight-theme');
|
|
1314
1314
|
if (newTheme === 'dark') {
|
|
1315
|
-
highlightTheme.href = '
|
|
1315
|
+
highlightTheme.href = '/vendor/github-dark.min.css';
|
|
1316
1316
|
mermaid.initialize({ theme: 'dark' });
|
|
1317
1317
|
} else {
|
|
1318
|
-
highlightTheme.href = '
|
|
1318
|
+
highlightTheme.href = '/vendor/github.min.css';
|
|
1319
1319
|
mermaid.initialize({ theme: 'default' });
|
|
1320
1320
|
}
|
|
1321
1321
|
|
|
@@ -1336,7 +1336,7 @@
|
|
|
1336
1336
|
// Update highlight.js theme
|
|
1337
1337
|
const highlightTheme = document.getElementById('highlight-theme');
|
|
1338
1338
|
if (savedTheme === 'dark') {
|
|
1339
|
-
highlightTheme.href = '
|
|
1339
|
+
highlightTheme.href = '/vendor/github-dark.min.css';
|
|
1340
1340
|
mermaid.initialize({ theme: 'dark' });
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
@@ -1371,8 +1371,8 @@
|
|
|
1371
1371
|
<meta charset="UTF-8">
|
|
1372
1372
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1373
1373
|
<title>${currentFile.name}</title>
|
|
1374
|
-
<link rel="stylesheet" href="
|
|
1375
|
-
<link rel="stylesheet" href="
|
|
1374
|
+
<link rel="stylesheet" href="/vendor/github.min.css">
|
|
1375
|
+
<link rel="stylesheet" href="/vendor/katex.min.css">
|
|
1376
1376
|
<style>
|
|
1377
1377
|
body {
|
|
1378
1378
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wipcomputer/markdown-viewer",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Live markdown viewer for AI pair-editing. When you collaborate, the updates render instantly. Works with any AI agent and web browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "server.js",
|
package/server.js
CHANGED
|
@@ -230,6 +230,7 @@ const mimeTypes = {
|
|
|
230
230
|
".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg",
|
|
231
231
|
".gif": "image/gif", ".svg": "image/svg+xml", ".webp": "image/webp",
|
|
232
232
|
".ico": "image/x-icon", ".css": "text/css", ".js": "application/javascript",
|
|
233
|
+
".woff": "font/woff", ".woff2": "font/woff2", ".ttf": "font/ttf",
|
|
233
234
|
};
|
|
234
235
|
|
|
235
236
|
const server = createServer((req, res) => {
|
|
@@ -301,6 +302,17 @@ const server = createServer((req, res) => {
|
|
|
301
302
|
return;
|
|
302
303
|
}
|
|
303
304
|
|
|
305
|
+
// Serve bundled vendor files (no CDN dependency)
|
|
306
|
+
if (url.pathname.startsWith("/vendor/")) {
|
|
307
|
+
const vendorPath = join(__dirname, url.pathname);
|
|
308
|
+
if (existsSync(vendorPath) && statSync(vendorPath).isFile()) {
|
|
309
|
+
const ext = extname(vendorPath).toLowerCase();
|
|
310
|
+
res.writeHead(200, { "Content-Type": mimeTypes[ext] || "application/octet-stream" });
|
|
311
|
+
res.end(readFileSync(vendorPath));
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
304
316
|
// Serve static files relative to a viewed file's directory
|
|
305
317
|
const referer = req.headers.referer;
|
|
306
318
|
if (referer) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n<t.length;){var o=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;"\\"===o?n++:"{"===o?i++:"}"===o&&i--,n++}return-1},a=/^\\begin{/,o=function(e,t){for(var n,i=[],o=new RegExp("("+t.map((function(e){return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")})).join("|")+")");-1!==(n=e.search(o));){n>0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a<n.length;a++)if("text"===n[a].type)i.appendChild(document.createTextNode(n[a].data));else{var l=document.createElement("span"),d=n[a].data;r.displayMode=n[a].display;try{r.preProcess&&(d=r.preProcess(d)),t().render(d,l,r)}catch(e){if(!(e instanceof t().ParseError))throw e;r.errorCallback("KaTeX auto-render: Failed to parse `"+n[a].data+"` with ",e),i.appendChild(document.createTextNode(n[a].rawData));continue}i.appendChild(l)}return i},d=function e(t,r){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];if(3===i.nodeType){for(var a=i.textContent,o=i.nextSibling,d=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,d++;var s=l(a,r);if(s){for(var f=0;f<d;f++)i.nextSibling.remove();n+=s.childNodes.length-1,t.replaceChild(s,i)}else n+=d}else 1===i.nodeType&&function(){var t=" "+i.className+" ";-1===r.ignoredTags.indexOf(i.nodeName.toLowerCase())&&r.ignoredClasses.every((function(e){return-1===t.indexOf(" "+e+" ")}))&&e(i,r)}()}},s=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},d(e,r)}}(),i=i.default}()}));
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
|
+
Theme: GitHub Dark
|
|
3
|
+
Description: Dark theme as seen on github.com
|
|
4
|
+
Author: github.com
|
|
5
|
+
Maintainer: @Hirse
|
|
6
|
+
Updated: 2021-05-15
|
|
7
|
+
|
|
8
|
+
Outdated base version: https://github.com/primer/github-syntax-dark
|
|
9
|
+
Current colors taken from GitHub's CSS
|
|
10
|
+
*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
|
+
Theme: GitHub
|
|
3
|
+
Description: Light theme as seen on github.com
|
|
4
|
+
Author: github.com
|
|
5
|
+
Maintainer: @Hirse
|
|
6
|
+
Updated: 2021-05-15
|
|
7
|
+
|
|
8
|
+
Outdated base version: https://github.com/primer/github-syntax-light
|
|
9
|
+
Current colors taken from GitHub's CSS
|
|
10
|
+
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}
|