mdx-to-markdown
БесплатноЗапускает вложенные скриптыНе проверенConvert `.mdx` to portable `.md`, cleaning MDX components, anchors, code titles, table-of-contents links, and root-relative docs links.
от rstackjs★ 101 звезда на GitHubОб этом скилле
MDX to Markdown
Overview
Use this skill to produce plain Markdown from MDX without requiring the target renderer to understand MDX imports, JSX components, Rspress anchors, or code-block metadata.
Workflow
Identify the source
.mdxand target.mdpath. If the user gives only a source path, default the output to the same path with.md.Inspect the MDX for non-Markdown constructs:
- YAML frontmatter.
- top-level
importlines. - custom components such as
<BlogAuthors />and<PackageManagerTabs />. - heading anchors like
### Title \{#title}. - standalone HTML anchors like
<a id="title"></a>. - fenced code block titles such as a JavaScript fence with
title="env.js". - HTML image wrappers such as centered
<div><img ... /></div>.
Run the helper script when the requested conversion matches the default rules:
node /path/to/skills/mdx-to-markdown/scripts/convert_mdx_to_markdown.mjs input.mdx output.mdReview the result with
rgand a short diff. Confirm that no MDX-only syntax remains.Apply any user-requested follow-up edits, such as removing a generated table of contents or changing link policy.
Default conversion rules
Drop YAML frontmatter and top-level MDX imports.
Remove
<BlogAuthors />.Expand
<PackageManagerTabs command="add pkg -D" />to abashcode block usingpnpm add pkg -D.Convert centered HTML image blocks into Markdown image syntax.
Remove Rspress heading anchor suffixes while keeping the heading text.
Remove standalone
<a id="..."></a>anchor lines.Remove table-of-contents links that target in-page anchors, preserving the list text.
Convert code-fence titles or standalone bold filename captions into the first line of the code block as a comment, for example:
// hello.js export function greet(name) { return `Hello, ${name}!`; } console.log(greet('world'));Convert code blocks that contain markers such as
// [!code highlight]todiffcode blocks, remove the marker, and prefix highlighted lines with+.Prefix Markdown links whose target starts with
/using the current repository's site domain. Infer the product from the input file's Git repository, remote, package name, or path segment:rspack->rspack.rsrsbuild->rsbuild.rsrspress->rspress.rsrslib->rslib.rsrsdoctor->rsdoctor.rsrstest->rstest.rs
Add
/zhto the prefix when the MDX path contains azhpath segment. For example, a Chinese Rspack document converts/guide/optimization/tree-shakingtohttps://rspack.rs/zh/guide/optimization/tree-shaking.Use
--link-prefix <prefix>only when the inferred domain is wrong or the user explicitly requests a custom prefix.
Validation checklist
Run targeted checks after conversion:
rg -n '<BlogAuthors|PackageManagerTabs|title="|\\{#|^<a id="|\\]\(/|!code highlight|^\*\*[^*]+\*\*$' output.md
rg -n '^```' output.md | wc -l
The first command should return no matches unless the user intentionally kept that syntax. The fence count should be even.
Resources
scripts/convert_mdx_to_markdown.mjs: deterministic converter for the common Rspack/Rstack release-blog MDX pattern.
Установить mdx-to-markdown в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл mdx-to-markdown?
Convert `.mdx` to portable `.md`, cleaning MDX components, anchors, code titles, table-of-contents links, and root-relative docs links.
Как установить скилл mdx-to-markdown?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mdx-to-markdown запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic