Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion scripts/build-npa-book.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ async function renderChapter(chapter, markdown) {
if (!list.length) return;
html.push("<ul>");
for (const item of list) {
html.push(`<li>${formatInline(item)}</li>`);
html.push(
`<li class="doc-block" data-section="${
chapter.number
}" data-text="${escapeAttribute(item)}">`,
);
html.push(formatInline(item));
html.push(
`<a class="bug-link" title="Report an issue with this section" aria-label="Report issue"></a>`,
);
html.push("</li>");
}
html.push("</ul>");
list = [];
Expand Down Expand Up @@ -131,22 +140,40 @@ async function renderChapter(chapter, markdown) {
if (sourceLevel === 1) {
title = headingText;
html.push(`<p class="chapter-kicker">Section ${chapter.number}</p>`);
html.push(
`<div class="doc-block" data-section="${
chapter.number
}" data-text="${escapeAttribute(headingText)}">`,
);
html.push(
`<h${outputLevel} id="${headingId}" class="chapter-title">${formatInline(
headingText,
)}</h${outputLevel}>`,
);
html.push(
`<a class="bug-link" title="Report an issue with this section" aria-label="Report issue"></a>`,
);
html.push(`</div>`);
} else {
headings.push({
id: headingId,
title: headingText,
level: sourceLevel,
});
html.push(
`<div class="doc-block" data-section="${
chapter.number
}" data-text="${escapeAttribute(headingText)}">`,
);
html.push(
`<h${outputLevel} id="${headingId}">${formatInline(
headingText,
)}</h${outputLevel}>`,
);
html.push(
`<a class="bug-link" title="Report an issue with this section" aria-label="Report issue"></a>`,
);
html.push(`</div>`);
}
continue;
}
Expand Down
Loading