接口 URL: /api/v1/convert/markdown-to-wexin-html
请求方式: POST
请求格式: multipart/form-data 或 application/x-www-form-urlencoded
返回格式: application/json
| 参数名 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
markdown_content | String | 是(或传 file) | 原始 Markdown 文本内容。如果同时传 file,以 file 为准。 |
file | File | 是(或传 markdown_content) | 上传包含 Markdown 内容的文件(通常后缀为 .md 或 .txt)。 |
theme_style | String | 否 | 主题风格。支持:classic(经典,默认)、elegant(优雅)、simple(简洁)。 |
theme_color | String | 否 | 排版的主题色。支持:经典蓝(默认)、翡翠绿、活力橘、柠檬黄、薰衣紫、天空蓝、玫瑰金、橄榄绿、石墨黑、雾烟灰、樱花粉。 |
{
"code": 0,
"message": "ok",
"data": {
"html_content": "<div class=\"rich_media_content\"...>...</div>"
}
}
示例一:直接传递 Markdown 文本
curl -X POST https://cuobiezi.net/api/v1/convert/markdown-to-wexin-html \
-d "markdown_content=# 欢迎使用\n这是一段测试引言" \
-d "theme_style=elegant" \
-d "theme_color=樱花粉"
示例二:上传本地 Markdown 文件
curl -X POST https://cuobiezi.net/api/v1/convert/markdown-to-wexin-html \
-F "file=@/path/to/your/article.md" \
-F "theme_style=classic" \
-F "theme_color=经典蓝"