From 02b87216baf39f773737076ffd23da8f4bf138da Mon Sep 17 00:00:00 2001 From: bcastets-robotiq Date: Mon, 5 Oct 2026 08:56:08 -0400 Subject: [PATCH 1/2] fix: track the ROS2+ROS1 merge and inline section headings The docs site restructured docs/intro.mdx again: ROS2 and ROS1 were merged into a single ROS category (one column instead of per-distro columns), and each section's own "### Heading" moved from outside its marker pair to inside it. The former just needed SOFTWARE_SECTIONS updated; the latter was silently producing a duplicate heading (ours, then the leaked upstream one) until extractMarkerBlock now strips a leading heading line from the extracted block regardless of which side of the marker it's on. Refreshed scripts/fixtures/intro.mdx from the live site and updated the test suite's expectations to match. Co-Authored-By: Claude Sonnet 5 --- profile/README.md | 30 +++-------- scripts/fixtures/intro.mdx | 98 +++++++++++++++++----------------- scripts/update-readme.mjs | 13 +++-- scripts/update-readme.test.mjs | 27 +++++++--- 4 files changed, 86 insertions(+), 82 deletions(-) diff --git a/profile/README.md b/profile/README.md index 6a3c7e9..4f15a80 100644 --- a/profile/README.md +++ b/profile/README.md @@ -43,30 +43,14 @@ Open-source software tools for Robotiq developers. - **C++** — Compiled, performance-oriented object-oriented language. - **Python** — Interpreted, prototyping-oriented language. -#### ROS2 +#### ROS -| Product | Lyrical | Jazzy | Humble | -|---|---|---|---| -| [Adaptive grippers](https://robotiq.github.io/docs/drivers/Adaptive%20grippers) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Adaptive%20grippers/ROS/ROS2-Lyrical) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Adaptive%20grippers/ROS/ROS2-Jazzy) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Adaptive%20grippers/ROS/ROS2-Humble) | -| [EPick](https://robotiq.github.io/docs/drivers/EPick) | - | - | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](https://robotiq.github.io/docs/drivers/EPick/ROS/ROS2-Humble) | -| [Force Torque Sensor](https://robotiq.github.io/docs/drivers/Force%20Torque%20Sensor) | - | - | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](https://robotiq.github.io/docs/drivers/Force%20Torque%20Sensor/ROS/ROS2-Humble) | -| [Tactile Sensor](https://robotiq.github.io/docs/drivers/Tactile%20Sensor) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Tactile%20Sensor/ROS/ROS2-Lyrical) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Tactile%20Sensor/ROS/ROS2-Jazzy) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Tactile%20Sensor/ROS/ROS2-Humble) | - -- **Lyrical** — ROS 2 LTS release (2026). -- **Jazzy** — ROS 2 LTS release (2024), supported until 2029. -- **Humble** — ROS 2 LTS release (2022), supported until 2027. - -#### ROS1 - -| Product | Noetic | Melodic | Kinetic | Indigo | -|---|---|---|---|---| -| [Adaptive grippers](https://robotiq.github.io/docs/drivers/Adaptive%20grippers) | - | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](https://robotiq.github.io/docs/drivers/Adaptive%20grippers/ROS/ROS1-Melodic) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](https://robotiq.github.io/docs/drivers/Adaptive%20grippers/ROS/ROS1-Kinetic) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](https://robotiq.github.io/docs/drivers/Adaptive%20grippers/ROS/ROS1-Indigo) | -| [Tactile Sensor](https://robotiq.github.io/docs/drivers/Tactile%20Sensor) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Tactile%20Sensor/ROS/ROS1-Noetic) | - | - | - | - -- **Noetic** — Final ROS 1 release (2020), end of life May 2025. -- **Melodic** — ROS 1 release (2018), end of life. -- **Kinetic** — ROS 1 release (2016), end of life. -- **Indigo** — ROS 1 release (2014), end of life. +| Product | ROS | +|---|---| +| [Adaptive grippers](https://robotiq.github.io/docs/drivers/Adaptive%20grippers) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Adaptive%20grippers/ROS) | +| [EPick](https://robotiq.github.io/docs/drivers/EPick) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](https://robotiq.github.io/docs/drivers/EPick/ROS) | +| [Force Torque Sensor](https://robotiq.github.io/docs/drivers/Force%20Torque%20Sensor) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](https://robotiq.github.io/docs/drivers/Force%20Torque%20Sensor/ROS) | +| [Tactile Sensor](https://robotiq.github.io/docs/drivers/Tactile%20Sensor) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](https://robotiq.github.io/docs/drivers/Tactile%20Sensor/ROS) | #### Simulation diff --git a/scripts/fixtures/intro.mdx b/scripts/fixtures/intro.mdx index 413471a..9ec1e72 100644 --- a/scripts/fixtures/intro.mdx +++ b/scripts/fixtures/intro.mdx @@ -4,80 +4,80 @@ sidebar_label: Overview sidebar_position: 0 --- -## Hardware documentation - -Robotiq hardware communication protocols are described in detail in the product -manuals, which serve as the reference for developing custom drivers. - -Hardware manuals are available on Robotiq support website: -https://robotiq.com/support +## Introduction + +Lots of software tools are available to work with `Robotiq` products. Some of +those tools are developed and maintained by `Robotiq` and some other by the +community of developers. + +You will find in this documentation website the documentation for the software +tools developed and maintained by `Robotiq` as well as reference to the +software tools developed by the community. + +:::info +For details about `Robotiq` product hardware, please refer to the corresponding +Hardware manual available on [Robotiq support website](https://robotiq.com/support). +::: + +This site has a sitewide **Stable / Development (main)** switcher, at the +top of every page, covering every `Robotiq`-maintained tool. **Stable** is +the version you want if you're integrating against one of these tools — +it always tracks that tool's newest tagged release, and is the only +version this site makes any compatibility commitment about. +**Development (main)** documents in-progress work and can change without +notice. See the [software stability policy](/docs/api-stability) for the +full details. ## Software tools -Badge colors indicate who maintains the integration: ![Robotiq](https://img.shields.io/badge/Robotiq-blue) an official Robotiq-maintained driver, ![Third party](https://img.shields.io/badge/Third_party-lightgrey) a community-maintained project. +Here below is a summary about available tools. -### Libraries +Badge colors indicate who maintains the integration: ![Robotiq](https://img.shields.io/badge/Robotiq-blue) an official `Robotiq` maintained driver, ![Third party](https://img.shields.io/badge/Third_party-lightgrey) a community-maintained project. {/* AUTO-GENERATED-LIBRARIES-TABLE:START */} +### Libraries + | Product | C | C++ | Python | |---|---|---|---| -| [2F / Hand-E](drivers/2F%20hande) | - | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/2F%20hande/SDK/C++) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/SDK/Python) | -| [FT300-S](drivers/FT300) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/FT300/SDK/C) | - | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/FT300/SDK/Python) | -| [TSF-85](drivers/TSF-85) | - | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/TSF-85/SDK/C++) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/TSF-85/SDK/Python) | +| [Adaptive grippers](drivers/Adaptive%20grippers) | - | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/Adaptive%20grippers/Libraries/C++) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/Adaptive%20grippers/Libraries/Python) | +| [Force Torque Sensor](drivers/Force%20Torque%20Sensor) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/Force%20Torque%20Sensor/Libraries/C) | - | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/Force%20Torque%20Sensor/Libraries/Python) | +| [Tactile Sensor](drivers/Tactile%20Sensor) | - | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/Tactile%20Sensor/Libraries/C++) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/Tactile%20Sensor/Libraries/Python) | -- **C** — Low-level C driver talking directly to the hardware's communication protocol (e.g. Modbus RTU, serial). -- **C++** — Low-level C++ driver/SDK for direct hardware integration. -- **Python** — Python driver/SDK for scripting and rapid prototyping. +- **C** — Compiled, performance-oriented language. +- **C++** — Compiled, performance-oriented object-oriented language. +- **Python** — Interpreted, prototyping-oriented language. {/* AUTO-GENERATED-LIBRARIES-TABLE:END */} +{/* AUTO-GENERATED-ROS-TABLE:START */} ### ROS -#### ROS2 - -{/* AUTO-GENERATED-ROS2-TABLE:START */} -| Product | Rolling | Jazzy | Iron | Humble | -|---|---|---|---|---| -| [2F / Hand-E](drivers/2F%20hande) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/ROS/ROS2-Rolling) | - | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/ROS/ROS2-Iron) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/ROS/ROS2-Humble) | -| [FT300-S](drivers/FT300) | - | - | - | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/FT300/ROS/ROS2-Humble) | -| [TSF-85](drivers/TSF-85) | - | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/TSF-85/ROS/ROS2-Jazzy) | - | - | - -- **Rolling** — ROS 2 rolling development distro, always tracking the latest sources. -- **Jazzy** — ROS 2 LTS release (2024), supported until 2029. -- **Iron** — ROS 2 release (2023), end of life. -- **Humble** — ROS 2 LTS release (2022), supported until 2027. -{/* AUTO-GENERATED-ROS2-TABLE:END */} - -#### ROS1 - -{/* AUTO-GENERATED-ROS1-TABLE:START */} -| Product | Melodic | Kinetic | Jade | Indigo | -|---|---|---|---|---| -| [2F / Hand-E](drivers/2F%20hande) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/ROS/ROS1-Melodic) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/ROS/ROS1-Kinetic) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/ROS/ROS1-Jade) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/ROS/ROS1-Indigo) | - -- **Melodic** — ROS 1 release (2018), end of life. -- **Kinetic** — ROS 1 release (2016), end of life. -- **Jade** — ROS 1 release (2015), end of life. -- **Indigo** — ROS 1 release (2014), end of life. -{/* AUTO-GENERATED-ROS1-TABLE:END */} +| Product | ROS | +|---|---| +| [Adaptive grippers](drivers/Adaptive%20grippers) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/Adaptive%20grippers/ROS) | +| [EPick](drivers/EPick) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/EPick/ROS) | +| [Force Torque Sensor](drivers/Force%20Torque%20Sensor) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/Force%20Torque%20Sensor/ROS) | +| [Tactile Sensor](drivers/Tactile%20Sensor) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/Tactile%20Sensor/ROS) | +{/* AUTO-GENERATED-ROS-TABLE:END */} +{/* AUTO-GENERATED-SIMULATION-TABLE:START */} ### Simulation -{/* AUTO-GENERATED-SIMULATION-TABLE:START */} -| Product | Isaac Sim | PyBullet | -|---|---|---| -| [2F / Hand-E](drivers/2F%20hande) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/Physics%20Engine/Isaac%20Sim) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/Physics%20Engine/PyBullet) | -| [TSF-85](drivers/TSF-85) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/TSF-85/Physics%20Engine/Isaac%20Sim) | - | +| Product | Isaac Sim | PyBullet | MuJoCo | +|---|---|---|---| +| [Adaptive grippers](drivers/Adaptive%20grippers) | [![Robotiq](https://img.shields.io/badge/Robotiq-blue)](drivers/Adaptive%20grippers/Simulation/Isaac%20Sim) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/Adaptive%20grippers/Simulation/PyBullet) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/Adaptive%20grippers/Simulation/MuJoCo) | +| [Tactile Sensor](drivers/Tactile%20Sensor) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/Tactile%20Sensor/Simulation/Isaac%20Sim) | - | - | - **Isaac Sim** — NVIDIA Isaac Sim integration for simulating the hardware. - **PyBullet** — PyBullet integration for physics-based simulation. +- **MuJoCo** — MuJoCo (MJCF) model for physics-based simulation. {/* AUTO-GENERATED-SIMULATION-TABLE:END */} +{/* AUTO-GENERATED-OTHER-TABLE:START */} ### Other community projects -{/* AUTO-GENERATED-OTHER-TABLE:START */} | Product | GraspGen | |---|---| -| [2F / Hand-E](drivers/2F%20hande) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/2F%20hande/Other/GraspGen) | +| [Adaptive grippers](drivers/Adaptive%20grippers) | [![Third party](https://img.shields.io/badge/Third_party-lightgrey)](drivers/Adaptive%20grippers/Other/GraspGen) | - **GraspGen** — NVIDIA GraspGen asset/model package with Robotiq gripper definitions for grasp synthesis research. {/* AUTO-GENERATED-OTHER-TABLE:END */} \ No newline at end of file diff --git a/scripts/update-readme.mjs b/scripts/update-readme.mjs index 0b7e109..c706aa7 100644 --- a/scripts/update-readme.mjs +++ b/scripts/update-readme.mjs @@ -2,7 +2,7 @@ // - "Repositories": one row per public, non-archived, non-fork repo in the // robotiq GitHub org (excluding this repo and the docs site itself), // pulled live from the GitHub API. -// - "Software tools": the Libraries / ROS2 / ROS1 / Simulation / Other tables +// - "Software tools": the Libraries / ROS / Simulation / Other tables // imported from robotiq/robotiq.github.io's docs/intro.mdx (itself kept // up to date by that repo's own scripts/generate-tools-table.js), with // relative doc links rewritten to absolute robotiq.github.io URLs. @@ -30,8 +30,7 @@ const EXCLUDED_REPOS = new Set(['.github', DOCS_REPO]); const SOFTWARE_SECTIONS = [ { key: 'LIBRARIES', heading: 'Libraries' }, - { key: 'ROS2', heading: 'ROS2' }, - { key: 'ROS1', heading: 'ROS1' }, + { key: 'ROS', heading: 'ROS' }, { key: 'SIMULATION', heading: 'Simulation' }, { key: 'OTHER', heading: 'Other community projects' }, ]; @@ -90,7 +89,13 @@ export function extractMarkerBlock(raw, key) { `\\{/\\* AUTO-GENERATED-${key}-TABLE:START \\*/\\}\\n([\\s\\S]*?)\\n\\{/\\* AUTO-GENERATED-${key}-TABLE:END \\*/\\}` ); const m = raw.match(re); - return m ? m[1].trim() : null; + if (!m) return null; + // Whether the section's own `### Heading` sits inside or outside the + // marker pair has changed upstream before (outside as of the original + // format, inside as of the Libraries/ROS/Simulation restructure) — strip + // a leading heading line either way, since buildSoftwareToolsSection + // always supplies its own heading and a leaked one would duplicate it. + return m[1].trim().replace(/^#{1,6}[^\n]*\n+/, '').trim(); } // docs/intro.mdx lives at the docs/ root, so a document-relative link in it diff --git a/scripts/update-readme.test.mjs b/scripts/update-readme.test.mjs index f37bb0b..14a9124 100644 --- a/scripts/update-readme.test.mjs +++ b/scripts/update-readme.test.mjs @@ -50,6 +50,21 @@ test('extractMarkerBlock returns null when the marker pair is absent', () => { assert.equal(extractMarkerBlock('no markers here', 'LIBRARIES'), null); }); +test('extractMarkerBlock strips a leading heading line inside the marker pair', () => { + // The docs site has put the section's own "### Heading" both outside and + // inside the marker pair across different restructures — strip it either + // way, since buildSoftwareToolsSection supplies its own heading and a + // leaked one would duplicate it in the README. + const raw = [ + '{/* AUTO-GENERATED-LIBRARIES-TABLE:START */}', + '### Libraries', + '', + '| a | b |', + '{/* AUTO-GENERATED-LIBRARIES-TABLE:END */}', + ].join('\n'); + assert.equal(extractMarkerBlock(raw, 'LIBRARIES'), '| a | b |'); +}); + test('absolutizeDocLinks rewrites relative links, leaves absolute/anchor links alone', () => { const input = '[a](drivers/Foo) [b](img/x.png) [c](./drivers/Foo) [d](https://example.com) [e](#section)'; const output = absolutizeDocLinks(input); @@ -68,7 +83,7 @@ test('absolutizeDocLinks prepends only the domain to a site-root-relative link, }); function fakeIntro(overrides = {}) { - const sections = { LIBRARIES: '| sdk |', ROS2: '| ros2 |', ROS1: '| ros1 |', SIMULATION: '| phys |', OTHER: '| other |', ...overrides }; + const sections = { LIBRARIES: '| sdk |', ROS: '| ros |', SIMULATION: '| phys |', OTHER: '| other |', ...overrides }; return Object.entries(sections) .filter(([, body]) => body !== null) .map(([key, body]) => `{/* AUTO-GENERATED-${key}-TABLE:START */}\n${body}\n{/* AUTO-GENERATED-${key}-TABLE:END */}`) @@ -78,7 +93,7 @@ function fakeIntro(overrides = {}) { test('buildSoftwareToolsSection includes every section heading, in order, when all markers are present', () => { const section = buildSoftwareToolsSection(fakeIntro()); const headings = [...section.matchAll(/^#### (.+)$/gm)].map((m) => m[1]); - assert.deepEqual(headings, ['Libraries', 'ROS2', 'ROS1', 'Simulation', 'Other community projects']); + assert.deepEqual(headings, ['Libraries', 'ROS', 'Simulation', 'Other community projects']); }); test('buildSoftwareToolsSection throws instead of publishing a partial section when a marker is missing', () => { @@ -157,13 +172,13 @@ test('buildSoftwareToolsSection matches a real intro.mdx fixture (catches upstre const section = buildSoftwareToolsSection(fixture); const headings = [...section.matchAll(/^#### (.+)$/gm)].map((m) => m[1]); - assert.deepEqual(headings, ['Libraries', 'ROS2', 'ROS1', 'Simulation', 'Other community projects']); + assert.deepEqual(headings, ['Libraries', 'ROS', 'Simulation', 'Other community projects']); // Links absolutized against the docs site, not left root-relative. - assert.match(section, /\[2F \/ Hand-E\]\(https:\/\/robotiq\.github\.io\/docs\/drivers\/2F%20hande\)/); - assert.match(section, /\]\(https:\/\/robotiq\.github\.io\/docs\/drivers\/2F%20hande\/SDK\/C\+\+\)/); + assert.match(section, /\[Adaptive grippers\]\(https:\/\/robotiq\.github\.io\/docs\/drivers\/Adaptive%20grippers\)/); + assert.match(section, /\]\(https:\/\/robotiq\.github\.io\/docs\/drivers\/Adaptive%20grippers\/Libraries\/C\+\+\)/); // Legend text (not just table rows) survives. - assert.match(section, /ROS 2 LTS release \(2022\), supported until 2027\./); + assert.match(section, /Compiled, performance-oriented language\./); // Nothing upstream-relative leaks into the README unresolved. assert.doesNotMatch(section, /\]\(drivers\//); }); From 2253eaa789e9ed75d29069cfe0901900d576944b Mon Sep 17 00:00:00 2001 From: bcastets-robotiq Date: Tue, 6 Oct 2026 12:03:35 -0400 Subject: [PATCH 2/2] fix: handle heading-only marker blocks, add end-to-end leak check - extractMarkerBlock's heading-strip regex required a trailing newline after the heading, so a block consisting of nothing but a heading (reproduced by ebarnett3) passed through unstripped, leaking a duplicate heading. Fixed per their suggested /^#{1,6}[^\n]*(\n+|$)/, with a regression test for the exact case. - Added mbegin-robotiq's suggested assertion to the fixture test: the existing heading check only matched our own #### lines and would still pass if a stray upstream ### leaked through alongside them. Review feedback from PR #7. Co-Authored-By: Claude Sonnet 5 --- scripts/update-readme.mjs | 2 +- scripts/update-readme.test.mjs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/scripts/update-readme.mjs b/scripts/update-readme.mjs index c706aa7..b67762d 100644 --- a/scripts/update-readme.mjs +++ b/scripts/update-readme.mjs @@ -95,7 +95,7 @@ export function extractMarkerBlock(raw, key) { // format, inside as of the Libraries/ROS/Simulation restructure) — strip // a leading heading line either way, since buildSoftwareToolsSection // always supplies its own heading and a leaked one would duplicate it. - return m[1].trim().replace(/^#{1,6}[^\n]*\n+/, '').trim(); + return m[1].trim().replace(/^#{1,6}[^\n]*(\n+|$)/, '').trim(); } // docs/intro.mdx lives at the docs/ root, so a document-relative link in it diff --git a/scripts/update-readme.test.mjs b/scripts/update-readme.test.mjs index 14a9124..9c10d6d 100644 --- a/scripts/update-readme.test.mjs +++ b/scripts/update-readme.test.mjs @@ -65,6 +65,19 @@ test('extractMarkerBlock strips a leading heading line inside the marker pair', assert.equal(extractMarkerBlock(raw, 'LIBRARIES'), '| a | b |'); }); +test('extractMarkerBlock strips a heading even when it is the only thing in the block', () => { + // The trailing \n+ in the strip regex only matched when something + // followed the heading — a block that's nothing but a heading has no + // trailing newline left (the outer regex already consumed the one before + // END), so it came through unchanged, leaking a duplicate heading. + const raw = [ + '{/* AUTO-GENERATED-LIBRARIES-TABLE:START */}', + '### Libraries', + '{/* AUTO-GENERATED-LIBRARIES-TABLE:END */}', + ].join('\n'); + assert.equal(extractMarkerBlock(raw, 'LIBRARIES'), ''); +}); + test('absolutizeDocLinks rewrites relative links, leaves absolute/anchor links alone', () => { const input = '[a](drivers/Foo) [b](img/x.png) [c](./drivers/Foo) [d](https://example.com) [e](#section)'; const output = absolutizeDocLinks(input); @@ -173,6 +186,11 @@ test('buildSoftwareToolsSection matches a real intro.mdx fixture (catches upstre const headings = [...section.matchAll(/^#### (.+)$/gm)].map((m) => m[1]); assert.deepEqual(headings, ['Libraries', 'ROS', 'Simulation', 'Other community projects']); + // The heading check above only matches our own `####` lines — it would + // still pass even if extractMarkerBlock regressed and let the fixture's + // own `### Heading` lines leak through alongside ours. Assert directly + // that none did. + assert.doesNotMatch(section, /^#{1,3} /m); // Links absolutized against the docs site, not left root-relative. assert.match(section, /\[Adaptive grippers\]\(https:\/\/robotiq\.github\.io\/docs\/drivers\/Adaptive%20grippers\)/);