Skip to content

Commit

Permalink
🔖 v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kexue-z committed Jun 1, 2024
1 parent 567cf86 commit 9d9ba5f
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 58 deletions.
2 changes: 1 addition & 1 deletion nonebot_plugin_htmlrender/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@Description : None
@GitHub : https://github.com/yanyongyu
"""

__author__ = "yanyongyu"

from contextlib import asynccontextmanager
Expand All @@ -18,7 +19,6 @@
from playwright.async_api import Browser, Error, Page, Playwright, async_playwright

from .config import Config
import asyncio

config = get_plugin_config(Config)

Expand Down
10 changes: 5 additions & 5 deletions nonebot_plugin_htmlrender/data_source.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os import getcwd
from pathlib import Path
from typing import Literal, Optional, Union
from typing import Any, Dict, Literal, Optional, Union

import aiofiles
import jinja2
Expand Down Expand Up @@ -206,8 +206,8 @@ async def html_to_pic(
async def template_to_pic(
template_path: str,
template_name: str,
templates: dict,
pages: Optional[dict] = None,
templates: Dict[Any, Any],
pages: Optional[Dict[Any, Any]] = None,
wait: int = 0,
type: Literal["jpeg", "png"] = "png", # noqa: A002
quality: Union[int, None] = None,
Expand All @@ -218,8 +218,8 @@ async def template_to_pic(
Args:
template_path (str): 模板路径
template_name (str): 模板名
templates (dict): 模板内参数 如: {"name": "abc"}
pages (dict): 网页参数 Defaults to
templates (Dict[Any, Any]): 模板内参数 如: {"name": "abc"}
pages (Optional[Dict[Any, Any]]): 网页参数 Defaults to
{"base_url": f"file://{getcwd()}", "viewport": {"width": 500, "height": 10}}
wait (int, optional): 网页载入等待时间. Defaults to 0.
type (Literal["jpeg", "png"]): 图片类型, 默认 png
Expand Down
96 changes: 46 additions & 50 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "nonebot-plugin-htmlrender"
version = "0.3.1"
version = "0.3.2"
description = "通过浏览器渲染图片"
authors = [{ name = "kexue", email = "xana278@foxmail.com" }]
dependencies = [
Expand All @@ -13,7 +13,7 @@ dependencies = [
"pymdown-extensions>=9.1",
"aiofiles>=0.8.0",
]
requires-python = ">=3.8,<4.0"
requires-python = ">=3.9,<4.0"
readme = "README.md"
license = { file = "LICENSE" }

Expand Down

0 comments on commit 9d9ba5f

Please sign in to comment.