@rse/specbook 1.2.13 → 1.2.15
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.
|
@@ -50,34 +50,37 @@
|
|
|
50
50
|
let indexed = false
|
|
51
51
|
|
|
52
52
|
/* fill the unit and vocabulary indices once on first use: a unit
|
|
53
|
-
is an outermost paragraph-level element within an article
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
searched text */
|
|
53
|
+
is an outermost paragraph-level element within an article or
|
|
54
|
+
the title page abstract (a lone paragraph being the unit itself),
|
|
55
|
+
i.e. one not nested inside another unit (like a paragraph in a
|
|
56
|
+
table cell, covered by its table row), where a diagram is
|
|
57
|
+
searched by its space-joined SVG text labels (its raw text
|
|
58
|
+
content runs them together), and where the explicit anchor id
|
|
59
|
+
of an object heading or table row joins the searched text */
|
|
60
60
|
const index = () => {
|
|
61
61
|
if (indexed)
|
|
62
62
|
return
|
|
63
63
|
indexed = true
|
|
64
|
-
document.querySelectorAll("article").forEach((
|
|
65
|
-
|
|
66
|
-
.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})
|
|
64
|
+
document.querySelectorAll("article, div.titlepage > .description").forEach((root) => {
|
|
65
|
+
const els = Array.from(root.querySelectorAll(
|
|
66
|
+
"p, li, tr, pre, blockquote, h1, h2, h3, h4, h5, h6, div.diagram"))
|
|
67
|
+
if (root.tagName === "P")
|
|
68
|
+
els.unshift(root)
|
|
69
|
+
els.forEach((el) => {
|
|
70
|
+
let parent = el.parentElement
|
|
71
|
+
while (parent !== null && parent !== root) {
|
|
72
|
+
if (/^(TR|TD|TH|LI|P|BLOCKQUOTE)$/.test(parent.tagName))
|
|
73
|
+
return
|
|
74
|
+
parent = parent.parentElement
|
|
75
|
+
}
|
|
76
|
+
const id = (el.dataset.id ?? "").toLowerCase()
|
|
77
|
+
const text = ((el.classList.contains("diagram") ?
|
|
78
|
+
Array.from(el.querySelectorAll("text")).map((t) => t.textContent ?? "").join(" ") :
|
|
79
|
+
(el.textContent ?? "")) + " " + id).toLowerCase()
|
|
80
|
+
const words = new Set(text.split(/[^\p{L}\p{N}]+/u).filter((w) => w !== ""))
|
|
81
|
+
words.forEach((w) => { vocab.add(w) })
|
|
82
|
+
units.push({ el, id, text, words, keep: false })
|
|
83
|
+
})
|
|
81
84
|
})
|
|
82
85
|
|
|
83
86
|
/* let a hyperlink whose target the filtering hid leave the
|
|
@@ -1350,9 +1350,6 @@ div.titlepage .author {
|
|
|
1350
1350
|
font-size: 1.25rem;
|
|
1351
1351
|
margin-top: 2rem;
|
|
1352
1352
|
}
|
|
1353
|
-
div.titlepage p.description {
|
|
1354
|
-
margin: 2rem 0 0.5rem 0;
|
|
1355
|
-
}
|
|
1356
1353
|
div.titlepage table.meta {
|
|
1357
1354
|
margin: 1rem auto 0 auto;
|
|
1358
1355
|
color: var(--theme-color-specbook-muted);
|
|
@@ -1363,6 +1360,22 @@ div.titlepage table.meta td {
|
|
|
1363
1360
|
padding: 0rem 0.5rem;
|
|
1364
1361
|
text-align: left;
|
|
1365
1362
|
}
|
|
1363
|
+
/* the description of the title object is the abstract closing the
|
|
1364
|
+
title page: justified, the follow-up paragraphs indented */
|
|
1365
|
+
div.titlepage p.description,
|
|
1366
|
+
div.titlepage div.description {
|
|
1367
|
+
margin: 3rem auto 0.5rem auto;
|
|
1368
|
+
max-width: 44rem;
|
|
1369
|
+
text-align: justify;
|
|
1370
|
+
hyphens: auto;
|
|
1371
|
+
}
|
|
1372
|
+
div.titlepage div.description p {
|
|
1373
|
+
margin: 0;
|
|
1374
|
+
}
|
|
1375
|
+
div.titlepage div.description p + p:not(.rationale) {
|
|
1376
|
+
margin-top: 0.4rem;
|
|
1377
|
+
text-indent: 3rem;
|
|
1378
|
+
}
|
|
1366
1379
|
/* the fuzzy search tab (screen-only): the middle tab riding right of
|
|
1367
1380
|
the brand bar between the info tab and the folding
|
|
1368
1381
|
tab (as wide as those, fixed independent of the content
|
|
@@ -38,9 +38,9 @@ const templates = {
|
|
|
38
38
|
<div class="theme-switch" onclick="themeSwitch()" title="switch color theme"><svg class="theme-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><circle cx="12" cy="12" r="8.5"/><path d="M12 3.5 A 8.5 8.5 0 0 0 12 20.5 Z" fill="currentColor" stroke="none"/></svg></div>
|
|
39
39
|
{% if Document.info %}<div class="info-switch" title="toggle description popups"><svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><circle cx="12" cy="12" r="8.5"/><line x1="12" y1="11" x2="12" y2="16"/><line x1="12" y1="7.75" x2="12.01" y2="7.75"/></svg></div>{% endif %}
|
|
40
40
|
<div class="search" id="search">
|
|
41
|
-
<div class="search-toggle" id="search-toggle" title="toggle search field"><svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"
|
|
41
|
+
<div class="search-toggle" id="search-toggle" title="toggle search field"><svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="3.5,4.5 20.5,4.5 14,12.5 14,20 10,17.5 10,12.5"/></svg></div>
|
|
42
42
|
<div class="search-field">
|
|
43
|
-
<input type="text" id="search-input" placeholder="
|
|
43
|
+
<input type="text" id="search-input" placeholder="Filter… (fuzzy matched keywords)" autocomplete="off" spellcheck="false"/>
|
|
44
44
|
<span class="search-clear" id="search-clear" title="clear search">×</span>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rse/specbook",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.15",
|
|
4
4
|
"publishConfig": { "access": "public" },
|
|
5
5
|
"description": "Markdown-based Specification Format (API, CLI and MCP service)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"glob": "13.0.6",
|
|
41
41
|
"picomatch": "4.0.7",
|
|
42
42
|
"es-toolkit": "1.52.0",
|
|
43
|
-
"fastify": "5.12.
|
|
44
|
-
"@fastify/websocket": "11.3.
|
|
43
|
+
"fastify": "5.12.5",
|
|
44
|
+
"@fastify/websocket": "11.3.1",
|
|
45
45
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
46
46
|
"zod": "4.6.5"
|
|
47
47
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"globals": "17.12.0",
|
|
56
56
|
"markdownlint": "0.41.1",
|
|
57
57
|
"markdownlint-cli2": "0.23.2",
|
|
58
|
-
"@types/node": "26.
|
|
58
|
+
"@types/node": "26.6.1",
|
|
59
59
|
"@types/picomatch": "4.0.3",
|
|
60
60
|
"@types/subset-font": "2.3.0",
|
|
61
61
|
"@types/nunjucks": "3.2.6",
|