Skip to main content
nonebot-plugin-htmlrender

nonebot-plugin-htmlrender

NoneBot2 浏览器渲染库插件(Library Plugin)

PyPI Python License Docs

特性

  • 统一渲染 API:render_text / render_markdown / render_html / render_template
  • 支持本地与远程渲染(Remote Playwright WS / Remote Browser CDP)
  • 支持模板变量资源解析(含 filehost 方案)
  • 支持渲染链路遥测(可选接入 sentry / prometheus)

快速导航

安装

基础安装

uv add nonebot-plugin-htmlrender

可选能力

uv 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 sh

FAQ

系统要求

require by playwright

Python 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.

致谢

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_htmlrender-0.7.2.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_htmlrender-0.7.2-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_htmlrender-0.7.2.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_htmlrender-0.7.2.tar.gz
Algorithm Hash digest
SHA256 ad85bc734f25cd91582b3ff1315031aed61a8c16d53ab5e0013140262e4a8820
MD5 79ebd991d77fb935f4389b5ff593443d
BLAKE2b-256 14c8460fc35084839a2d0abb58b8600015889c520725564b053e5c2970d9fadc

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_htmlrender-0.7.2.tar.gz:

Publisher: publish.yml on kexue-z/nonebot-plugin-htmlrender

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_htmlrender-0.7.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_htmlrender-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 353479bec15e235244ed47e7a74f997140d719ac70c7ad401def3edcb3b42dfc
MD5 bec69b9f7e8ab237b51fc39b6de049f2
BLAKE2b-256 a11415b9483afc5b9a6a1de51f0ebd35f4d49cc04d84ac36086c42713acb01c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_htmlrender-0.7.2-py3-none-any.whl:

Publisher: publish.yml on kexue-z/nonebot-plugin-htmlrender

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.8.1

2 files

This release

0.7.2 This release

2 files

0.7.1

2 files

0.7.0

2 files

0.6.8

2 files

0.6.7

2 files

0.6.6

2 files

0.6.5

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.5

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0.3

2 files

0.2.0.2

2 files

0.2.0.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.5

2 files

0.0.4.8

2 files

0.0.4.6

2 files

0.0.4.5

2 files

0.0.4.4

2 files

0.0.4.3

2 files

0.0.4.2

2 files

0.0.4.1

2 files

0.0.4

2 files

0.0.3.1

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page