bm-md
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebm.md Markdown 排版技能
bm.md Markdown Typesetting Skill
概述
Overview
bm.md 是一个专业的 Markdown 排版工具,提供以下核心能力:
- Markdown 渲染:将 Markdown 转换为带样式的 HTML,支持 14 种排版风格
- HTML 转 Markdown:将 HTML 内容逆向转换为 Markdown 格式
- 纯文本提取:从 Markdown 中提取纯文本,移除所有格式标记
- 格式校验与修复:自动检测并修复 Markdown 格式问题
所有 API 均返回 JSON 格式响应,结果在 字段中。
resultbm.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 field.
result可用工具
Available Tools
1. Markdown 渲染
1. Markdown Rendering
将 Markdown 源文本渲染为带内联样式的 HTML,可直接复制到富文本编辑器。
端点:
POST https://bm.md/api/markdown/render请求参数:
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| string | 是 | - | Markdown 源文本,支持 GFM 语法、数学公式 |
| string | 否 | | 排版样式 ID,见下方完整列表 |
| string | 否 | | 代码块高亮主题 ID,见下方完整列表 |
| string | 否 | | 自定义 CSS,选择器需约束在 |
| boolean | 否 | | 是否将链接转换为脚注形式 |
| boolean | 否 | | 是否在新窗口打开链接 |
| string | 否 | | 目标平台: |
| string | 否 | | GFM 脚注区域标题 |
| string | 否 | | 外部链接参考区域标题 |
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/renderRequest Parameters:
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| string | Yes | - | Markdown source text, supporting GFM syntax and mathematical formulas |
| string | No | | Typesetting style ID, see the complete list below |
| string | No | | Code block highlighting theme ID, see the complete list below |
| string | No | | Custom CSS, selectors must be constrained under |
| boolean | No | | Whether to convert links to footnote form |
| boolean | No | | Whether to open links in a new window |
| string | No | | Target platform: |
| string | No | | GFM footnote section title |
| string | No | | 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.jsonResponse 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请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| string | 是 | HTML 源代码,可以是完整文档或片段 |
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/parseRequest Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | HTML 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.jsonResponse Example:
json
{
"result": "# Title\n\nThis is a **bold** text."
}3. 提取纯文本
3. Extract Plain Text
从 Markdown 中提取纯文本内容,移除所有格式标记,保留段落分隔。
端点:
POST https://bm.md/api/markdown/extract请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| string | 是 | Markdown 源文本 |
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/extractRequest Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Markdown 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.jsonResponse 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请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 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/lintRequest Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Markdown 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.jsonResponse 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 | 清新淡雅的浅色主题(默认) |
| Bauhaus | 包豪斯风格,几何与功能主义 |
| Blueprint | 蓝图风格,工程设计感 |
| Botanical | 植物园风格,自然柔和 |
| GreenSimple | 绿色简约风格 |
| Maximalism | 极繁主义,丰富装饰 |
| Neo-Brutalism | 新野兽派,大胆对比 |
| Newsprint | 报纸印刷风格 |
| Organic | 有机自然风格 |
| Playful Geometric | 活泼几何图形风格 |
| Professional | 专业商务风格 |
| Retro | 复古怀旧风格 |
| Sketch | 手绘素描风格 |
| Terminal | 终端/命令行风格 |
| ID | Name | Style Description |
|---|---|---|
| Ayu Light | Fresh and elegant light theme (default) |
| Bauhaus | Bauhaus style, geometric and functional |
| Blueprint | Blueprint style, engineering design sense |
| Botanical | Botanical garden style, natural and soft |
| GreenSimple | Green minimalist style |
| Maximalism | Maximalism, rich decoration |
| Neo-Brutalism | Neo-brutalism, bold contrast |
| Newsprint | Newsprint style |
| Organic | Organic natural style |
| Playful Geometric | Playful geometric style |
| Professional | Professional business style |
| Retro | Retro nostalgic style |
| Sketch | Hand-drawn sketch style |
| Terminal | Terminal/command line style |
代码主题 (codeTheme)
Code Themes (codeTheme)
| ID | 名称 | 类型 |
|---|---|---|
| Catppuccin Latte | 浅色 |
| Catppuccin Frappé | 深色 |
| Catppuccin Macchiato | 深色 |
| Catppuccin Mocha | 深色 |
| Kimbie Light | 浅色 |
| Kimbie Dark | 深色 |
| Panda Syntax Light | 浅色 |
| Panda Syntax Dark | 深色 |
| Paraiso Light | 浅色 |
| Paraiso Dark | 深色 |
| Rosé Pine Dawn | 浅色 |
| Rosé Pine | 深色 |
| Tokyo Night Light | 浅色 |
| Tokyo Night Dark | 深色 |
| ID | Name | Type |
|---|---|---|
| Catppuccin Latte | Light |
| Catppuccin Frappé | Dark |
| Catppuccin Macchiato | Dark |
| Catppuccin Mocha | Dark |
| Kimbie Light | Light |
| Kimbie Dark | Dark |
| Panda Syntax Light | Light |
| Panda Syntax Dark | Dark |
| Paraiso Light | Light |
| Paraiso Dark | Dark |
| Rosé Pine Dawn | Light |
| Rosé Pine | Dark |
| Tokyo Night Light | Light |
| Tokyo Night Dark | Dark |
目标平台 (platform)
Target Platforms (platform)
| ID | 说明 |
|---|---|
| 通用网页,标准 HTML 输出 |
| 微信公众号,针对微信编辑器优化 |
| 知乎专栏,适配知乎排版规范 |
| 掘金,适配掘金编辑器 |
| ID | Description |
|---|---|
| General web pages, standard HTML output |
| WeChat Official Account, optimized for WeChat editor |
| Zhihu Column, adapted to Zhihu typesetting specifications |
| Juejin, adapted to Juejin editor |
使用场景
Usage Scenarios
- 内容创作者:将 Markdown 文章一键转换为微信公众号格式,直接粘贴发布
- 跨平台发布:同一份 Markdown 源文件,生成适配不同平台的 HTML
- 内容迁移:将网页内容转换为 Markdown 进行存档或编辑
- 文本分析:提取纯文本用于字数统计、关键词分析等
- Content Creators: One-click conversion of Markdown articles to WeChat Official Account format, directly copy and publish
- Cross-platform Publishing: Generate platform-adapted HTML from the same Markdown source file
- Content Migration: Convert web content to Markdown for archiving or editing
- Text Analysis: Extract plain text for word count, keyword analysis, etc.
注意事项
Notes
- 数学公式:支持 (行内)和
$...$(块级)语法$$...$$ - GFM 语法:完整支持 GitHub Flavored Markdown,包括表格、任务列表、删除线等
- 图片处理:图片 URL 需为可公开访问的地址
- 样式内联:输出的 HTML 已将 CSS 内联到元素上,可直接复制使用
- 编码要求:请求和响应均使用 UTF-8 编码
- Mathematical Formulas: Supports (inline) and
$...$(block-level) syntax$$...$$ - GFM Syntax: Fully supports GitHub Flavored Markdown, including tables, task lists, strikethrough, etc.
- Image Handling: Image URLs must be publicly accessible
- Style Inlining: The output HTML has CSS inlined into elements, which can be directly copied and used
- Encoding Requirements: Both requests and responses use UTF-8 encoding