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 渲染:将 Markdown 转换为带样式的 HTML,支持 14 种排版风格
  • HTML 转 Markdown:将 HTML 内容逆向转换为 Markdown 格式
  • 纯文本提取:从 Markdown 中提取纯文本,移除所有格式标记
  • 格式校验与修复:自动检测并修复 Markdown 格式问题

优先使用本地 CLI,只有在无 Node.js 环境或无法执行命令时才使用 REST API。

执行优先级

  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 语法、数学公式
markdownStylestringayu-light排版样式 ID,见下方完整列表
codeThemestringkimbie-light代码块高亮主题 ID,见下方完整列表
mermaidThemestring""Mermaid 流程图主题 ID,空字符串表示使用默认主题
infographicThemestringdefaultInfographic 信息图主题 ID
infographicPalettestringantvInfographic 信息图配色 ID
customCssstring""自定义 CSS,选择器需约束在 #bm-md 下,如 #bm-md h1 { color: red }
enableFootnoteLinksbooleantrue是否将链接转换为脚注形式
openLinksInNewWindowbooleantrue是否在新窗口打开链接
platformstringhtml目标平台:htmlwechat
footnoteLabelstringFootnotesGFM 脚注区域标题
referenceTitlestringReferences外部链接参考区域标题

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": "ayu-light",
    "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

请求参数:

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

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

请求参数:

参数类型必填说明
markdownstringMarkdown 源文本

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名称风格描述
ayu-lightAyu Light清新淡雅的浅色主题(默认)
bauhausBauhaus包豪斯风格,几何与功能主义
blueprintBlueprint蓝图风格,工程设计感
botanicalBotanical植物园风格,自然柔和
green-simpleGreenSimple绿色简约风格
maximalismMaximalism极繁主义,丰富装饰
neo-brutalismNeo-Brutalism新野兽派,大胆对比
newsprintNewsprint报纸印刷风格
organicOrganic有机自然风格
playful-geometricPlayful Geometric活泼几何图形风格
professionalProfessional专业商务风格
retroRetro复古怀旧风格
sketchSketch手绘素描风格
terminalTerminal终端/命令行风格

代码主题 (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. 内容创作者:将 Markdown 文章一键转换为微信公众号格式,直接粘贴发布
  2. 多端发布:同一份 Markdown 源文件,生成适配不同输出场景的 HTML
  3. 内容迁移:将网页内容转换为 Markdown 进行存档或编辑
  4. 文本分析:提取纯文本用于字数统计、关键词分析等

注意事项

  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)13moReviewBeginner
document-writer35moNo flagsBeginner
writing-docs128dReviewBeginner
hexo-publish-post028dReviewBeginner

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