@redpanda-data/docs-extensions-and-macros 4.16.1 → 4.16.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.
|
@@ -50,6 +50,7 @@ module.exports.register = function () {
|
|
|
50
50
|
let directiveText = directiveMarkdown.replace(/^>\s*/, '')
|
|
51
51
|
|
|
52
52
|
// Convert markdown links [text](url) to HTML <a> tags
|
|
53
|
+
// Add space after <a to match afdocs test pattern expectations
|
|
53
54
|
// Add tabindex="-1" and aria-hidden="true" to remove from tab order and hide from assistive tech
|
|
54
55
|
directiveText = directiveText.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" tabindex="-1" aria-hidden="true">$1</a>')
|
|
55
56
|
|
|
@@ -607,9 +607,10 @@ function generateNavigationSection(siteUrl, contentCatalog, components) {
|
|
|
607
607
|
|
|
608
608
|
// Generate component sitemaps dynamically
|
|
609
609
|
nav += `### Component sitemaps\n\n`;
|
|
610
|
+
const internalComponents = ['home', 'shared', 'search', 'api'];
|
|
610
611
|
components.forEach(component => {
|
|
611
|
-
// Skip internal components
|
|
612
|
-
if (component.name
|
|
612
|
+
// Skip internal/utility components
|
|
613
|
+
if (internalComponents.includes(component.name)) return;
|
|
613
614
|
nav += `- [${component.title}](${siteUrl}/sitemap-${component.name}.md)\n`;
|
|
614
615
|
});
|
|
615
616
|
|
package/package.json
CHANGED
|
@@ -9,13 +9,15 @@ function bloblangExample(example) {
|
|
|
9
9
|
let summary = example.summary.trim();
|
|
10
10
|
|
|
11
11
|
// Convert Markdown headings to AsciiDoc
|
|
12
|
+
// Cap at H2 level to avoid creating multiple document titles (H1)
|
|
12
13
|
// ##### Heading -> === Heading (H5 -> H3 in AsciiDoc)
|
|
13
14
|
// H3 fits correctly under the H2 "Examples" section
|
|
14
15
|
summary = summary.replace(/^#####\s+(.+)$/gm, '=== $1');
|
|
15
16
|
// #### Heading -> == Heading (H4 -> H2 in AsciiDoc)
|
|
16
17
|
summary = summary.replace(/^####\s+(.+)$/gm, '== $1');
|
|
17
|
-
// ### Heading ->
|
|
18
|
-
|
|
18
|
+
// ### Heading -> == Heading (H3 -> H2 in AsciiDoc)
|
|
19
|
+
// Capped at H2 to prevent invalid second document title if H3 appears in summaries
|
|
20
|
+
summary = summary.replace(/^###\s+(.+)$/gm, '== $1');
|
|
19
21
|
|
|
20
22
|
// Ensure lead-in ends with a colon (replace period/exclamation/question mark if present)
|
|
21
23
|
if (summary.endsWith('.') || summary.endsWith('!') || summary.endsWith('?')) {
|