Converts Markdown to styled HTML for social media, providing tools for syntax repair and format conversion via CLI or API.

Install

mkdir -p .claude/skills/bm-md && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7652" && unzip -o skill.zip -d .claude/skills/bm-md && rm skill.zip

Installs to .claude/skills/bm-md

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

使用 bm.md 服务进行 Markdown 排版、渲染和格式转换,支持微信公众号、知乎、掘金等多平台
51 charsno explicit “when” trigger
Beginner

Key capabilities

  • →Render Markdown to styled HTML
  • →Convert HTML to Markdown
  • →Extract plain text from Markdown
  • →Repair and format Markdown syntax

How it works

The tool uses a CLI or REST API to parse Markdown/HTML and apply selected themes or conversion logic before outputting the result.

Inputs & outputs

You give it
Markdown or HTML source text
You get back
Formatted HTML or Markdown string

When to use bm-md

  • →Render Markdown for WeChat article
  • →Convert HTML to Markdown
  • →Clean up Markdown formatting

About this skill

bm.md Markdown 排版技能

核心能力

使用 bm.md 完成以下任务:

  • Markdown 渲染:将 Markdown 转换为带样式的 HTML,支持 8 种排版风格、文本高亮与图片尺寸
  • HTML 转 Markdown:将 HTML 内容逆向转换为 Markdown 格式
  • 纯文本提取:从 Markdown 中提取纯文本,移除所有格式标记
  • 格式校验与修复:自动检测并修复 Markdown 格式问题

核心工作流

  1. 明确交付目标:确认受众、输出平台、事实边界与期望文件;信息不足时先询问,不猜测事实或数值。
  2. 先组织正文:先完成标题层级、段落、列表、表格、引用和代码,再考虑视觉增强。
  3. 按语义选择增强:只在增强理解时加入 Mermaid、Infographic、高亮或图片尺寸。遵循下方决策规则并按需读取对应参考。
  4. 执行渲染:优先使用 CLI;本地无法执行命令或用户明确要求远程调用时,改用 REST API。
  5. 检查并回退:检查命令状态、响应的 result、图表错误和关键信息完整性。增强语法失败时先修正;仍失败则回退为结构清晰的正文、列表或表格,不交付损坏的图表。

增强决策与按需参考

  • 流程、调用链、状态、类关系或 ER 模型:使用 Mermaid。
  • 并列、步骤、比较、层级、关系或真实数值:使用 AntV Infographic。字段与模板绑定,按参考中的已验证示例生成。
  • 局部关键结论:使用文本高亮,不要整段高亮。
  • 用户给定尺寸或布局确需固定尺寸:使用图片尺寸语法;不知道尺寸时保留普通图片。

保持克制:不要用图表装饰简单内容,不要用 Mermaid 和 Infographic 重复表达同一信息,不要虚构事实或数值。生成丰富 Markdown 后,必须通过 bm.md 渲染并检查结果。

执行优先级

  1. 优先使用 CLI:如果本地可执行 node --version,使用 bmmd 命令处理 Markdown。
  2. CLI 调用方式:如果系统已安装 bmmd,直接使用;否则使用 npx -y bmmd 临时运行。
  3. 兜底使用 REST API:如果没有 Node.js 环境、无法执行本地命令,或用户明确要求远程调用,再使用 https://bm.md/api/markdown/*。

CLI 默认将结果输出到 stdout,可通过 --output <file> 写入文件。REST API 返回 JSON,结果在 result 字段中。


可用工具

1. Markdown 渲染

将 Markdown 源文本渲染为带内联样式的 HTML,可直接复制到富文本编辑器。

CLI 示例(优先):

npx -y bmmd render article.md --platform wechat --output article.html

支持 stdin:

cat article.md | npx -y bmmd render --platform wechat > article.html

端点: POST https://bm.md/api/markdown/render

请求参数:

参数类型必填默认值说明
markdownstring是-Markdown 源文本,支持 GFM 语法、数学公式
markdownStylestring否kami排版样式 ID,见下方完整列表
codeThemestring否kimbie-light代码块高亮主题 ID,见下方完整列表
mermaidThemestring否""Mermaid 流程图主题 ID,空字符串表示使用默认主题
infographicThemestring否defaultInfographic 信息图主题 ID
infographicPalettestring否antvInfographic 信息图配色 ID
customCssstring否""自定义 CSS,选择器需约束在 #bm-md 下,如 #bm-md h1 { color: red }
enableFootnoteLinksboolean否true是否将链接转换为脚注形式
breaksboolean否false是否将段落内的软换行转换为 HTML 换行,不影响代码块
openLinksInNewWindowboolean否true是否在新窗口打开链接
platformstring否html目标平台:html、wechat
footnoteLabelstring否FootnotesGFM 脚注区域标题
referenceTitlestring否References外部链接参考区域标题

curl 示例:

curl -X POST https://bm.md/api/markdown/render \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "# 标题\n\n这是一段**加粗**的文字。\n\n```javascript\nconsole.log(\"Hello, World!\");\n```",
    "markdownStyle": "kami",
    "codeTheme": "kimbie-light",
    "platform": "wechat"
  }' \
  -o bm.md.json

响应示例:

{
  "result": "<div id=\"bm-md\"><h1 style=\"...\">标题</h1>...</div>"
}

2. HTML 转 Markdown

将 HTML 源代码转换为 Markdown 格式。

CLI 示例(优先):

npx -y bmmd parse page.html --output article.md

支持 stdin:

cat page.html | npx -y bmmd parse > article.md

端点: POST https://bm.md/api/markdown/parse

请求参数:

参数类型必填说明
htmlstring是HTML 源代码,可以是完整文档或片段

curl 示例:

curl -X POST https://bm.md/api/markdown/parse \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>标题</h1><p>这是一段<strong>加粗</strong>的文字。</p>"
  }' \
  -o bm.md.json

响应示例:

{
  "result": "# 标题\n\n这是一段**加粗**的文字。"
}

3. 提取纯文本

从 Markdown 中提取纯文本内容,移除所有格式标记,保留段落分隔。

CLI 示例(优先):

npx -y bmmd extract article.md --output article.txt

端点: POST https://bm.md/api/markdown/extract

请求参数:

参数类型必填说明
markdownstring是Markdown 源文本

curl 示例:

curl -X POST https://bm.md/api/markdown/extract \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "# 标题\n\n这是一段**加粗**的文字,包含[链接](https://example.com)。"
  }' \
  -o bm.md.json

响应示例:

{
  "result": "标题\n\n这是一段加粗的文字,包含链接。"
}

4. Markdown 格式化

校验并自动修复 Markdown 格式问题,统一代码风格。

CLI 示例(优先):

# 输出修复后的 Markdown
npx -y bmmd lint article.md --output article.fixed.md

# 直接写回源文件
npx -y bmmd lint article.md --fix

端点: POST https://bm.md/api/markdown/lint

请求参数:

参数类型必填说明
markdownstring是待校验的 Markdown 源文本

curl 示例:

curl -X POST https://bm.md/api/markdown/lint \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "#标题\n这是一段文字,没有正确的空格。\n-列表项1\n-列表项2"
  }' \
  -o bm.md.json

响应示例:

{
  "result": "# 标题\n\n这是一段文字,没有正确的空格。\n\n- 列表项1\n- 列表项2"
}

参数参考

排版样式 (markdownStyle)

ID名称风格描述
kamiKami简洁的纸张阅读风格(默认)
bauhausBauhaus包豪斯风格,几何与功能主义
blueprintBlueprint蓝图风格,工程设计感
botanicalBotanical植物园风格,自然柔和
newsprintNewsprint报纸印刷风格
retroRetro复古怀旧风格
sketchSketch手绘素描风格
terminalTerminal终端/命令行风格
forest-reviewForest Review森林季报风格,暖调编辑排版
navy-vellumNavy Vellum深蓝羊皮纸风格,静谧的学术手记
rose-nocturneRose Nocturne玫瑰夜曲风格,暗色调时尚编辑
solar-catalogSolar Catalog日光图录风格,展览海报质感
triad-paperTriad Paper三调纸面风格,三色时尚杂志感
field-tabletField Tablet田野铭牌风格,考古手册质感
public-squarePublic Square公共广场风格,行动主义海报
pixel-orbitPixel Orbit像素轨道风格,复古像素街机

代码主题 (codeTheme)

ID名称类型
catppuccin-latteCatppuccin Latte浅色
catppuccin-frappeCatppuccin Frappé深色
catppuccin-macchiatoCatppuccin Macchiato深色
catppuccin-mochaCatppuccin Mocha深色
kimbie-lightKimbie Light浅色
kimbie-darkKimbie Dark深色
panda-syntax-lightPanda Syntax Light浅色
panda-syntax-darkPanda Syntax Dark深色
paraiso-lightParaiso Light浅色
paraiso-darkParaiso Dark深色
rose-pine-dawnRosé Pine Dawn浅色
rose-pineRosé Pine深色
tokyo-night-lightTokyo Night Light浅色
tokyo-night-darkTokyo Night Dark深色

目标平台 (platform)

ID说明
html通用网页,标准 HTML 输出
wechat微信公众号,针对微信编辑器优化

注意事项

  1. 数学公式:支持 $...$(行内)和 $$...$$(块级)语法
  2. GFM 语法:完整支持 GitHub Flavored Markdown,包括表格、任务列表、删除线等
  3. 图片处理:图片 URL 需为可公开访问的地址
  4. 样式内联:输出的 HTML 已将 CSS 内联到元素上,可直接复制使用
  5. 编码要求:请求和响应均使用 UTF-8 编码

When not to use it

  • →Processing non-Markdown or non-HTML content
  • →Complex document layouts requiring CSS frameworks
  • →Large-scale batch processing without Node.js

Prerequisites

Node.js environment

Limitations

  • →Requires Node.js for CLI usage
  • →Images must be publicly accessible
  • →Custom CSS is scoped to #bm-md

How it compares

It automates the styling and conversion process for specific platforms like WeChat, replacing manual formatting in rich text editors.

Compared to similar skills

bm-md side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
bm-md (this skill)15moReviewBeginner
document-writer37moNo flagsBeginner
writing-docs12moReviewBeginner
hexo-publish-post02moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

document-writer

onmax

Use when writing blog posts or documentation markdown files - provides writing style guide (active voice, present tense), content structure patterns, and MDC component usage. Overrides brevity rules for proper grammar. Use nuxt-content for MDC syntax, nuxt-ui for component props.

325

writing-docs

remotion-dev

Guides for writing and editing Remotion documentation. Use when adding docs pages, editing MDX files in packages/docs, or writing documentation content.

12

hexo-publish-post

PeaFull

根据用户提供的文章标题和 Markdown 正文创建新的 Hexo 博客文章,并执行完整发布流程。用于用户希望在 Hexo 站点中发布或部署新文章,且需要执行相当于 `npx hexo new`、`npx hexo clean`、`npx hexo g` 和 `npx hexo d` 的流程。

00

update-docs

openvinotoolkit

Update OpenVINO GenAI site documentation for API or feature changes. Use when: new pipelines, models, or use-cases are introduced; site docs need to reflect new capabilities.

00

resume-builder

amruthpillai

Generate professional resumes that conform to the Reactive Resume schema. Use when the user wants to create, build, or generate a resume through conversational AI, or asks about resume structure, sections, or content. This skill guides the agent to ask clarifying questions, avoid hallucination, and produce valid JSON output for https://rxresu.me.

53229

word

Fergana-Labs

Create, read, edit, and manipulate Microsoft Word documents (.docx files). Use when users ask to work with Word files, create documents, read .docx files, or format text documents.

26172

Search skills

Search the agent skills registry