eyeprolog 1.5.14 → 1.5.16
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/package.json +1 -1
- package/test/run-regression.mjs +13 -0
- package/the-art-of-eyeprolog.md +2125 -569
- package/tools/generate-predicate-reference.mjs +21 -13
package/package.json
CHANGED
package/test/run-regression.mjs
CHANGED
|
@@ -4794,6 +4794,16 @@ function documentationSyncCases() {
|
|
|
4794
4794
|
assertEqual(result.status, 0, 'exit status');
|
|
4795
4795
|
assertIncludes(result.stdout, 'predicate reference is up to date (518 predicates)', 'stdout');
|
|
4796
4796
|
assertEqual(result.stderr, '', 'stderr');
|
|
4797
|
+
|
|
4798
|
+
const book = fs.readFileSync(path.join(packageRoot, 'the-art-of-eyeprolog.md'), 'utf8');
|
|
4799
|
+
const section = between(book, '<!-- eyeprolog-predicate-reference:start -->', '<!-- eyeprolog-predicate-reference:end -->');
|
|
4800
|
+
assertEqual(section.split('\n').some((line) => line.trimStart().startsWith('|')), false, 'predicate reference avoids Markdown tables and horizontal overflow');
|
|
4801
|
+
assertEqual((section.match(/^- \*\*`/gm) ?? []).length, 518, 'one stacked reference entry per predicate');
|
|
4802
|
+
assertEqual((section.match(/<a id="predicate-reference-\d{4}"><\/a>/g) ?? []).length, 518, 'one explicit stable anchor per predicate');
|
|
4803
|
+
assertEqual((section.match(/\]\(#predicate-reference-\d{4}\)/g) ?? []).length, 518, 'one direct index link per predicate');
|
|
4804
|
+
assertNotIncludes(section, '[Symbols](#predicate-reference-symbols)', 'predicate index does not rely on renderer-generated group anchors');
|
|
4805
|
+
assertIncludes(section, 'stable numeric IDs instead of relying on Markdown heading-slug rules', 'renderer-independent predicate anchors');
|
|
4806
|
+
assertIncludes(section, 'wrap naturally on narrow screens without horizontal scrolling', 'responsive predicate reference layout');
|
|
4797
4807
|
},
|
|
4798
4808
|
},
|
|
4799
4809
|
{
|
|
@@ -8071,6 +8081,9 @@ function markdownAnchors(file) {
|
|
|
8071
8081
|
counts.set(base, count + 1);
|
|
8072
8082
|
anchors.add(count === 0 ? base : `${base}-${count}`);
|
|
8073
8083
|
}
|
|
8084
|
+
for (const match of text.matchAll(/<(?:a|[A-Za-z][A-Za-z0-9:-]*)\b[^>]*\b(?:id|name)=["']([^"']+)["'][^>]*>/g)) {
|
|
8085
|
+
anchors.add(match[1]);
|
|
8086
|
+
}
|
|
8074
8087
|
return anchors;
|
|
8075
8088
|
}
|
|
8076
8089
|
|