yzr-md-to-html

Installation
SKILL.md

输入与输出

  • 输入:一个 .md 文件,或一个目录(批量转目录下 *.md)
  • 输出:同名 .html,单文件自包含、双击即开;目录输入就地逐篇生成
  • 参数:以 python3 tools/md_to_html.py --help 为单一来源(argparse 定义,此处不重抄); 脚本按自身路径定位资产,任意 cwd 可调用
  • 前置:Python ≥ 3.7,无需 pandoc;依赖清单以脚本 DEPENDENCIES 常量为准,缺依赖时 脚本打印 pip 安装命令;文档含 Mermaid 时另需 Node + beautiful-mermaid(版本 SSOT 在 tools/mermaid_to_ascii.mjs 常量,缺时打印 npm 安装命令);不含 Mermaid 的文档不需要 Node
  • 模板变量(--template 传入的 Jinja2 模板里用,不在 --help 范围内):content 正文、 toc 目录、styles 主题 CSS、pygments_css 高亮 CSS、title、lang,及布尔开关 has_math / has_mermaid / has_toc(控制挂对应 CDN 与侧边栏)

执行原则

Installs
33
First Seen
Aug 1, 2026