bm-md

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

bm.md Markdown 排版技能

bm.md Markdown Typesetting Skill

概述

Overview

bm.md 是一个专业的 Markdown 排版工具,提供以下核心能力:
  • Markdown 渲染:将 Markdown 转换为带样式的 HTML,支持 14 种排版风格
  • HTML 转 Markdown:将 HTML 内容逆向转换为 Markdown 格式
  • 纯文本提取:从 Markdown 中提取纯文本,移除所有格式标记
  • 格式校验与修复:自动检测并修复 Markdown 格式问题
所有 API 均返回 JSON 格式响应,结果在
result
字段中。

bm.md is a professional Markdown typesetting tool with the following core capabilities:
  • Markdown Rendering: Convert Markdown to styled HTML, supporting 14 typesetting styles
  • HTML to Markdown: Reverse convert HTML content to Markdown format
  • Plain Text Extraction: Extract plain text from Markdown, removing all format tags
  • Format Validation & Repair: Automatically detect and fix Markdown format issues
All APIs return responses in JSON format, with results in the
result
field.

可用工具

Available Tools

1. Markdown 渲染

1. Markdown Rendering

将 Markdown 源文本渲染为带内联样式的 HTML,可直接复制到富文本编辑器。
端点:
POST https://bm.md/api/markdown/render
请求参数:
参数类型必填默认值说明
markdown
string-Markdown 源文本,支持 GFM 语法、数学公式
markdownStyle
string
ayu-light
排版样式 ID,见下方完整列表
codeTheme
string
kimbie-light
代码块高亮主题 ID,见下方完整列表
customCss
string
""
自定义 CSS,选择器需约束在
#bm-md
下,如
#bm-md h1 { color: red }
enableFootnoteLinks
boolean
true
是否将链接转换为脚注形式
openLinksInNewWindow
boolean
true
是否在新窗口打开链接
platform
string
html
目标平台:
html
wechat
zhihu
juejin
footnoteLabel
string
Footnotes
GFM 脚注区域标题
referenceTitle
string
References
外部链接参考区域标题
curl 示例:
bash
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
响应示例:
json
{
  "result": "<div id=\"bm-md\"><h1 style=\"...\">标题</h1>...</div>"
}

Render Markdown source text into HTML with inline styles, which can be directly copied to rich text editors.
Endpoint:
POST https://bm.md/api/markdown/render
Request Parameters:
ParameterTypeRequiredDefault ValueDescription
markdown
stringYes-Markdown source text, supporting GFM syntax and mathematical formulas
markdownStyle
stringNo
ayu-light
Typesetting style ID, see the complete list below
codeTheme
stringNo
kimbie-light
Code block highlighting theme ID, see the complete list below
customCss
stringNo
""
Custom CSS, selectors must be constrained under
#bm-md
, e.g.,
#bm-md h1 { color: red }
enableFootnoteLinks
booleanNo
true
Whether to convert links to footnote form
openLinksInNewWindow
booleanNo
true
Whether to open links in a new window
platform
stringNo
html
Target platform:
html
,
wechat
,
zhihu
,
juejin
footnoteLabel
stringNo
Footnotes
GFM footnote section title
referenceTitle
stringNo
References
External link reference section title
curl Example:
bash
curl -X POST https://bm.md/api/markdown/render \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "# Title\n\nThis is a **bold** text.\n\n```javascript\nconsole.log(\"Hello, World!\");\n```",
    "markdownStyle": "ayu-light",
    "codeTheme": "kimbie-light",
    "platform": "wechat"
  }' \
  -o bm.md.json
Response Example:
json
{
  "result": "<div id=\"bm-md\"><h1 style=\"...\">Title</h1>...</div>"
}

2. HTML 转 Markdown

2. HTML to Markdown

将 HTML 源代码转换为 Markdown 格式。
端点:
POST https://bm.md/api/markdown/parse
请求参数:
参数类型必填说明
html
stringHTML 源代码,可以是完整文档或片段
curl 示例:
bash
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
响应示例:
json
{
  "result": "# 标题\n\n这是一段**加粗**的文字。"
}

Convert HTML source code to Markdown format.
Endpoint:
POST https://bm.md/api/markdown/parse
Request Parameters:
ParameterTypeRequiredDescription
html
stringYesHTML source code, which can be a complete document or fragment
curl Example:
bash
curl -X POST https://bm.md/api/markdown/parse \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Title</h1><p>This is a <strong>bold</strong> text.</p>"
  }' \
  -o bm.md.json
Response Example:
json
{
  "result": "# Title\n\nThis is a **bold** text."
}

3. 提取纯文本

3. Extract Plain Text

从 Markdown 中提取纯文本内容,移除所有格式标记,保留段落分隔。
端点:
POST https://bm.md/api/markdown/extract
请求参数:
参数类型必填说明
markdown
stringMarkdown 源文本
curl 示例:
bash
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
响应示例:
json
{
  "result": "标题\n\n这是一段加粗的文字,包含链接。"
}

Extract plain text content from Markdown, removing all format tags while preserving paragraph breaks.
Endpoint:
POST https://bm.md/api/markdown/extract
Request Parameters:
ParameterTypeRequiredDescription
markdown
stringYesMarkdown source text
curl Example:
bash
curl -X POST https://bm.md/api/markdown/extract \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "# Title\n\nThis is a **bold** text, containing a [link](https://example.com)."
  }' \
  -o bm.md.json
Response Example:
json
{
  "result": "Title\n\nThis is a bold text, containing a link."
}

4. Markdown 格式化

4. Markdown Formatting

校验并自动修复 Markdown 格式问题,统一代码风格。
端点:
POST https://bm.md/api/markdown/lint
请求参数:
参数类型必填说明
markdown
string待校验的 Markdown 源文本
curl 示例:
bash
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
响应示例:
json
{
  "result": "# 标题\n\n这是一段文字,没有正确的空格。\n\n- 列表项1\n- 列表项2"
}

Validate and automatically fix Markdown format issues to unify code style.
Endpoint:
POST https://bm.md/api/markdown/lint
Request Parameters:
ParameterTypeRequiredDescription
markdown
stringYesMarkdown source text to be validated
curl Example:
bash
curl -X POST https://bm.md/api/markdown/lint \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "#Title\nThis is a text,without proper spacing.\n-List item1\n-List item2"
  }' \
  -o bm.md.json
Response Example:
json
{
  "result": "# Title\n\nThis is a text, without proper spacing.\n\n- List item1\n- List item2"
}

参数参考

Parameter Reference

排版样式 (markdownStyle)

Typesetting Styles (markdownStyle)

ID名称风格描述
ayu-light
Ayu Light清新淡雅的浅色主题(默认)
bauhaus
Bauhaus包豪斯风格,几何与功能主义
blueprint
Blueprint蓝图风格,工程设计感
botanical
Botanical植物园风格,自然柔和
green-simple
GreenSimple绿色简约风格
maximalism
Maximalism极繁主义,丰富装饰
neo-brutalism
Neo-Brutalism新野兽派,大胆对比
newsprint
Newsprint报纸印刷风格
organic
Organic有机自然风格
playful-geometric
Playful Geometric活泼几何图形风格
professional
Professional专业商务风格
retro
Retro复古怀旧风格
sketch
Sketch手绘素描风格
terminal
Terminal终端/命令行风格
IDNameStyle Description
ayu-light
Ayu LightFresh and elegant light theme (default)
bauhaus
BauhausBauhaus style, geometric and functional
blueprint
BlueprintBlueprint style, engineering design sense
botanical
BotanicalBotanical garden style, natural and soft
green-simple
GreenSimpleGreen minimalist style
maximalism
MaximalismMaximalism, rich decoration
neo-brutalism
Neo-BrutalismNeo-brutalism, bold contrast
newsprint
NewsprintNewsprint style
organic
OrganicOrganic natural style
playful-geometric
Playful GeometricPlayful geometric style
professional
ProfessionalProfessional business style
retro
RetroRetro nostalgic style
sketch
SketchHand-drawn sketch style
terminal
TerminalTerminal/command line style

代码主题 (codeTheme)

Code Themes (codeTheme)

ID名称类型
catppuccin-latte
Catppuccin Latte浅色
catppuccin-frappe
Catppuccin Frappé深色
catppuccin-macchiato
Catppuccin Macchiato深色
catppuccin-mocha
Catppuccin Mocha深色
kimbie-light
Kimbie Light浅色
kimbie-dark
Kimbie Dark深色
panda-syntax-light
Panda Syntax Light浅色
panda-syntax-dark
Panda Syntax Dark深色
paraiso-light
Paraiso Light浅色
paraiso-dark
Paraiso Dark深色
rose-pine-dawn
Rosé Pine Dawn浅色
rose-pine
Rosé Pine深色
tokyo-night-light
Tokyo Night Light浅色
tokyo-night-dark
Tokyo Night Dark深色
IDNameType
catppuccin-latte
Catppuccin LatteLight
catppuccin-frappe
Catppuccin FrappéDark
catppuccin-macchiato
Catppuccin MacchiatoDark
catppuccin-mocha
Catppuccin MochaDark
kimbie-light
Kimbie LightLight
kimbie-dark
Kimbie DarkDark
panda-syntax-light
Panda Syntax LightLight
panda-syntax-dark
Panda Syntax DarkDark
paraiso-light
Paraiso LightLight
paraiso-dark
Paraiso DarkDark
rose-pine-dawn
Rosé Pine DawnLight
rose-pine
Rosé PineDark
tokyo-night-light
Tokyo Night LightLight
tokyo-night-dark
Tokyo Night DarkDark

目标平台 (platform)

Target Platforms (platform)

ID说明
html
通用网页,标准 HTML 输出
wechat
微信公众号,针对微信编辑器优化
zhihu
知乎专栏,适配知乎排版规范
juejin
掘金,适配掘金编辑器

IDDescription
html
General web pages, standard HTML output
wechat
WeChat Official Account, optimized for WeChat editor
zhihu
Zhihu Column, adapted to Zhihu typesetting specifications
juejin
Juejin, adapted to Juejin editor

使用场景

Usage Scenarios

  1. 内容创作者:将 Markdown 文章一键转换为微信公众号格式,直接粘贴发布
  2. 跨平台发布:同一份 Markdown 源文件,生成适配不同平台的 HTML
  3. 内容迁移:将网页内容转换为 Markdown 进行存档或编辑
  4. 文本分析:提取纯文本用于字数统计、关键词分析等

  1. Content Creators: One-click conversion of Markdown articles to WeChat Official Account format, directly copy and publish
  2. Cross-platform Publishing: Generate platform-adapted HTML from the same Markdown source file
  3. Content Migration: Convert web content to Markdown for archiving or editing
  4. Text Analysis: Extract plain text for word count, keyword analysis, etc.

注意事项

Notes

  1. 数学公式:支持
    $...$
    (行内)和
    $$...$$
    (块级)语法
  2. GFM 语法:完整支持 GitHub Flavored Markdown,包括表格、任务列表、删除线等
  3. 图片处理:图片 URL 需为可公开访问的地址
  4. 样式内联:输出的 HTML 已将 CSS 内联到元素上,可直接复制使用
  5. 编码要求:请求和响应均使用 UTF-8 编码
  1. Mathematical Formulas: Supports
    $...$
    (inline) and
    $$...$$
    (block-level) syntax
  2. GFM Syntax: Fully supports GitHub Flavored Markdown, including tables, task lists, strikethrough, etc.
  3. Image Handling: Image URLs must be publicly accessible
  4. Style Inlining: The output HTML has CSS inlined into elements, which can be directly copied and used
  5. Encoding Requirements: Both requests and responses use UTF-8 encoding