nonebot-plugin-latex 0.0.2__py3-none-any.whl → 0.0.2.1__py3-none-any.whl
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.
- nonebot_plugin_latex/__init__.py +1 -1
- nonebot_plugin_latex/main.py +5 -5
- {nonebot_plugin_latex-0.0.2.dist-info → nonebot_plugin_latex-0.0.2.1.dist-info}/METADATA +7 -4
- nonebot_plugin_latex-0.0.2.1.dist-info/RECORD +10 -0
- nonebot_plugin_latex-0.0.2.dist-info/RECORD +0 -10
- {nonebot_plugin_latex-0.0.2.dist-info → nonebot_plugin_latex-0.0.2.1.dist-info}/LICENSE +0 -0
- {nonebot_plugin_latex-0.0.2.dist-info → nonebot_plugin_latex-0.0.2.1.dist-info}/WHEEL +0 -0
- {nonebot_plugin_latex-0.0.2.dist-info → nonebot_plugin_latex-0.0.2.1.dist-info}/top_level.txt +0 -0
nonebot_plugin_latex/__init__.py
CHANGED
nonebot_plugin_latex/main.py
CHANGED
@@ -51,10 +51,10 @@ async def check_for_scan(
|
|
51
51
|
# state: T_State,
|
52
52
|
) -> bool:
|
53
53
|
"""
|
54
|
-
|
54
|
+
检查是否为 LaTeX 指令
|
55
55
|
"""
|
56
56
|
|
57
|
-
# print("
|
57
|
+
# print("检查消息满足渲染要求:", event)
|
58
58
|
if isinstance(event, MessageEvent):
|
59
59
|
# print("此为原始信息:", event.raw_message)
|
60
60
|
# event.message
|
@@ -71,14 +71,14 @@ async def check_for_scan(
|
|
71
71
|
return False
|
72
72
|
|
73
73
|
|
74
|
-
|
74
|
+
latexg = nonebot.on_message(
|
75
75
|
rule=check_for_scan,
|
76
76
|
block=False,
|
77
77
|
priority=90,
|
78
78
|
)
|
79
79
|
|
80
80
|
|
81
|
-
@
|
81
|
+
@latexg.handle()
|
82
82
|
async def handle_pic(
|
83
83
|
event: MessageEvent,
|
84
84
|
# state: T_State,
|
@@ -94,7 +94,7 @@ async def handle_pic(
|
|
94
94
|
latexes.extend(LATEX_PATTERN.finditer(event.message.extract_plain_text()))
|
95
95
|
|
96
96
|
if not latexes:
|
97
|
-
await
|
97
|
+
await latexg.finish(
|
98
98
|
"同志!以我们目前的实力,暂时无法读取你大脑中的公式,你还是把它通过你的输入设备打出来吧。"
|
99
99
|
)
|
100
100
|
return
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nonebot-plugin-latex
|
3
|
-
Version: 0.0.2
|
3
|
+
Version: 0.0.2.1
|
4
4
|
Summary: 通过互联网公共服务渲染LaTeX公式
|
5
5
|
Author-email: Eilles <EillesWan@outlook.com>
|
6
6
|
License: 木兰宽松许可证, 第2版
|
@@ -146,15 +146,18 @@ Requires-Dist: pymdown-extensions>=9.1
|
|
146
146
|
Requires-Dist: aiofiles>=0.8.0
|
147
147
|
|
148
148
|
# nonebot-plugin-latex
|
149
|
-
NoneBot2 LaTeX图形渲染插件
|
150
149
|
|
151
|
-
|
150
|
+
NoneBot2 LaTeX 图形渲染插件
|
151
|
+
|
152
|
+
通过互联网公共服务渲染 LaTeX 公式
|
152
153
|
|
153
154
|
利用 www.latex2png.com 和 latex.codecogs.com 在线渲染 LaTeX 公式
|
154
155
|
|
155
156
|
## 安装
|
156
157
|
|
158
|
+
```bash
|
157
159
|
pip install nonebot-plugin-latex
|
160
|
+
```
|
158
161
|
|
159
162
|
## 使用
|
160
163
|
|
@@ -164,4 +167,4 @@ pip install nonebot-plugin-latex
|
|
164
167
|
enable_as_application = true
|
165
168
|
```
|
166
169
|
|
167
|
-
这样就可以使用 `latex` 命令进行渲染了,例如 `latex E=mc^2
|
170
|
+
这样就可以使用 `latex` 命令进行渲染了,例如 `latex $E=mc^2$` 就会返回这个方程式的渲染图片。
|
@@ -0,0 +1,10 @@
|
|
1
|
+
nonebot_plugin_latex/__init__.py,sha256=CJKPYNITiYW2L8tFY0vp8mPf42YJlwGXIAj7LSz7KPU,1261
|
2
|
+
nonebot_plugin_latex/config.py,sha256=HSMYcxZ-6jfX0b8ZYavLpcXPEz2uC-d9716UE_vtUhE,192
|
3
|
+
nonebot_plugin_latex/converter.py,sha256=08RmFCBrUda8PlnqazX71aHjntBzlSOJc_ZeUHfMQ_M,89
|
4
|
+
nonebot_plugin_latex/data.py,sha256=j2tnJSsBM1iy_ogzSsXNZr0mh64qGIuTLzWO0weIKZc,10434
|
5
|
+
nonebot_plugin_latex/main.py,sha256=uBN1bQm-i55RimDfwpOPMOx3bkCuPe-vli2NTzuoXRg,3518
|
6
|
+
nonebot_plugin_latex-0.0.2.1.dist-info/LICENSE,sha256=ISc-fUbtRp39lxd4MpdVr2Saz7XF2yik0RTSRNuhlaM,9375
|
7
|
+
nonebot_plugin_latex-0.0.2.1.dist-info/METADATA,sha256=FKCpfl22cVQNgjnG62lWEBUAVIl-SmSgJBmRbr4kjME,11650
|
8
|
+
nonebot_plugin_latex-0.0.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
9
|
+
nonebot_plugin_latex-0.0.2.1.dist-info/top_level.txt,sha256=AEtxXrscUdkhTvgg--hAE9WRsW0QVttzK2H-fI9xbGs,21
|
10
|
+
nonebot_plugin_latex-0.0.2.1.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
nonebot_plugin_latex/__init__.py,sha256=xtRmHTHv3UgYiyxpq_HDH4-uzn-DQXU2D6YxvpuwmHs,1259
|
2
|
-
nonebot_plugin_latex/config.py,sha256=HSMYcxZ-6jfX0b8ZYavLpcXPEz2uC-d9716UE_vtUhE,192
|
3
|
-
nonebot_plugin_latex/converter.py,sha256=08RmFCBrUda8PlnqazX71aHjntBzlSOJc_ZeUHfMQ_M,89
|
4
|
-
nonebot_plugin_latex/data.py,sha256=j2tnJSsBM1iy_ogzSsXNZr0mh64qGIuTLzWO0weIKZc,10434
|
5
|
-
nonebot_plugin_latex/main.py,sha256=cHSobOtivGNfrfSBFQmIDoK4FiRpRbF0mo1fSBV3xUk,3511
|
6
|
-
nonebot_plugin_latex-0.0.2.dist-info/LICENSE,sha256=ISc-fUbtRp39lxd4MpdVr2Saz7XF2yik0RTSRNuhlaM,9375
|
7
|
-
nonebot_plugin_latex-0.0.2.dist-info/METADATA,sha256=TR7yDjCYcQWH5FBgmGW5zjDIjQ8uhMFQUL4ljOsdlkE,11627
|
8
|
-
nonebot_plugin_latex-0.0.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
9
|
-
nonebot_plugin_latex-0.0.2.dist-info/top_level.txt,sha256=AEtxXrscUdkhTvgg--hAE9WRsW0QVttzK2H-fI9xbGs,21
|
10
|
-
nonebot_plugin_latex-0.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{nonebot_plugin_latex-0.0.2.dist-info → nonebot_plugin_latex-0.0.2.1.dist-info}/top_level.txt
RENAMED
File without changes
|