@bendyline/gezel 1.0.1 → 1.0.2
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/checks/index.js +10 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/checks/index.js
CHANGED
|
@@ -1445,6 +1445,14 @@ function cleanHeading(text) {
|
|
|
1445
1445
|
function documentH1s(markdown) {
|
|
1446
1446
|
return [...markdown.matchAll(/^#\s+(.+?)\s*$/gm)].map((match) => match[1].trim());
|
|
1447
1447
|
}
|
|
1448
|
+
function documentH2s(markdown) {
|
|
1449
|
+
return [...markdown.matchAll(/^##\s+(.+?)\s*$/gm)].map((match) => match[1].trim());
|
|
1450
|
+
}
|
|
1451
|
+
function headingLevelHint(file, documentHeadings, h2s, expected) {
|
|
1452
|
+
if (documentHeadings.length > 1 || h2s.length !== expected || expected === 0) return null;
|
|
1453
|
+
const title = documentHeadings.length === 1 ? ` and \`# ${documentHeadings[0]}\` as a title` : "";
|
|
1454
|
+
return `${file} puts its ${expected} slides at \`##\`${title}, but slides are split on H1 \u2014 as written this converts to a single slide. Promote each \`## Slide\` heading to \`# \` and drop the document title.`;
|
|
1455
|
+
}
|
|
1448
1456
|
function outlineSlideHeadings(markdown) {
|
|
1449
1457
|
const headings = [];
|
|
1450
1458
|
for (const match of markdown.matchAll(/^#{2,6}\s+(.+?)\s*$/gm)) {
|
|
@@ -1483,9 +1491,10 @@ async function markdownHeadingsMatch(ws, file, outlineFile) {
|
|
|
1483
1491
|
};
|
|
1484
1492
|
}
|
|
1485
1493
|
if (actual.length !== expected.length) {
|
|
1494
|
+
const levelHint = headingLevelHint(file, actual, documentH2s(document), expected.length);
|
|
1486
1495
|
return {
|
|
1487
1496
|
ok: false,
|
|
1488
|
-
detail: `${file} has ${actual.length} H1 slide headings, but ${outlineFile} locks ${expected.length}. Add or remove slides without merging outline items.`,
|
|
1497
|
+
detail: levelHint ?? `${file} has ${actual.length} H1 slide headings, but ${outlineFile} locks ${expected.length}. Add or remove slides without merging outline items.`,
|
|
1489
1498
|
outlineHeadings: expected,
|
|
1490
1499
|
documentHeadings: actual
|
|
1491
1500
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3494,7 +3494,7 @@ declare function deriveThreadTitleFromMessages(messages: readonly ThreadTitleMes
|
|
|
3494
3494
|
* The package version is embedded into health responses and logs so clients
|
|
3495
3495
|
* can surface it in the UI.
|
|
3496
3496
|
*/
|
|
3497
|
-
declare const GEZEL_VERSION = "1.0.
|
|
3497
|
+
declare const GEZEL_VERSION = "1.0.2";
|
|
3498
3498
|
/**
|
|
3499
3499
|
* The date-based line this build sits on, for content compatibility only.
|
|
3500
3500
|
*
|
package/dist/index.js
CHANGED
|
@@ -26862,7 +26862,7 @@ function deriveThreadTitleFromMessages(messages, options = {}) {
|
|
|
26862
26862
|
}
|
|
26863
26863
|
|
|
26864
26864
|
// src/index.ts
|
|
26865
|
-
var GEZEL_VERSION = "1.0.
|
|
26865
|
+
var GEZEL_VERSION = "1.0.2";
|
|
26866
26866
|
var GEZEL_CONTENT_COMPAT = "1.26225";
|
|
26867
26867
|
function nowIso() {
|
|
26868
26868
|
return (/* @__PURE__ */ new Date()).toISOString();
|