Skip to main content

通过浏览器渲染图片

Project description

nonebot-plugin-htmlrender

  • 通过浏览器渲染图片
  • 可通过查看example参考使用实例

✨ 功能

  • 通过html和浏览器生成图片
  • 支持纯文本 markdownjinja2 模板输入
  • 通过 CSS 来控制样式

使用

参考example/plugins/render/init.py

markdown 转 图片

  • 使用 GitHub-light 样式
  • 支持绝大部分 md 语法
  • 代码高亮
  • latex 数学公式 (感谢@MeetWq
    • 使用 $$...$$ 来输入独立公式
    • 使用 $...$ 来输入行内公式
  • 图片需要使用外部连接并使用html格式 否则文末会超出截图范围
  • 图片可使用md语法 路径可为 绝对路径(建议), 或 相对于template_path 的路径

模板 转 图片

  • 使用jinja2模板引擎
  • 页面参数可自定义

🌰 栗子

example.md

文本转图片(同时文本里面可以包括html图片)

markdown转图片(同时文本里面可以包括html图片)

纯html转图片

jinja2模板转图片

特别感谢

  • MeetWq 提供数学公式支持代码和代码高亮

Project details


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.0.4.2.tar.gz (1.0 MB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page