WP Manifestindependent plugin directory
manifest / content / md-html-sync

Markdown HTML Sync

轻量 WordPress 插件:以 Markdown 作为文章源内容,自动同步生成 HTML,并支持 REST API、Front Matter 与图片导入。

by Codex · github.com/maomomo-eth/md-html-sync

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/maomomo-eth/md-html-sync/archive/refs/heads/main.zip

From the readme

Markdown HTML Sync Markdown HTML Sync 是一个轻量 WordPress 插件,用来把 Markdown 作为文章源内容保存,并自动生成 WordPress 正文 HTML。 适合两类场景: - 在 WordPress 后台直接用 Markdown 编辑文章。 - 通过 REST API 导入 Markdown、图片和 front matter,自动创建或更新文章。 功能概览 - 在文章、页面等支持编辑器的内容类型中增加「Markdown 同步」编辑框。 - 勾选「启用 Markdown 同步」后,保存文章会用 Markdown 重新生成 postcontent。 - Markdown 源内容保存在文章 meta:mdhtmlsyncmarkdown。 - 同步开关保存在文章 meta:mdhtmlsyncenabled。 - 支持 Markdown front matter 同步标题、slug、摘要、发布时间、状态、分类、标签、特色图。 - 提供 REST 导入接口:POST /wp-json/md-html-sync/v1/import。 - 支持上传 Markdown 文件、ZIP 发布包、正文图片和特色图。 - 如果同时启用了 MaoMoMo TinyPNG Media,TinyPNG 后台生成 WebP 后会自动回写文章中的图片 URL。 安装 1. 将 md-html-sync 目录放到 WordPress 的 wp-content/plugins/ 目录。 2. 进入 WordPress 后台「插件」页面,启用 Markdown HTML Sync。 3. 编辑文章或页面,在「Markdown 同步」区域勾选「启用 Markdown 同步」。 4. 在文本框中编写 Markdown,保存文章即可生成 HTML 正文。 插件会自动作用于所有满足以下条件的内容类型: - showui 为 true。 - 支持 WordPress 编辑器。 - 不是 attachment。 后台编辑用法 进入文章编辑页后: 1. 找到「Markdown 同步」编辑框。 2. 勾选「启用 Markdown 同步」。 3. 输入 Markdown。 4. 保存文章。 保存后插件会: - 把 Markdown 保存到 mdhtmlsyncmarkdown。 - 把同步开关保存到 mdhtmlsyncenabled。 - 将 Markdown 渲染为 HTML,并写入文章正文 postcontent。 - 如果 Markdown 顶部有 front matter,会同步对应文章字段。 注意:启用同步后,文章正文以 Markdown 渲染结果为准。直接修改正文编辑器里的 HTML 后,下次保存会被 Markdow

Read the full README on GitHub →