nonebot-plugin-htmlrender 0.6.6__tar.gz → 0.6.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/PKG-INFO +1 -1
  2. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/browser.py +3 -0
  3. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/config.py +4 -0
  4. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/data_source.py +3 -2
  5. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/pyproject.toml +1 -1
  6. nonebot_plugin_htmlrender-0.6.7/uv.lock +1926 -0
  7. nonebot_plugin_htmlrender-0.6.6/uv.lock +0 -1828
  8. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.dockerignore +0 -0
  9. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.github/workflows/codecov.yml +0 -0
  10. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.github/workflows/docker_image.yml +0 -0
  11. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.github/workflows/publish.yml +0 -0
  12. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.gitignore +0 -0
  13. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.pre-commit-config.yaml +0 -0
  14. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/.python-version +0 -0
  15. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/LICENSE +0 -0
  16. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/README.md +0 -0
  17. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docker-compose.yaml +0 -0
  18. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/dockerfile +0 -0
  19. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/example.md +0 -0
  20. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/html2pic.png +0 -0
  21. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/md2pic.png +0 -0
  22. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/template2pic.png +0 -0
  23. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/docs/text2pic.png +0 -0
  24. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/entrypoint.sh +0 -0
  25. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/docker-compose.yaml +0 -0
  26. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/entrypoint.sh +0 -0
  27. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/__init__.py +0 -0
  28. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/html2pic.html +0 -0
  29. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/templates/markdown.css +0 -0
  30. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/templates/mystyle.css +0 -0
  31. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/templates/progress.html.jinja2 +0 -0
  32. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/templates/text.html +0 -0
  33. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/plugins/render/utils.py +0 -0
  34. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/example/pyproject.toml +0 -0
  35. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/__init__.py +0 -0
  36. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/consts.py +0 -0
  37. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/install.py +0 -0
  38. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/process.py +0 -0
  39. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/signal.py +0 -0
  40. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/github-markdown-light.css +0 -0
  41. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/katex/katex.min.b64_fonts.css +0 -0
  42. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/katex/katex.min.js +0 -0
  43. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/katex/mathtex-script-type.min.js +0 -0
  44. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/katex/mhchem.min.js +0 -0
  45. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/markdown.html +0 -0
  46. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/pygments-default.css +0 -0
  47. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/text.css +0 -0
  48. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/templates/text.html +0 -0
  49. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/nonebot_plugin_htmlrender/utils.py +0 -0
  50. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/__init__.py +0 -0
  51. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/conftest.py +0 -0
  52. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/resources/test_template_filter.png +0 -0
  53. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/templates/markdown.css +0 -0
  54. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/templates/mystyle.css +0 -0
  55. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/templates/progress.html.jinja2 +0 -0
  56. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/templates/text.html +0 -0
  57. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_browser.py +0 -0
  58. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_deprecated_decorator.py +0 -0
  59. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_htmlrender.py +0 -0
  60. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_install.py +0 -0
  61. {nonebot_plugin_htmlrender-0.6.6 → nonebot_plugin_htmlrender-0.6.7}/tests/test_process.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nonebot-plugin-htmlrender
3
- Version: 0.6.6
3
+ Version: 0.6.7
4
4
  Summary: 通过浏览器渲染图片
5
5
  Project-URL: Homepage, https://github.com/kexue-z/nonebot-plugin-htmlrender
6
6
  Project-URL: Bug Tracker, https://github.com/kexue-z/nonebot-plugin-htmlrender/issues
@@ -169,6 +169,9 @@ async def start_browser(**kwargs) -> Browser:
169
169
  if plugin_config.htmlrender_proxy_host:
170
170
  kwargs["proxy"] = proxy_settings(plugin_config.htmlrender_proxy_host)
171
171
 
172
+ if plugin_config.htmlrender_browser_args:
173
+ kwargs["args"] = plugin_config.htmlrender_browser_args.split()
174
+
172
175
  if plugin_config.htmlrender_browser_executable_path:
173
176
  kwargs["executable_path"] = plugin_config.htmlrender_browser_executable_path
174
177
  else:
@@ -39,6 +39,10 @@ class Config(BaseModel):
39
39
  default=None, description="通过Playwright协议连接Playwright浏览器的端点地址。"
40
40
  )
41
41
 
42
+ htmlrender_browser_args: Optional[str] = Field(
43
+ default=None, description="Playwright 浏览器启动参数。"
44
+ )
45
+
42
46
  @model_validator(mode="after")
43
47
  @classmethod
44
48
  def check_browser_channel(cls, data: Any) -> Any:
@@ -141,7 +141,7 @@ async def md_to_pic(
141
141
 
142
142
 
143
143
  async def read_file(path: str) -> str:
144
- async with aiofiles.open(path) as f:
144
+ async with aiofiles.open(path, encoding="UTF8") as f:
145
145
  return await f.read()
146
146
 
147
147
 
@@ -189,6 +189,7 @@ async def html_to_pic(
189
189
  quality: Union[int, None] = None,
190
190
  device_scale_factor: float = 2,
191
191
  screenshot_timeout: Optional[float] = 30_000,
192
+ full_page: Optional[bool] = True,
192
193
  **kwargs,
193
194
  ) -> bytes:
194
195
  """html转图片
@@ -215,7 +216,7 @@ async def html_to_pic(
215
216
  await page.set_content(html, wait_until="networkidle")
216
217
  await page.wait_for_timeout(wait)
217
218
  return await page.screenshot(
218
- full_page=True,
219
+ full_page=full_page,
219
220
  type=type,
220
221
  quality=quality,
221
222
  timeout=screenshot_timeout,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nonebot-plugin-htmlrender"
3
- version = "0.6.6"
3
+ version = "0.6.7"
4
4
  description = "通过浏览器渲染图片"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "kexue", email = "x@kexue-cloud.cn" }]