- 统一渲染 API:
render_text/render_markdown/render_html/render_template - 支持本地与远程渲染(Remote Playwright WS / Remote Browser CDP)
- 支持模板变量资源解析(含 filehost 方案)
- 支持渲染链路遥测(可选接入 sentry / prometheus)
uv add nonebot-plugin-htmlrenderuv add "nonebot-plugin-htmlrender[filehost]"
uv add "nonebot-plugin-htmlrender[sentry]"
uv add "nonebot-plugin-htmlrender[prometheus]"
uv add "nonebot-plugin-htmlrender[filehost,sentry,prometheus]"from nonebot import require
require("nonebot_plugin_htmlrender")
from nonebot_plugin_htmlrender import render_markdown, render_template, render_text
async def demo() -> None:
img_text = await render_text("Hello, HTMLRender")
img_md = await render_markdown("# Title\n\n**Hello**")
img_tpl = await render_template(
"templates",
template_name="card.html",
templates={"name": "nonebot"},
)更多使用方式请参考 API 文档。
make prepare
make check
make test-ci
make test-local
make install-browser
make ruff-format
make ruff-check
make typecheck
make ty
make build-artifacts远程联调 smoke test:
make remote-smoke首次构建镜像、基础镜像变更或 pyproject.toml / uv.lock 变更后,再使用:
make remote-smoke-build开发容器(代码挂载 + 远程 Playwright):
docker compose -f docker-compose.dev.yaml up --build -d
docker compose -f docker-compose.dev.yaml exec dev shPython 3.10 or higher.
Windows 11+, Windows Server 2019+ or Windows Subsystem for Linux (WSL).
macOS 14 Ventura, or later.
Debian 12, Debian 13, Ubuntu 22.04, Ubuntu 24.04, on x86-64 and arm64 architecture.
- nonebot(提供框架能力支持)
- MeetWq(数学公式与代码高亮相关支持)
- zhenxun-org/zhenxun_bot 与 MountainDash/nonebot-bison(感谢庞大用户群体提供的长期反馈)
- nonebot-plugin-filehost、nonebot-plugin-sentry、nonebot-plugin-prometheus(提供 filehost / sentry / prometheus 能力载入支持)
- nonebot/plugin-htmlkit(提供测试思路参考)