Skip to content

fix: track docs-site ROS2+ROS1 merge and inline section headings - #7

Merged
bcastets-robotiq merged 2 commits into
mainfrom
fix-ros-merge-and-inline-headings
Oct 6, 2026
Merged

bcastets-robotiq merged 2 commits into
mainfrom
fix-ros-merge-and-inline-headings

Conversation

@bcastets-robotiq

@bcastets-robotiq bcastets-robotiq commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The daily update-readme run failed (run):

Could not import the "ROS2" software tools section: no AUTO-GENERATED-ROS2-TABLE markers found in robotiq.github.io's docs/intro.mdx. It may have been restructured — refusing to publish a partial section.

Correct behavior — the safety check from PR #2 did exactly its job and refused to publish a broken section. The docs site restructured again:

  • ROS2 and ROS1 merged into a single ROS category (one column, not per-distro).
  • Each section's own ### Heading moved from outside its marker pair to inside it (previously: heading, blank line, {/* START */}; now: {/* START */}, heading, blank line, table).

The second part is a real bug fix, not just a config update: naively updating SOFTWARE_SECTIONS without handling the heading move would have produced a duplicated #### ROS / ### ROS pair in the README (confirmed by actually running the regenerator before this fix).

Fix

  • SOFTWARE_SECTIONS: drop ROS2/ROS1, add single ROS.
  • extractMarkerBlock now strips a leading heading line from the extracted block regardless of which side of the marker it's on, since buildSoftwareToolsSection always supplies its own heading.
  • Refreshed scripts/fixtures/intro.mdx from the live site; updated test expectations to match (new heading list, new product names, new Libraries/ROS paths).
  • Added a regression test for the inline-heading stripping.

Review round 2 (ebarnett3, mbegin-robotiq)

  • Fixed: the heading-strip regex required a trailing newline after the heading, so a block that's nothing but a heading (no other content) passed through unstripped, still leaking a duplicate heading. Fixed per the suggested /^#{1,6}[^\n]*(\n+|$)/, with a regression test for exactly that case.
  • Fixed: strengthened the fixture test with an end-to-end assertion (assert.doesNotMatch(section, /^#{1,3} /m)) that no stray upstream heading leaks through — the previous check only looked for our own #### headings and would've passed even if the strip logic regressed.
  • Deferred, not fixed here: 7 grammar nits in the fixture — all copied verbatim from the live robotiq.github.io page, not something this repo controls. Filed as robotiq/robotiq.github.io#36; replied individually on each thread.

Test plan

  • All 18 tests pass (node --test scripts/*.test.mjs)
  • Ran the script end-to-end against live data — output verified clean (no duplicate headings, correct single ROS table)

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Comment thread scripts/update-readme.mjs Resolved
Comment thread scripts/fixtures/intro.mdx Resolved
Comment thread scripts/fixtures/intro.mdx Resolved
Comment thread scripts/fixtures/intro.mdx Resolved
Comment thread scripts/fixtures/intro.mdx Resolved
Comment thread scripts/fixtures/intro.mdx Resolved
Comment thread scripts/fixtures/intro.mdx Resolved
Comment thread scripts/fixtures/intro.mdx Resolved

@mbegin-robotiq mbegin-robotiq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One non-blocking suggestion inline about test coverage.

Comment thread scripts/update-readme.test.mjs Resolved
- 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 <noreply@anthropic.com>
@bcastets-robotiq

Copy link
Copy Markdown
Collaborator Author

Pushed fixes for both actionable review comments (heading-only edge case + the stronger fixture assertion) in 2253eaa.

Filed robotiq/robotiq.github.io#36 for the grammar nits — those are in the live docs page's own text (copied verbatim into the fixture), not something to fix here.

@bcastets-robotiq
bcastets-robotiq merged commit b103852 into main Oct 6, 2026
2 checks passed
@bcastets-robotiq
bcastets-robotiq deleted the fix-ros-merge-and-inline-headings branch October 6, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants