@commentray/render 0.0.1 → 0.0.4
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/dist/block-stretch-layout.d.ts +30 -0
- package/dist/block-stretch-layout.d.ts.map +1 -0
- package/dist/block-stretch-layout.js +116 -0
- package/dist/block-stretch-layout.js.map +1 -0
- package/dist/build-commentray-nav-search.d.ts +52 -0
- package/dist/build-commentray-nav-search.d.ts.map +1 -0
- package/dist/build-commentray-nav-search.js +79 -0
- package/dist/build-commentray-nav-search.js.map +1 -0
- package/dist/code-browser-client.bundle.js +7 -5
- package/dist/code-browser-client.js +428 -69
- package/dist/code-browser-client.js.map +1 -1
- package/dist/code-browser-embedded-payload.d.ts +10 -0
- package/dist/code-browser-embedded-payload.d.ts.map +1 -0
- package/dist/code-browser-embedded-payload.js +18 -0
- package/dist/code-browser-embedded-payload.js.map +1 -0
- package/dist/code-browser-encoding.d.ts +9 -0
- package/dist/code-browser-encoding.d.ts.map +1 -0
- package/dist/code-browser-encoding.js +24 -0
- package/dist/code-browser-encoding.js.map +1 -0
- package/dist/code-browser-scroll-sync.d.ts +13 -0
- package/dist/code-browser-scroll-sync.d.ts.map +1 -0
- package/dist/code-browser-scroll-sync.js +15 -0
- package/dist/code-browser-scroll-sync.js.map +1 -0
- package/dist/code-browser-web-storage.d.ts +7 -0
- package/dist/code-browser-web-storage.d.ts.map +1 -0
- package/dist/code-browser-web-storage.js +21 -0
- package/dist/code-browser-web-storage.js.map +1 -0
- package/dist/code-browser.d.ts +76 -0
- package/dist/code-browser.d.ts.map +1 -1
- package/dist/code-browser.js +400 -39
- package/dist/code-browser.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/markdown-pipeline.d.ts +23 -1
- package/dist/markdown-pipeline.d.ts.map +1 -1
- package/dist/markdown-pipeline.js +142 -2
- package/dist/markdown-pipeline.js.map +1 -1
- package/dist/mermaid-runtime-html.d.ts +7 -0
- package/dist/mermaid-runtime-html.d.ts.map +1 -0
- package/dist/mermaid-runtime-html.js +26 -0
- package/dist/mermaid-runtime-html.js.map +1 -0
- package/dist/package-version.d.ts +5 -0
- package/dist/package-version.d.ts.map +1 -0
- package/dist/package-version.js +14 -0
- package/dist/package-version.js.map +1 -0
- package/dist/side-by-side.d.ts +5 -0
- package/dist/side-by-side.d.ts.map +1 -1
- package/dist/side-by-side.js +11 -9
- package/dist/side-by-side.js.map +1 -1
- package/package.json +6 -4
package/dist/code-browser.js
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { MARKER_ID_BODY, buildBlockScrollLinks, } from "@commentray/core";
|
|
5
|
+
import { tryBuildBlockStretchTableHtml } from "./block-stretch-layout.js";
|
|
4
6
|
import { escapeHtml } from "./html-utils.js";
|
|
5
|
-
import {
|
|
7
|
+
import { mermaidRuntimeScriptHtml } from "./mermaid-runtime-html.js";
|
|
8
|
+
import { renderFencedCode, renderMarkdownToHtml, } from "./markdown-pipeline.js";
|
|
9
|
+
function renderGeneratorMetaHtml(label) {
|
|
10
|
+
const t = label?.trim();
|
|
11
|
+
if (!t)
|
|
12
|
+
return "";
|
|
13
|
+
return `<meta name="generator" content="${escapeHtml(t)}" />\n `;
|
|
14
|
+
}
|
|
6
15
|
function extractPreCodeInner(html) {
|
|
7
16
|
const m = /<pre(?:\s[^>]*)?>\s*<code(?:\s[^>]*)?>([\s\S]*?)<\/code>\s*<\/pre>/i.exec(html.trim());
|
|
8
17
|
return m ? m[1] : escapeHtml(html);
|
|
9
18
|
}
|
|
19
|
+
/** Single capture: marker id (avoid a wrapping group around the whole comment — that shifted indices). */
|
|
20
|
+
const BLOCK_MARKER_HTML_LINE = new RegExp(`^<!--\\s*commentray:block\\s+id=(${MARKER_ID_BODY})\\s*-->$`, "i");
|
|
21
|
+
/** Inserts thin separator anchors after each `<!-- commentray:block … -->` line (optional index attrs for scroll sync). */
|
|
22
|
+
function injectCommentrayBlockAnchors(markdown, links) {
|
|
23
|
+
const byId = links ? new Map(links.map((l) => [l.id, l])) : undefined;
|
|
24
|
+
return markdown
|
|
25
|
+
.split("\n")
|
|
26
|
+
.map((line) => {
|
|
27
|
+
const m = BLOCK_MARKER_HTML_LINE.exec(line);
|
|
28
|
+
if (!m?.[1])
|
|
29
|
+
return line;
|
|
30
|
+
const id = m[1];
|
|
31
|
+
const link = byId?.get(id);
|
|
32
|
+
const attrs = link !== undefined
|
|
33
|
+
? ` data-source-start="${String(link.sourceStart)}" data-commentray-line="${String(link.commentrayLine)}"`
|
|
34
|
+
: "";
|
|
35
|
+
return `${line}\n\n<div id="commentray-block-${escapeHtml(id)}" class="commentray-block-anchor" aria-hidden="true"${attrs}></div>`;
|
|
36
|
+
})
|
|
37
|
+
.join("\n");
|
|
38
|
+
}
|
|
10
39
|
/** One highlighted row per source line so in-page search can scroll to a line. */
|
|
11
40
|
async function renderCodeLineBlocks(code, language) {
|
|
12
41
|
const lines = code.split("\n");
|
|
@@ -47,6 +76,73 @@ function renderFilePathLabel(filePath, fallbackTitle) {
|
|
|
47
76
|
`<span class="file-path__base">${escapeHtml(base)}</span>` +
|
|
48
77
|
`</strong>`);
|
|
49
78
|
}
|
|
79
|
+
/** GitHub “mark” glyph (Octicons-style path), MIT-licensed silhouette. */
|
|
80
|
+
const GITHUB_MARK_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20" fill="currentColor" aria-hidden="true">' +
|
|
81
|
+
'<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>' +
|
|
82
|
+
"</svg>";
|
|
83
|
+
function safeExternalHttpUrl(url) {
|
|
84
|
+
const t = url?.trim();
|
|
85
|
+
if (!t)
|
|
86
|
+
return null;
|
|
87
|
+
if (!/^https?:\/\//i.test(t))
|
|
88
|
+
return null;
|
|
89
|
+
return t;
|
|
90
|
+
}
|
|
91
|
+
function buildToolbarEndHtml(githubRepoUrl, toolHomeUrl) {
|
|
92
|
+
const gh = safeExternalHttpUrl(githubRepoUrl);
|
|
93
|
+
const tool = safeExternalHttpUrl(toolHomeUrl);
|
|
94
|
+
const bits = [];
|
|
95
|
+
if (gh) {
|
|
96
|
+
const he = escapeHtml(gh);
|
|
97
|
+
bits.push(`<a class="toolbar-github" href="${he}" target="_blank" rel="noopener noreferrer" aria-label="View repository on GitHub" title="View repository on GitHub">${GITHUB_MARK_SVG}</a>`);
|
|
98
|
+
}
|
|
99
|
+
if (tool) {
|
|
100
|
+
const te = escapeHtml(tool);
|
|
101
|
+
bits.push(`<span class="toolbar-attribution" role="note">Rendered with <a href="${te}" target="_blank" rel="noopener noreferrer">Commentray</a></span>`);
|
|
102
|
+
}
|
|
103
|
+
if (bits.length === 0)
|
|
104
|
+
return "";
|
|
105
|
+
return `<div class="toolbar__end">${bits.join("")}</div>`;
|
|
106
|
+
}
|
|
107
|
+
function renderRelatedGithubNavHtml(links) {
|
|
108
|
+
if (links.length === 0)
|
|
109
|
+
return "";
|
|
110
|
+
const parts = links.map((l) => `<a href="${escapeHtml(l.href)}" target="_blank" rel="noopener noreferrer">${escapeHtml(l.label)}</a>`);
|
|
111
|
+
return (`<nav class="toolbar-related" aria-label="Open other repository files on GitHub">` +
|
|
112
|
+
`<span class="toolbar-related__prefix">Also on GitHub</span>` +
|
|
113
|
+
`<span class="toolbar-related__links">${parts.join('<span class="toolbar-related__sep" aria-hidden="true"> · </span>')}</span>` +
|
|
114
|
+
`</nav>`);
|
|
115
|
+
}
|
|
116
|
+
function renderToolbarDocHubHtml(opts) {
|
|
117
|
+
const parts = [];
|
|
118
|
+
const src = safeExternalHttpUrl(opts.sourceOnGithubUrl);
|
|
119
|
+
const cr = safeExternalHttpUrl(opts.commentrayOnGithubUrl);
|
|
120
|
+
const nav = opts.documentedNavJsonUrl?.trim();
|
|
121
|
+
const hasEmbed = (opts.documentedPairsEmbeddedB64?.trim() ?? "").length > 0;
|
|
122
|
+
const showDocumentedTree = Boolean(nav) || hasEmbed;
|
|
123
|
+
if (src) {
|
|
124
|
+
parts.push(`<a class="toolbar-blob-link" href="${escapeHtml(src)}" target="_blank" rel="noopener noreferrer">Source on GitHub</a>`);
|
|
125
|
+
}
|
|
126
|
+
if (cr) {
|
|
127
|
+
parts.push(`<a class="toolbar-blob-link" href="${escapeHtml(cr)}" target="_blank" rel="noopener noreferrer">Commentray on GitHub</a>`);
|
|
128
|
+
}
|
|
129
|
+
if (showDocumentedTree) {
|
|
130
|
+
const navAttr = nav ? escapeHtml(nav) : "";
|
|
131
|
+
parts.push(`<button type="button" class="toolbar-tree-toggle" id="documented-files-toggle" aria-expanded="false" aria-controls="documented-files-panel" data-nav-json-url="${navAttr}">Documented files</button>`);
|
|
132
|
+
}
|
|
133
|
+
const toolbarDocHubHtml = parts.length > 0
|
|
134
|
+
? `<div class="toolbar-doc-hub">${parts.join('<span class="toolbar-doc-hub__sep" aria-hidden="true"> · </span>')}</div>`
|
|
135
|
+
: "";
|
|
136
|
+
const documentedPanelHtml = showDocumentedTree
|
|
137
|
+
? `<div id="documented-files-panel" class="documented-files-panel" hidden>
|
|
138
|
+
<div class="documented-files-panel__inner">
|
|
139
|
+
<p class="documented-files-panel__hint">Indexed source ↔ commentray pairs (embedded for offline when available). Links open on GitHub.</p>
|
|
140
|
+
<div id="documented-files-tree" class="documented-files-tree" role="tree"></div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>`
|
|
143
|
+
: "";
|
|
144
|
+
return { toolbarDocHubHtml, documentedPanelHtml };
|
|
145
|
+
}
|
|
50
146
|
/** IIFE produced by `npm run build -w @commentray/render` (esbuild of `code-browser-client.ts`). */
|
|
51
147
|
function loadCodeBrowserClientBundle() {
|
|
52
148
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
@@ -68,6 +164,30 @@ const CODE_BROWSER_STYLES = `
|
|
|
68
164
|
border-bottom: 1px solid color-mix(in oklab, CanvasText 18%, Canvas);
|
|
69
165
|
font-size: 13px; flex: 0 0 auto;
|
|
70
166
|
}
|
|
167
|
+
.toolbar__main {
|
|
168
|
+
display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
|
|
169
|
+
flex: 1 1 280px;
|
|
170
|
+
min-width: 0;
|
|
171
|
+
}
|
|
172
|
+
.toolbar__end {
|
|
173
|
+
display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
|
|
174
|
+
margin-left: auto;
|
|
175
|
+
justify-content: flex-end;
|
|
176
|
+
}
|
|
177
|
+
.toolbar-github {
|
|
178
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
179
|
+
width: 34px; height: 34px; border-radius: 8px;
|
|
180
|
+
border: 1px solid color-mix(in oklab, CanvasText 22%, Canvas);
|
|
181
|
+
background: color-mix(in oklab, CanvasText 6%, Canvas);
|
|
182
|
+
color: CanvasText;
|
|
183
|
+
}
|
|
184
|
+
.toolbar-github:hover { background: color-mix(in oklab, CanvasText 11%, Canvas); }
|
|
185
|
+
.toolbar-github:focus-visible { outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas); outline-offset: 2px; }
|
|
186
|
+
.toolbar-attribution {
|
|
187
|
+
font-size: 11px; line-height: 1.35; opacity: 0.82; max-width: min(360px, 42vw);
|
|
188
|
+
text-align: right; color: color-mix(in oklab, CanvasText 88%, Canvas);
|
|
189
|
+
}
|
|
190
|
+
.toolbar-attribution a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
|
|
71
191
|
.toolbar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
|
|
72
192
|
.toolbar .file-path {
|
|
73
193
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
|
|
@@ -83,6 +203,50 @@ const CODE_BROWSER_STYLES = `
|
|
|
83
203
|
color: CanvasText; font-weight: 600;
|
|
84
204
|
}
|
|
85
205
|
.toolbar .file-path--title { font-weight: 600; }
|
|
206
|
+
.toolbar-related {
|
|
207
|
+
display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
|
|
208
|
+
max-width: min(520px, 90vw); font-size: 12px; line-height: 1.35;
|
|
209
|
+
color: color-mix(in oklab, CanvasText 88%, Canvas);
|
|
210
|
+
}
|
|
211
|
+
.toolbar-related__prefix { font-weight: 600; opacity: 0.85; white-space: nowrap; }
|
|
212
|
+
.toolbar-related__links { min-width: 0; }
|
|
213
|
+
.toolbar-related a {
|
|
214
|
+
color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 500;
|
|
215
|
+
word-break: break-word;
|
|
216
|
+
}
|
|
217
|
+
.toolbar-related__sep { opacity: 0.55; user-select: none; }
|
|
218
|
+
.toolbar-doc-hub {
|
|
219
|
+
display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
|
|
220
|
+
font-size: 12px; line-height: 1.35;
|
|
221
|
+
color: color-mix(in oklab, CanvasText 88%, Canvas);
|
|
222
|
+
}
|
|
223
|
+
.toolbar-doc-hub__sep { opacity: 0.45; user-select: none; }
|
|
224
|
+
.toolbar-blob-link {
|
|
225
|
+
color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 2px;
|
|
226
|
+
white-space: nowrap;
|
|
227
|
+
}
|
|
228
|
+
.toolbar-tree-toggle {
|
|
229
|
+
font: inherit; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 6px; cursor: pointer;
|
|
230
|
+
border: 1px solid color-mix(in oklab, CanvasText 25%, Canvas);
|
|
231
|
+
background: color-mix(in oklab, CanvasText 6%, Canvas); color: CanvasText;
|
|
232
|
+
}
|
|
233
|
+
.toolbar-tree-toggle:hover { background: color-mix(in oklab, CanvasText 11%, Canvas); }
|
|
234
|
+
.documented-files-panel {
|
|
235
|
+
flex: 0 0 auto; max-height: min(42vh, 360px); overflow: auto;
|
|
236
|
+
border-bottom: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
|
|
237
|
+
background: color-mix(in oklab, CanvasText 4%, Canvas);
|
|
238
|
+
}
|
|
239
|
+
.documented-files-panel__inner { padding: 10px 14px 14px; font-size: 13px; }
|
|
240
|
+
.documented-files-panel__hint { margin: 0 0 10px; opacity: 0.82; line-height: 1.4; }
|
|
241
|
+
.documented-files-panel__code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; font-size: 12px; }
|
|
242
|
+
.documented-files-tree ul { list-style: none; margin: 0; padding-left: 14px; }
|
|
243
|
+
.documented-files-tree > ul { padding-left: 0; }
|
|
244
|
+
.documented-files-tree li { margin: 2px 0; line-height: 1.4; }
|
|
245
|
+
.documented-files-tree .tree-dir { font-weight: 600; margin-top: 6px; }
|
|
246
|
+
.documented-files-tree .tree-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 4px 0; }
|
|
247
|
+
.documented-files-tree .tree-file-name { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; font-size: 12px; }
|
|
248
|
+
.documented-files-tree .tree-file-links { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; font-size: 11px; }
|
|
249
|
+
.documented-files-tree .tree-file-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
|
|
86
250
|
.toolbar .search-field {
|
|
87
251
|
display: inline-flex; align-items: center; gap: 6px; flex: 1 1 220px; min-width: 160px;
|
|
88
252
|
}
|
|
@@ -118,11 +282,30 @@ const CODE_BROWSER_STYLES = `
|
|
|
118
282
|
flex: 0 0 50%;
|
|
119
283
|
min-width: 120px; overflow: auto; padding: 12px 16px;
|
|
120
284
|
border-right: 1px solid color-mix(in oklab, CanvasText 15%, Canvas);
|
|
285
|
+
--code-line-font-size: 13px;
|
|
286
|
+
--code-line-height: 1.5;
|
|
121
287
|
}
|
|
122
288
|
.pane--code .code-line {
|
|
123
|
-
display: grid;
|
|
289
|
+
display: grid;
|
|
290
|
+
/* max-content: column wide enough for the longest line number (avoids 100+ bleeding into code). */
|
|
291
|
+
grid-template-columns: max-content 1fr;
|
|
292
|
+
column-gap: 12px;
|
|
293
|
+
align-items: baseline;
|
|
294
|
+
}
|
|
295
|
+
.pane--code .code-line pre {
|
|
296
|
+
margin: 0;
|
|
297
|
+
min-width: 0;
|
|
298
|
+
padding: 0;
|
|
299
|
+
border: 0;
|
|
300
|
+
background: transparent;
|
|
301
|
+
}
|
|
302
|
+
.pane--code .code-line pre code.hljs {
|
|
303
|
+
display: block;
|
|
304
|
+
margin: 0;
|
|
305
|
+
padding: 0;
|
|
306
|
+
font-size: var(--code-line-font-size);
|
|
307
|
+
line-height: var(--code-line-height);
|
|
124
308
|
}
|
|
125
|
-
.pane--code .code-line pre { margin: 0; min-width: 0; }
|
|
126
309
|
.pane--code .code-line .ln {
|
|
127
310
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
|
|
128
311
|
font-variant-numeric: tabular-nums;
|
|
@@ -130,7 +313,9 @@ const CODE_BROWSER_STYLES = `
|
|
|
130
313
|
color: color-mix(in oklab, CanvasText 45%, Canvas);
|
|
131
314
|
padding-right: 8px;
|
|
132
315
|
border-right: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
|
|
133
|
-
|
|
316
|
+
white-space: nowrap;
|
|
317
|
+
font-size: var(--code-line-font-size);
|
|
318
|
+
line-height: var(--code-line-height);
|
|
134
319
|
}
|
|
135
320
|
.pane--code .code-line:target .ln,
|
|
136
321
|
.pane--code .code-line:hover .ln {
|
|
@@ -155,19 +340,115 @@ const CODE_BROWSER_STYLES = `
|
|
|
155
340
|
}
|
|
156
341
|
.pane--doc { font-size: 15px; line-height: 1.45; }
|
|
157
342
|
.pane--doc img { max-width: 100%; height: auto; }
|
|
343
|
+
.pane--doc .commentray-block-anchor {
|
|
344
|
+
display: block;
|
|
345
|
+
height: 0;
|
|
346
|
+
margin: 14px 0 0;
|
|
347
|
+
border: 0;
|
|
348
|
+
border-top: 1px solid color-mix(in oklab, CanvasText 22%, Canvas);
|
|
349
|
+
pointer-events: none;
|
|
350
|
+
}
|
|
158
351
|
.pane h2.pane-title { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
|
|
159
352
|
.app { display: flex; flex-direction: column; height: 100vh; }
|
|
353
|
+
.shell--stretch-rows {
|
|
354
|
+
flex: 1;
|
|
355
|
+
min-height: 0;
|
|
356
|
+
overflow: auto;
|
|
357
|
+
display: block;
|
|
358
|
+
padding: 0 12px 20px;
|
|
359
|
+
}
|
|
360
|
+
.shell--stretch-rows .stretch-preamble {
|
|
361
|
+
padding: 8px 4px 16px;
|
|
362
|
+
margin-bottom: 8px;
|
|
363
|
+
border-bottom: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
|
|
364
|
+
font-size: 15px;
|
|
365
|
+
line-height: 1.45;
|
|
366
|
+
}
|
|
367
|
+
.shell--stretch-rows .stretch-preamble img { max-width: 100%; height: auto; }
|
|
368
|
+
.block-stretch {
|
|
369
|
+
width: 100%;
|
|
370
|
+
border-collapse: collapse;
|
|
371
|
+
table-layout: fixed;
|
|
372
|
+
}
|
|
373
|
+
.stretch-col-code { width: 50%; }
|
|
374
|
+
.stretch-col-doc { width: 50%; }
|
|
375
|
+
.block-stretch td.stretch-code {
|
|
376
|
+
vertical-align: top;
|
|
377
|
+
padding: 0 12px 0 0;
|
|
378
|
+
border-bottom: 1px solid color-mix(in oklab, CanvasText 8%, Canvas);
|
|
379
|
+
}
|
|
380
|
+
.block-stretch td.stretch-doc {
|
|
381
|
+
vertical-align: top;
|
|
382
|
+
padding: 0 0 0 12px;
|
|
383
|
+
border-bottom: 1px solid color-mix(in oklab, CanvasText 8%, Canvas);
|
|
384
|
+
}
|
|
385
|
+
.block-stretch td.stretch-doc .stretch-doc-inner {
|
|
386
|
+
font-size: 15px;
|
|
387
|
+
line-height: 1.45;
|
|
388
|
+
}
|
|
389
|
+
.block-stretch td.stretch-doc .stretch-doc-inner img { max-width: 100%; height: auto; }
|
|
390
|
+
.block-stretch td.stretch-doc--gap {
|
|
391
|
+
color: color-mix(in oklab, CanvasText 38%, Canvas);
|
|
392
|
+
font-size: 13px;
|
|
393
|
+
vertical-align: top;
|
|
394
|
+
}
|
|
395
|
+
.block-stretch .stretch-gap-mark { display: inline-block; padding-top: 2px; }
|
|
396
|
+
.block-stretch .stretch-code-stack {
|
|
397
|
+
display: flex;
|
|
398
|
+
flex-direction: column;
|
|
399
|
+
align-items: stretch;
|
|
400
|
+
min-width: 0;
|
|
401
|
+
}
|
|
402
|
+
.block-stretch .code-line {
|
|
403
|
+
display: grid;
|
|
404
|
+
grid-template-columns: max-content 1fr;
|
|
405
|
+
column-gap: 12px;
|
|
406
|
+
align-items: start;
|
|
407
|
+
}
|
|
408
|
+
.block-stretch .code-line pre { margin: 0; min-width: 0; padding: 0; border: 0; background: transparent; }
|
|
409
|
+
.block-stretch .code-line pre code.hljs {
|
|
410
|
+
display: block;
|
|
411
|
+
margin: 0;
|
|
412
|
+
padding: 0;
|
|
413
|
+
font-size: var(--code-line-font-size, 13px);
|
|
414
|
+
line-height: var(--code-line-height, 1.5);
|
|
415
|
+
}
|
|
416
|
+
.block-stretch .code-line .ln {
|
|
417
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
|
|
418
|
+
font-variant-numeric: tabular-nums;
|
|
419
|
+
text-align: right;
|
|
420
|
+
user-select: none;
|
|
421
|
+
-webkit-user-select: none;
|
|
422
|
+
color: color-mix(in oklab, CanvasText 45%, Canvas);
|
|
423
|
+
padding-right: 8px;
|
|
424
|
+
border-right: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
|
|
425
|
+
white-space: nowrap;
|
|
426
|
+
font-size: var(--code-line-font-size, 13px);
|
|
427
|
+
line-height: var(--code-line-height, 1.5);
|
|
428
|
+
}
|
|
429
|
+
.block-stretch.wrap .code-line pre,
|
|
430
|
+
.block-stretch.wrap .code-line pre code { white-space: pre-wrap; word-break: break-word; }
|
|
431
|
+
.block-stretch:not(.wrap) .code-line pre,
|
|
432
|
+
.block-stretch:not(.wrap) .code-line pre code { white-space: pre; }
|
|
433
|
+
.block-stretch-headings {
|
|
434
|
+
display: grid;
|
|
435
|
+
grid-template-columns: 1fr 1fr;
|
|
436
|
+
gap: 0 16px;
|
|
437
|
+
padding: 4px 12px 8px;
|
|
438
|
+
border-bottom: 1px solid color-mix(in oklab, CanvasText 10%, Canvas);
|
|
439
|
+
}
|
|
440
|
+
.block-stretch-headings .pane-title { margin: 0; }
|
|
160
441
|
`;
|
|
161
442
|
function buildCodeBrowserPageHtml(p) {
|
|
162
|
-
const
|
|
443
|
+
const shellClass = p.layout === "stretch" ? "shell shell--stretch-rows" : "shell";
|
|
163
444
|
return `<!doctype html>
|
|
164
445
|
<html lang="en">
|
|
165
446
|
<head>
|
|
166
447
|
<meta charset="utf-8" />
|
|
167
448
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
168
|
-
<title>${escapeHtml(title)}</title>
|
|
169
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.11.1/build/styles/${escapeHtml(hljs)}.min.css" media="(prefers-color-scheme: light)" />
|
|
170
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.11.1/build/styles/${escapeHtml(hljsDark)}.min.css" media="(prefers-color-scheme: dark)" />
|
|
449
|
+
${p.generatorMetaHtml}<title>${escapeHtml(p.title)}</title>
|
|
450
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.11.1/build/styles/${escapeHtml(p.hljs)}.min.css" media="(prefers-color-scheme: light)" />
|
|
451
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.11.1/build/styles/${escapeHtml(p.hljsDark)}.min.css" media="(prefers-color-scheme: dark)" />
|
|
171
452
|
<style>
|
|
172
453
|
${CODE_BROWSER_STYLES}
|
|
173
454
|
</style>
|
|
@@ -175,67 +456,147 @@ ${CODE_BROWSER_STYLES}
|
|
|
175
456
|
<body>
|
|
176
457
|
<div class="app">
|
|
177
458
|
<header class="toolbar" aria-label="View options">
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
459
|
+
<div class="toolbar__main">
|
|
460
|
+
${p.filePathHtml}
|
|
461
|
+
${p.toolbarDocHubHtml}
|
|
462
|
+
<span class="search-field">
|
|
463
|
+
<label for="search-q">Search</label>
|
|
464
|
+
<input type="search" id="search-q" placeholder="${escapeHtml(p.searchPlaceholder)}" autocomplete="off" spellcheck="false" />
|
|
465
|
+
<button type="button" id="search-clear" title="Clear search">Clear</button>
|
|
466
|
+
</span>
|
|
467
|
+
${p.relatedNavHtml}
|
|
468
|
+
<label><input type="checkbox" id="wrap-lines" /> Wrap code lines</label>
|
|
469
|
+
</div>
|
|
470
|
+
${p.toolbarEndHtml}
|
|
185
471
|
</header>
|
|
472
|
+
${p.documentedPanelHtml}
|
|
186
473
|
<div class="search-results" id="search-results" hidden aria-live="polite"></div>
|
|
187
|
-
<div class="
|
|
188
|
-
|
|
189
|
-
<h2 class="pane-title">Code</h2>
|
|
190
|
-
${codeHtml}
|
|
191
|
-
</section>
|
|
192
|
-
<div class="gutter" id="gutter" role="separator" aria-orientation="vertical" aria-label="Resize panes"></div>
|
|
193
|
-
<section class="pane--doc commentray" id="doc-pane" aria-label="Commentray">
|
|
194
|
-
<h2 class="pane-title">Commentray</h2>
|
|
195
|
-
${commentrayHtml}
|
|
196
|
-
</section>
|
|
474
|
+
<div class="${shellClass}" id="shell" data-layout="${p.layout}" data-raw-code-b64="${escapeHtml(p.rawCodeB64)}" data-raw-md-b64="${escapeHtml(p.rawMdB64)}" data-scroll-block-links-b64="${escapeHtml(p.scrollBlockLinksB64)}"${p.shellDocumentedPairsAttr}${p.shellSearchAttrs}>
|
|
475
|
+
${p.shellInner}
|
|
197
476
|
</div>
|
|
198
477
|
</div>
|
|
199
478
|
<script>
|
|
200
479
|
${loadCodeBrowserClientBundle()}
|
|
201
480
|
</script>
|
|
202
|
-
${mermaidScript}
|
|
481
|
+
${p.mermaidScript}
|
|
203
482
|
</body>
|
|
204
483
|
</html>`;
|
|
205
484
|
}
|
|
485
|
+
async function buildCodeBrowserShell(opts, layoutPref) {
|
|
486
|
+
let layout = "dual";
|
|
487
|
+
let shellInner = "";
|
|
488
|
+
let scrollBlockLinksB64 = "";
|
|
489
|
+
if (opts.blockStretchRows && layoutPref !== "dual") {
|
|
490
|
+
const stretched = await tryBuildBlockStretchTableHtml({
|
|
491
|
+
code: opts.code,
|
|
492
|
+
language: opts.language,
|
|
493
|
+
commentrayMarkdown: opts.commentrayMarkdown,
|
|
494
|
+
index: opts.blockStretchRows.index,
|
|
495
|
+
sourceRelative: opts.blockStretchRows.sourceRelative,
|
|
496
|
+
commentrayPathRel: opts.blockStretchRows.commentrayPathRel,
|
|
497
|
+
commentrayOutputUrls: opts.commentrayOutputUrls,
|
|
498
|
+
});
|
|
499
|
+
if (stretched) {
|
|
500
|
+
layout = "stretch";
|
|
501
|
+
shellInner =
|
|
502
|
+
` <div class="block-stretch-headings">` +
|
|
503
|
+
`<h2 class="pane-title">Code</h2>` +
|
|
504
|
+
`<h2 class="pane-title">Commentray</h2>` +
|
|
505
|
+
`</div>\n` +
|
|
506
|
+
` ${stretched.preambleHtml}\n` +
|
|
507
|
+
` ${stretched.tableInnerHtml}\n`;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (layout === "dual") {
|
|
511
|
+
const links = opts.blockStretchRows !== undefined
|
|
512
|
+
? buildBlockScrollLinks(opts.blockStretchRows.index, opts.blockStretchRows.sourceRelative, opts.blockStretchRows.commentrayPathRel, opts.commentrayMarkdown, opts.code)
|
|
513
|
+
: [];
|
|
514
|
+
const mdForDoc = injectCommentrayBlockAnchors(opts.commentrayMarkdown, links.length > 0 ? links : undefined);
|
|
515
|
+
if (links.length > 0) {
|
|
516
|
+
scrollBlockLinksB64 = Buffer.from(JSON.stringify(links), "utf8").toString("base64");
|
|
517
|
+
}
|
|
518
|
+
const [codeHtml, commentrayHtml] = await Promise.all([
|
|
519
|
+
renderCodeLineBlocks(opts.code, opts.language),
|
|
520
|
+
renderMarkdownToHtml(mdForDoc, {
|
|
521
|
+
commentrayOutputUrls: opts.commentrayOutputUrls,
|
|
522
|
+
}),
|
|
523
|
+
]);
|
|
524
|
+
shellInner =
|
|
525
|
+
` <section class="pane--code" id="code-pane" aria-label="Source code">` +
|
|
526
|
+
`<h2 class="pane-title">Code</h2>\n` +
|
|
527
|
+
` ${codeHtml}\n` +
|
|
528
|
+
` </section>\n` +
|
|
529
|
+
` <div class="gutter" id="gutter" role="separator" aria-orientation="vertical" aria-label="Resize panes"></div>\n` +
|
|
530
|
+
` <section class="pane--doc commentray" id="doc-pane" aria-label="Commentray">\n` +
|
|
531
|
+
` <h2 class="pane-title">Commentray</h2>\n` +
|
|
532
|
+
` ${commentrayHtml}\n` +
|
|
533
|
+
` </section>\n`;
|
|
534
|
+
}
|
|
535
|
+
return { layout, shellInner, scrollBlockLinksB64 };
|
|
536
|
+
}
|
|
537
|
+
function searchChromeFromOptions(opts) {
|
|
538
|
+
if (opts.staticSearchScope === "commentray-and-paths") {
|
|
539
|
+
return {
|
|
540
|
+
searchPlaceholder: "Commentray + file paths (ordered tokens + fuzzy lines)…",
|
|
541
|
+
shellSearchAttrs: ` data-search-scope="commentray-and-paths" data-search-file-path="${escapeHtml(opts.filePath ?? "")}" data-search-commentray-path="${escapeHtml((opts.commentrayPathForSearch ?? "").trim())}"`,
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
return {
|
|
545
|
+
searchPlaceholder: "Whole source (ordered tokens + fuzzy lines)…",
|
|
546
|
+
shellSearchAttrs: "",
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function shellDocumentedPairsAttrFromOptions(opts) {
|
|
550
|
+
const emb = opts.documentedPairsEmbeddedB64?.trim() ?? "";
|
|
551
|
+
if (emb.length === 0)
|
|
552
|
+
return "";
|
|
553
|
+
return ` data-documented-pairs-b64="${escapeHtml(emb)}"`;
|
|
554
|
+
}
|
|
206
555
|
/**
|
|
207
556
|
* Static HTML shell for a minimal “code browser”: code + rendered commentray,
|
|
208
557
|
* draggable vertical splitter, togglable line wrap for the code pane, and
|
|
209
558
|
* token-in-line quick search (all non-whitespace tokens must appear on the same line).
|
|
210
559
|
*/
|
|
211
560
|
export async function renderCodeBrowserHtml(opts) {
|
|
212
|
-
const [codeHtml, commentrayHtml] = await Promise.all([
|
|
213
|
-
renderCodeLineBlocks(opts.code, opts.language),
|
|
214
|
-
renderMarkdownToHtml(opts.commentrayMarkdown),
|
|
215
|
-
]);
|
|
216
561
|
const rawCodeB64 = Buffer.from(opts.code, "utf8").toString("base64");
|
|
217
562
|
const rawMdB64 = Buffer.from(opts.commentrayMarkdown, "utf8").toString("base64");
|
|
218
563
|
const title = opts.title ?? opts.filePath ?? "Commentray";
|
|
219
564
|
const filePathHtml = renderFilePathLabel(opts.filePath, title);
|
|
565
|
+
const toolbarEndHtml = buildToolbarEndHtml(opts.githubRepoUrl, opts.toolHomeUrl);
|
|
220
566
|
const hljs = opts.hljsTheme ?? "github";
|
|
221
567
|
const hljsDark = opts.hljsTheme?.includes("dark") ? opts.hljsTheme : "github-dark";
|
|
222
|
-
const mermaidScript = opts.includeMermaidRuntime
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
:
|
|
568
|
+
const mermaidScript = mermaidRuntimeScriptHtml(opts.includeMermaidRuntime);
|
|
569
|
+
const relatedNavHtml = renderRelatedGithubNavHtml(opts.relatedGithubNav ?? []);
|
|
570
|
+
const generatorMetaHtml = renderGeneratorMetaHtml(opts.generatorLabel);
|
|
571
|
+
const { toolbarDocHubHtml, documentedPanelHtml } = renderToolbarDocHubHtml({
|
|
572
|
+
sourceOnGithubUrl: opts.sourceOnGithubUrl,
|
|
573
|
+
commentrayOnGithubUrl: opts.commentrayOnGithubUrl,
|
|
574
|
+
documentedNavJsonUrl: opts.documentedNavJsonUrl,
|
|
575
|
+
documentedPairsEmbeddedB64: opts.documentedPairsEmbeddedB64,
|
|
576
|
+
});
|
|
577
|
+
const layoutPref = opts.codeBrowserLayout ?? "auto";
|
|
578
|
+
const { layout, shellInner, scrollBlockLinksB64 } = await buildCodeBrowserShell(opts, layoutPref);
|
|
579
|
+
const { searchPlaceholder, shellSearchAttrs } = searchChromeFromOptions(opts);
|
|
580
|
+
const shellDocumentedPairsAttr = shellDocumentedPairsAttrFromOptions(opts);
|
|
229
581
|
return buildCodeBrowserPageHtml({
|
|
230
582
|
title,
|
|
583
|
+
generatorMetaHtml,
|
|
231
584
|
filePathHtml,
|
|
232
|
-
|
|
233
|
-
|
|
585
|
+
toolbarDocHubHtml,
|
|
586
|
+
documentedPanelHtml,
|
|
587
|
+
relatedNavHtml,
|
|
588
|
+
toolbarEndHtml,
|
|
589
|
+
layout,
|
|
590
|
+
shellInner,
|
|
234
591
|
rawCodeB64,
|
|
235
592
|
rawMdB64,
|
|
593
|
+
scrollBlockLinksB64,
|
|
594
|
+
shellDocumentedPairsAttr,
|
|
236
595
|
hljs,
|
|
237
596
|
hljsDark,
|
|
238
597
|
mermaidScript,
|
|
598
|
+
searchPlaceholder,
|
|
599
|
+
shellSearchAttrs,
|
|
239
600
|
});
|
|
240
601
|
}
|
|
241
602
|
//# sourceMappingURL=code-browser.js.map
|
package/dist/code-browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-browser.js","sourceRoot":"","sources":["../src/code-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAchF,SAAS,mBAAmB,CAAC,IAAY;IACvC,MAAM,CAAC,GAAG,qEAAqE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAClG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,kFAAkF;AAClF,KAAK,UAAU,oBAAoB,CAAC,IAAY,EAAE,QAAgB;IAChE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAA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ions } from "./code-browser.js";
|
|
3
|
+
export { commentrayRenderVersion } from "./package-version.js";
|
|
4
|
+
export type { CommentrayOutputUrlOptions, MarkdownPipelineOptions } from "./markdown-pipeline.js";
|
|
3
5
|
export { renderFencedCode, renderMarkdownToHtml } from "./markdown-pipeline.js";
|
|
4
6
|
export { renderSideBySideHtml } from "./side-by-side.js";
|
|
5
7
|
export type { SideBySideOptions } from "./side-by-side.js";
|
|
8
|
+
export { buildCommentrayNavSearchDocument, COMMENTRAY_NAV_SEARCH_SCHEMA_VERSION, } from "./build-commentray-nav-search.js";
|
|
9
|
+
export type { BuildCommentrayNavSearchFallback, BuildCommentrayNavSearchGithubBlobBase, CommentrayNavSearchDocument, CommentrayNavSearchRow, DocumentedPairNav, } from "./build-commentray-nav-search.js";
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EACL,gCAAgC,EAChC,oCAAoC,GACrC,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACV,gCAAgC,EAChC,sCAAsC,EACtC,2BAA2B,EAC3B,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { renderCodeBrowserHtml } from "./code-browser.js";
|
|
2
|
+
export { commentrayRenderVersion } from "./package-version.js";
|
|
2
3
|
export { renderFencedCode, renderMarkdownToHtml } from "./markdown-pipeline.js";
|
|
3
4
|
export { renderSideBySideHtml } from "./side-by-side.js";
|
|
5
|
+
export { buildCommentrayNavSearchDocument, COMMENTRAY_NAV_SEARCH_SCHEMA_VERSION, } from "./build-commentray-nav-search.js";
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EACL,gCAAgC,EAChC,oCAAoC,GACrC,MAAM,kCAAkC,CAAC"}
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* When generating static HTML (Pages, `commentray render`), rewrites `img[src]` and `a[href]`
|
|
3
|
+
* so local assets work from the output file location.
|
|
4
|
+
*
|
|
5
|
+
* **URL rules** (same commentray file as in the editor):
|
|
6
|
+
* - **`/path/to/file`** — repository root (leading slash), POSIX-style.
|
|
7
|
+
* - **`./` / `../` / `figures/a.png`** — relative to the commentray file’s directory
|
|
8
|
+
* (`markdownUrlBaseDirAbs`), i.e. normal Markdown resolution.
|
|
9
|
+
*/
|
|
10
|
+
export type CommentrayOutputUrlOptions = {
|
|
11
|
+
repoRootAbs: string;
|
|
12
|
+
htmlOutputFileAbs: string;
|
|
13
|
+
markdownUrlBaseDirAbs: string;
|
|
14
|
+
/** When set, `https://github.com/<owner>/<repo>/blob|tree/<branch>/…` becomes a `/…` repo path. */
|
|
15
|
+
githubBlobRepo?: {
|
|
16
|
+
owner: string;
|
|
17
|
+
repo: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type MarkdownPipelineOptions = {
|
|
21
|
+
commentrayOutputUrls?: CommentrayOutputUrlOptions;
|
|
22
|
+
};
|
|
23
|
+
export declare function renderMarkdownToHtml(markdown: string, options?: MarkdownPipelineOptions): Promise<string>;
|
|
2
24
|
export declare function renderFencedCode(markdownFence: string): Promise<string>;
|
|
3
25
|
//# sourceMappingURL=markdown-pipeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-pipeline.d.ts","sourceRoot":"","sources":["../src/markdown-pipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown-pipeline.d.ts","sourceRoot":"","sources":["../src/markdown-pipeline.ts"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mGAAmG;IACnG,cAAc,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;CACnD,CAAC;AAwJF,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,MAAM,CAAC,CA0BjB;AAED,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7E"}
|