Skip to content

docs: preserve tab labels and code language tags in agent-facing .md files#2528

Open
birosrichard wants to merge 2 commits into
masterfrom
fix/fix-markdown-issues
Open

docs: preserve tab labels and code language tags in agent-facing .md files#2528
birosrichard wants to merge 2 commits into
masterfrom
fix/fix-markdown-issues

Conversation

@birosrichard
Copy link
Copy Markdown
Contributor

@birosrichard birosrichard commented May 13, 2026

closes: #1884
closes: #2529
Adds two rehype plugins to the signalwire llms-txt pipeline that run before HTML→markdown conversion:

  • rehypeExpandTabs: expands Docusaurus into sequential labeled sections so all tab variants (e.g. JS and Python) are visible with their labels, instead of being dropped or merged into unlabeled blocks
  • rehypeFixCodeLanguage: copies the language-* class from Prism's <pre> to its child <code> so rehype-remark can detect the language and emit correct fenced code blocks (e.g. javascript instead of bare )

cc: @TC-MO
Testable here: https://pr-2528.preview.docs.apify.com/platform/proxy.md

…iles

Adds two rehype plugins to the signalwire llms-txt pipeline that run
before HTML→markdown conversion:

- rehypeExpandTabs: expands Docusaurus <Tabs> into sequential labeled
  sections so all tab variants (e.g. JS and Python) are visible with
  their labels, instead of being dropped or merged into unlabeled blocks
- rehypeFixCodeLanguage: copies the language-* class from Prism's <pre>
  to its child <code> so rehype-remark can detect the language and emit
  correct fenced code blocks (e.g. ```javascript instead of bare ```)

Fixes #2459, #1884

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@birosrichard birosrichard self-assigned this May 13, 2026
@birosrichard birosrichard added the t-web Issues with this label are in the ownership of the web team. label May 13, 2026
@github-actions github-actions Bot added this to the 140th sprint - Web team milestone May 13, 2026
@apify-service-account
Copy link
Copy Markdown

apify-service-account commented May 13, 2026

✅ Preview for this PR (commit f593187) is ready at https://pr-2528.preview.docs.apify.com (see action run).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@birosrichard birosrichard requested a review from TC-MO May 13, 2026 11:46

const { visit, SKIP } = require('unist-util-visit');
const { selectAll } = require('hast-util-select');
const { toString } = require('hast-util-to-string');
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.

Should these be added to package.json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-web Issues with this label are in the ownership of the web team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docusaurus <Tabs> flatten into unlabeled sequential code blocks in .md output tab divided code blocks lost its language tag

3 participants