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.4.tar.gz (1.0 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.0.4.4-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file nonebot-plugin-htmlrender-0.0.4.4.tar.gz.

File metadata

  • Download URL: nonebot-plugin-htmlrender-0.0.4.4.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.10 Darwin/21.3.0

File hashes

Hashes for nonebot-plugin-htmlrender-0.0.4.4.tar.gz
Algorithm Hash digest
SHA256 da278a9a0dfb6b268083c3223e385d153d34c933cbf21e3c4948724d5c28d8ff
MD5 e0ff48b5989e674f15d162fb36567f55
BLAKE2b-256 bf0d93cb6f3c24055b9a91b513a14711a9bf709abe53849c5393cfb78ccd87cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_htmlrender-0.0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e3dbb2bb7afd529b3958aedefab42570a28e924ef7417f0e57c734037def37a4
MD5 171c8eb3ce67b0e52c0220fbf36696ee
BLAKE2b-256 368ccc2265758abcabc639ea36bfbcf5df27bdb688b3bad558685f7b6b7fbc42

See more details on using hashes here.

Supported by

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