nonebot-plugin-latex 0.0.3.2__py3-none-any.whl → 0.0.3.4__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 +6 -24
- nonebot_plugin_latex/data.py +10 -7
- nonebot_plugin_latex/main.py +10 -11
- nonebot_plugin_latex-0.0.3.4.dist-info/METADATA +169 -0
- nonebot_plugin_latex-0.0.3.4.dist-info/RECORD +10 -0
- {nonebot_plugin_latex-0.0.3.2.dist-info → nonebot_plugin_latex-0.0.3.4.dist-info}/WHEEL +1 -2
- nonebot_plugin_latex-0.0.3.4.dist-info/entry_points.txt +4 -0
- nonebot_plugin_latex-0.0.3.2.dist-info/METADATA +0 -170
- nonebot_plugin_latex-0.0.3.2.dist-info/RECORD +0 -10
- nonebot_plugin_latex-0.0.3.2.dist-info/top_level.txt +0 -1
- {nonebot_plugin_latex-0.0.3.2.dist-info → nonebot_plugin_latex-0.0.3.4.dist-info/licenses}/LICENSE +0 -0
nonebot_plugin_latex/__init__.py
CHANGED
@@ -13,16 +13,18 @@ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
13
13
|
See the Mulan PSL v2 for more details.
|
14
14
|
"""
|
15
15
|
|
16
|
-
from nonebot import
|
17
|
-
from nonebot.plugin import PluginMetadata
|
16
|
+
from nonebot import get_driver, get_plugin_config
|
17
|
+
from nonebot.plugin import PluginMetadata, inherit_supported_adapters, require
|
18
18
|
|
19
19
|
from .config import Config
|
20
20
|
from .converter import _converter, get_converter
|
21
21
|
|
22
|
-
__version__ = "0.0.3.
|
22
|
+
__version__ = "0.0.3.4"
|
23
23
|
|
24
24
|
__author__ = "Eilles"
|
25
25
|
|
26
|
+
require("nonebot_plugin_alconna")
|
27
|
+
|
26
28
|
__plugin_meta__ = PluginMetadata(
|
27
29
|
name="LaTeX 在线渲染插件",
|
28
30
|
description="从互联网服务渲染 LaTeX 公式",
|
@@ -30,27 +32,7 @@ __plugin_meta__ = PluginMetadata(
|
|
30
32
|
type="library",
|
31
33
|
homepage="https://github.com/EillesWan/nonebot-plugin-latex",
|
32
34
|
config=Config,
|
33
|
-
supported_adapters=
|
34
|
-
"nonebot.adapters.telegram",
|
35
|
-
"nonebot.adapters.dodo",
|
36
|
-
"nonebot_adapter_tailchat",
|
37
|
-
"nonebot.adapters.onebot.v11",
|
38
|
-
"nonebot.adapters.minecraft",
|
39
|
-
"nonebot.adapters.github",
|
40
|
-
"nonebot.adapters.discord",
|
41
|
-
"nonebot.adapters.mail",
|
42
|
-
"nonebot.adapters.ding",
|
43
|
-
"nonebot.adapters.console",
|
44
|
-
"nonebot.adapters.qq",
|
45
|
-
"nonebot.adapters.kritor",
|
46
|
-
"nonebot.adapters.feishu",
|
47
|
-
"nonebot.adapters.red",
|
48
|
-
"nonebot.adapters.satori",
|
49
|
-
"nonebot.adapters.onebot.v12",
|
50
|
-
"nonebot.adapters.kaiheila",
|
51
|
-
"nonebot.adapters.mirai",
|
52
|
-
"nonebot.adapters.ntchat",
|
53
|
-
}, # inherit_supported_adapters("nonebot_plugin_alconna"),
|
35
|
+
supported_adapters=inherit_supported_adapters("nonebot_plugin_alconna"),
|
54
36
|
extra={"License": "Mulan PSL v2", "Author": __author__},
|
55
37
|
)
|
56
38
|
|
nonebot_plugin_latex/data.py
CHANGED
@@ -13,14 +13,17 @@ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
13
13
|
See the Mulan PSL v2 for more details.
|
14
14
|
"""
|
15
15
|
|
16
|
+
import asyncio
|
16
17
|
import re
|
18
|
+
import ssl
|
17
19
|
import time
|
18
|
-
import asyncio
|
19
20
|
from typing import Literal, Optional, Tuple
|
20
21
|
|
21
22
|
import httpx
|
22
23
|
from nonebot import logger
|
23
24
|
|
25
|
+
_ssl_context = ssl.create_default_context()
|
26
|
+
_ssl_context.set_ciphers("DEFAULT")
|
24
27
|
|
25
28
|
# 正则匹配 LaTeX 公式内容
|
26
29
|
LATEX_PATTERN = re.compile(
|
@@ -65,7 +68,7 @@ class L2PChannel(ConvertChannel):
|
|
65
68
|
|
66
69
|
async with httpx.AsyncClient(
|
67
70
|
timeout=timeout,
|
68
|
-
verify=
|
71
|
+
verify=_ssl_context,
|
69
72
|
) as client:
|
70
73
|
while retry > 0:
|
71
74
|
try:
|
@@ -102,7 +105,7 @@ class L2PChannel(ConvertChannel):
|
|
102
105
|
|
103
106
|
@staticmethod
|
104
107
|
async def channel_test() -> int:
|
105
|
-
async with httpx.AsyncClient(timeout=5, verify=
|
108
|
+
async with httpx.AsyncClient(timeout=5, verify=_ssl_context) as client:
|
106
109
|
try:
|
107
110
|
start_time = time.time_ns()
|
108
111
|
latex2png = (
|
@@ -144,7 +147,7 @@ class CDCChannel(ConvertChannel):
|
|
144
147
|
) -> Tuple[Literal[True], bytes] | Tuple[Literal[False], bytes | str]:
|
145
148
|
async with httpx.AsyncClient(
|
146
149
|
timeout=timeout,
|
147
|
-
verify=
|
150
|
+
verify=_ssl_context,
|
148
151
|
) as client:
|
149
152
|
|
150
153
|
while retry > 0:
|
@@ -170,7 +173,7 @@ class CDCChannel(ConvertChannel):
|
|
170
173
|
|
171
174
|
@staticmethod
|
172
175
|
async def channel_test() -> int:
|
173
|
-
async with httpx.AsyncClient(timeout=5, verify=
|
176
|
+
async with httpx.AsyncClient(timeout=5, verify=_ssl_context) as client:
|
174
177
|
try:
|
175
178
|
start_time = time.time_ns()
|
176
179
|
codecogs = (
|
@@ -202,7 +205,7 @@ class JRTChannel(ConvertChannel):
|
|
202
205
|
|
203
206
|
async with httpx.AsyncClient(
|
204
207
|
timeout=timeout,
|
205
|
-
verify=
|
208
|
+
verify=_ssl_context,
|
206
209
|
) as client:
|
207
210
|
while retry > 0:
|
208
211
|
try:
|
@@ -236,7 +239,7 @@ class JRTChannel(ConvertChannel):
|
|
236
239
|
|
237
240
|
@staticmethod
|
238
241
|
async def channel_test() -> int:
|
239
|
-
async with httpx.AsyncClient(timeout=5, verify=
|
242
|
+
async with httpx.AsyncClient(timeout=5, verify=_ssl_context) as client:
|
240
243
|
try:
|
241
244
|
start_time = time.time_ns()
|
242
245
|
joeraut = (
|
nonebot_plugin_latex/main.py
CHANGED
@@ -14,22 +14,17 @@ See the Mulan PSL v2 for more details.
|
|
14
14
|
"""
|
15
15
|
|
16
16
|
import nonebot
|
17
|
-
|
18
17
|
from nonebot_plugin_alconna.uniseg import Text
|
19
18
|
|
20
|
-
|
21
19
|
nonebot.require("nonebot_plugin_alconna")
|
22
20
|
|
23
|
-
from nonebot_plugin_alconna import
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
UniMessage,
|
28
|
-
UniMsg
|
29
|
-
)
|
21
|
+
from nonebot_plugin_alconna import Image as Alconna_Image
|
22
|
+
from nonebot_plugin_alconna import Reply
|
23
|
+
from nonebot_plugin_alconna import Text as Alconnna_Text
|
24
|
+
from nonebot_plugin_alconna import UniMessage, UniMsg
|
30
25
|
|
31
|
-
from .data import LATEX_PATTERN
|
32
26
|
from .converter import _converter
|
27
|
+
from .data import LATEX_PATTERN
|
33
28
|
|
34
29
|
command_heads = (
|
35
30
|
"latex",
|
@@ -77,7 +72,11 @@ async def handle_pic(
|
|
77
72
|
if msgs.has(Reply):
|
78
73
|
i = msgs[Reply, 0]
|
79
74
|
if i.msg:
|
80
|
-
latexes.extend(
|
75
|
+
latexes.extend(
|
76
|
+
LATEX_PATTERN.finditer(
|
77
|
+
i.msg if isinstance(i.msg, str) else i.msg.extract_plain_text()
|
78
|
+
)
|
79
|
+
)
|
81
80
|
|
82
81
|
# print(arg)
|
83
82
|
latexes.extend(LATEX_PATTERN.finditer(msgs.extract_plain_text()))
|
@@ -0,0 +1,169 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: nonebot-plugin-latex
|
3
|
+
Version: 0.0.3.4
|
4
|
+
Summary: 通过互联网公共服务渲染LaTeX公式
|
5
|
+
Author-Email: Eilles <EillesWan@outlook.com>
|
6
|
+
License: 木兰宽松许可证, 第2版
|
7
|
+
|
8
|
+
木兰宽松许可证, 第2版
|
9
|
+
2020年1月 http://license.coscl.org.cn/MulanPSL2
|
10
|
+
|
11
|
+
您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
|
12
|
+
|
13
|
+
0. 定义
|
14
|
+
|
15
|
+
“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
|
16
|
+
|
17
|
+
“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
|
18
|
+
|
19
|
+
“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
|
20
|
+
|
21
|
+
“法人实体” 是指提交贡献的机构及其“关联实体”。
|
22
|
+
|
23
|
+
“关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
|
24
|
+
|
25
|
+
1. 授予版权许可
|
26
|
+
|
27
|
+
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
|
28
|
+
|
29
|
+
2. 授予专利许可
|
30
|
+
|
31
|
+
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
|
32
|
+
|
33
|
+
3. 无商标许可
|
34
|
+
|
35
|
+
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
|
36
|
+
|
37
|
+
4. 分发限制
|
38
|
+
|
39
|
+
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
|
40
|
+
|
41
|
+
5. 免责声明与责任限制
|
42
|
+
|
43
|
+
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
|
44
|
+
|
45
|
+
6. 语言
|
46
|
+
|
47
|
+
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
|
48
|
+
|
49
|
+
条款结束
|
50
|
+
|
51
|
+
如何将木兰宽松许可证,第2版,应用到您的软件
|
52
|
+
|
53
|
+
如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
|
54
|
+
|
55
|
+
1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
|
56
|
+
|
57
|
+
2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
|
58
|
+
|
59
|
+
3, 请将如下声明文本放入每个源文件的头部注释中。
|
60
|
+
|
61
|
+
Copyright (c) [Year] [name of copyright holder]
|
62
|
+
[Software Name] is licensed under Mulan PSL v2.
|
63
|
+
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
64
|
+
You may obtain a copy of Mulan PSL v2 at:
|
65
|
+
http://license.coscl.org.cn/MulanPSL2
|
66
|
+
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
67
|
+
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
68
|
+
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
69
|
+
See the Mulan PSL v2 for more details.
|
70
|
+
|
71
|
+
|
72
|
+
Mulan Permissive Software License,Version 2
|
73
|
+
|
74
|
+
Mulan Permissive Software License,Version 2 (Mulan PSL v2)
|
75
|
+
January 2020 http://license.coscl.org.cn/MulanPSL2
|
76
|
+
|
77
|
+
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
|
78
|
+
|
79
|
+
0. Definition
|
80
|
+
|
81
|
+
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
|
82
|
+
|
83
|
+
Contribution means the copyrightable work licensed by a particular Contributor under this License.
|
84
|
+
|
85
|
+
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
|
86
|
+
|
87
|
+
Legal Entity means the entity making a Contribution and all its Affiliates.
|
88
|
+
|
89
|
+
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
|
90
|
+
|
91
|
+
1. Grant of Copyright License
|
92
|
+
|
93
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
|
94
|
+
|
95
|
+
2. Grant of Patent License
|
96
|
+
|
97
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
|
98
|
+
|
99
|
+
3. No Trademark License
|
100
|
+
|
101
|
+
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
|
102
|
+
|
103
|
+
4. Distribution Restriction
|
104
|
+
|
105
|
+
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
|
106
|
+
|
107
|
+
5. Disclaimer of Warranty and Limitation of Liability
|
108
|
+
|
109
|
+
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
110
|
+
|
111
|
+
6. Language
|
112
|
+
|
113
|
+
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
|
114
|
+
|
115
|
+
END OF THE TERMS AND CONDITIONS
|
116
|
+
|
117
|
+
How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
|
118
|
+
|
119
|
+
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
|
120
|
+
|
121
|
+
Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
|
122
|
+
Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
|
123
|
+
Attach the statement to the appropriate annotated syntax at the beginning of each source file.
|
124
|
+
|
125
|
+
Copyright (c) [Year] [name of copyright holder]
|
126
|
+
[Software Name] is licensed under Mulan PSL v2.
|
127
|
+
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
128
|
+
You may obtain a copy of Mulan PSL v2 at:
|
129
|
+
http://license.coscl.org.cn/MulanPSL2
|
130
|
+
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
131
|
+
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
132
|
+
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
133
|
+
See the Mulan PSL v2 for more details.
|
134
|
+
Project-URL: Homepage, https://github.com/EillesWan/nonebot-plugin-latex
|
135
|
+
Project-URL: Bug Tracker, https://github.com/EillesWan/nonebot-plugin-latex/issues
|
136
|
+
Requires-Python: <4.0,>=3.9
|
137
|
+
Requires-Dist: nonebot2>=2.2.0
|
138
|
+
Requires-Dist: httpx<0.28.0,>=0.27.0
|
139
|
+
Requires-Dist: nonebot-plugin-alconna>=0.48.0
|
140
|
+
Description-Content-Type: text/markdown
|
141
|
+
|
142
|
+
# nonebot-plugin-latex
|
143
|
+
|
144
|
+
NoneBot2 LaTeX 图形渲染插件
|
145
|
+
|
146
|
+
通过互联网公共服务渲染 LaTeX 公式
|
147
|
+
|
148
|
+
利用 www.latex2png.com 和 latex.codecogs.com 在线渲染 LaTeX 公式
|
149
|
+
|
150
|
+
## 安装
|
151
|
+
|
152
|
+
```bash
|
153
|
+
pip install nonebot-plugin-latex
|
154
|
+
```
|
155
|
+
|
156
|
+
## 使用
|
157
|
+
|
158
|
+
如果希望直接作为 LaTeX 渲染插件使用的话,请在 NoneBot 配置文件中添加以下内容:
|
159
|
+
|
160
|
+
```env
|
161
|
+
latex_enable_as_application = true
|
162
|
+
```
|
163
|
+
|
164
|
+
这样就可以使用 `latex` 命令进行渲染了,例如 `latex $E=mc^2$` 就会返回这个方程式的渲染图片。
|
165
|
+
|
166
|
+
## 提交
|
167
|
+
|
168
|
+
各位可以搭建自己的 LaTeX 在线渲染服务,或者直接本地渲染,如果提交到本仓库,在下不胜感激。\
|
169
|
+
对于本地渲染服务,请不要使用 nonebot-plugin-htmlrender
|
@@ -0,0 +1,10 @@
|
|
1
|
+
nonebot_plugin_latex-0.0.3.4.dist-info/METADATA,sha256=kFImDCjFNHNAgDXLcmRGv0d9jQxe5JJnpbYmrS2x6Ik,11649
|
2
|
+
nonebot_plugin_latex-0.0.3.4.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
nonebot_plugin_latex-0.0.3.4.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
4
|
+
nonebot_plugin_latex-0.0.3.4.dist-info/licenses/LICENSE,sha256=ISc-fUbtRp39lxd4MpdVr2Saz7XF2yik0RTSRNuhlaM,9375
|
5
|
+
nonebot_plugin_latex/__init__.py,sha256=40yEiPgwcHohXq8N0tRQ8_jf0bVefAzgvqEMMAjZDv8,1566
|
6
|
+
nonebot_plugin_latex/config.py,sha256=5WOJF-vsuLqGTDGgklpMm-xLd_qdwVb0VCq-n8EwoJQ,198
|
7
|
+
nonebot_plugin_latex/converter.py,sha256=rTyeJoZOhXciLcfZ6FWOe0mHczmd2E_sTrqEbJRZ6d8,194
|
8
|
+
nonebot_plugin_latex/data.py,sha256=RepSY3I4t61Gk5yDfGSgn9UwZWFx8cnh4dHXIShTl-Y,11579
|
9
|
+
nonebot_plugin_latex/main.py,sha256=ZufATio6dUvVj428myBwcNub_ErQ0LcotsjUvRPup98,3093
|
10
|
+
nonebot_plugin_latex-0.0.3.4.dist-info/RECORD,,
|
@@ -1,170 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.2
|
2
|
-
Name: nonebot-plugin-latex
|
3
|
-
Version: 0.0.3.2
|
4
|
-
Summary: 通过互联网公共服务渲染LaTeX公式
|
5
|
-
Author-email: Eilles <EillesWan@outlook.com>
|
6
|
-
License: 木兰宽松许可证, 第2版
|
7
|
-
|
8
|
-
木兰宽松许可证, 第2版
|
9
|
-
2020年1月 http://license.coscl.org.cn/MulanPSL2
|
10
|
-
|
11
|
-
您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
|
12
|
-
|
13
|
-
0. 定义
|
14
|
-
|
15
|
-
“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
|
16
|
-
|
17
|
-
“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
|
18
|
-
|
19
|
-
“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
|
20
|
-
|
21
|
-
“法人实体” 是指提交贡献的机构及其“关联实体”。
|
22
|
-
|
23
|
-
“关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
|
24
|
-
|
25
|
-
1. 授予版权许可
|
26
|
-
|
27
|
-
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
|
28
|
-
|
29
|
-
2. 授予专利许可
|
30
|
-
|
31
|
-
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
|
32
|
-
|
33
|
-
3. 无商标许可
|
34
|
-
|
35
|
-
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
|
36
|
-
|
37
|
-
4. 分发限制
|
38
|
-
|
39
|
-
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
|
40
|
-
|
41
|
-
5. 免责声明与责任限制
|
42
|
-
|
43
|
-
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
|
44
|
-
|
45
|
-
6. 语言
|
46
|
-
|
47
|
-
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
|
48
|
-
|
49
|
-
条款结束
|
50
|
-
|
51
|
-
如何将木兰宽松许可证,第2版,应用到您的软件
|
52
|
-
|
53
|
-
如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
|
54
|
-
|
55
|
-
1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
|
56
|
-
|
57
|
-
2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
|
58
|
-
|
59
|
-
3, 请将如下声明文本放入每个源文件的头部注释中。
|
60
|
-
|
61
|
-
Copyright (c) [Year] [name of copyright holder]
|
62
|
-
[Software Name] is licensed under Mulan PSL v2.
|
63
|
-
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
64
|
-
You may obtain a copy of Mulan PSL v2 at:
|
65
|
-
http://license.coscl.org.cn/MulanPSL2
|
66
|
-
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
67
|
-
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
68
|
-
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
69
|
-
See the Mulan PSL v2 for more details.
|
70
|
-
|
71
|
-
|
72
|
-
Mulan Permissive Software License,Version 2
|
73
|
-
|
74
|
-
Mulan Permissive Software License,Version 2 (Mulan PSL v2)
|
75
|
-
January 2020 http://license.coscl.org.cn/MulanPSL2
|
76
|
-
|
77
|
-
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
|
78
|
-
|
79
|
-
0. Definition
|
80
|
-
|
81
|
-
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
|
82
|
-
|
83
|
-
Contribution means the copyrightable work licensed by a particular Contributor under this License.
|
84
|
-
|
85
|
-
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
|
86
|
-
|
87
|
-
Legal Entity means the entity making a Contribution and all its Affiliates.
|
88
|
-
|
89
|
-
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
|
90
|
-
|
91
|
-
1. Grant of Copyright License
|
92
|
-
|
93
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
|
94
|
-
|
95
|
-
2. Grant of Patent License
|
96
|
-
|
97
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
|
98
|
-
|
99
|
-
3. No Trademark License
|
100
|
-
|
101
|
-
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
|
102
|
-
|
103
|
-
4. Distribution Restriction
|
104
|
-
|
105
|
-
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
|
106
|
-
|
107
|
-
5. Disclaimer of Warranty and Limitation of Liability
|
108
|
-
|
109
|
-
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
110
|
-
|
111
|
-
6. Language
|
112
|
-
|
113
|
-
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
|
114
|
-
|
115
|
-
END OF THE TERMS AND CONDITIONS
|
116
|
-
|
117
|
-
How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
|
118
|
-
|
119
|
-
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
|
120
|
-
|
121
|
-
Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
|
122
|
-
Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
|
123
|
-
Attach the statement to the appropriate annotated syntax at the beginning of each source file.
|
124
|
-
|
125
|
-
Copyright (c) [Year] [name of copyright holder]
|
126
|
-
[Software Name] is licensed under Mulan PSL v2.
|
127
|
-
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
128
|
-
You may obtain a copy of Mulan PSL v2 at:
|
129
|
-
http://license.coscl.org.cn/MulanPSL2
|
130
|
-
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
131
|
-
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
132
|
-
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
133
|
-
See the Mulan PSL v2 for more details.
|
134
|
-
Project-URL: Homepage, https://github.com/EillesWan/nonebot-plugin-latex
|
135
|
-
Project-URL: Bug Tracker, https://github.com/EillesWan/nonebot-plugin-latex/issues
|
136
|
-
Requires-Python: <4.0,>=3.9
|
137
|
-
Description-Content-Type: text/markdown
|
138
|
-
License-File: LICENSE
|
139
|
-
Requires-Dist: nonebot2<1000.0.0,>=2.2.0
|
140
|
-
Requires-Dist: httpx<0.28.0,>=0.27.0
|
141
|
-
Requires-Dist: nonebot-plugin-alconna<1000.0.0,>=0.48.0
|
142
|
-
|
143
|
-
# nonebot-plugin-latex
|
144
|
-
|
145
|
-
NoneBot2 LaTeX 图形渲染插件
|
146
|
-
|
147
|
-
通过互联网公共服务渲染 LaTeX 公式
|
148
|
-
|
149
|
-
利用 www.latex2png.com 和 latex.codecogs.com 在线渲染 LaTeX 公式
|
150
|
-
|
151
|
-
## 安装
|
152
|
-
|
153
|
-
```bash
|
154
|
-
pip install nonebot-plugin-latex
|
155
|
-
```
|
156
|
-
|
157
|
-
## 使用
|
158
|
-
|
159
|
-
如果希望直接作为 LaTeX 渲染插件使用的话,请在 NoneBot 配置文件中添加以下内容:
|
160
|
-
|
161
|
-
```env
|
162
|
-
latex_enable_as_application = true
|
163
|
-
```
|
164
|
-
|
165
|
-
这样就可以使用 `latex` 命令进行渲染了,例如 `latex $E=mc^2$` 就会返回这个方程式的渲染图片。
|
166
|
-
|
167
|
-
## 提交
|
168
|
-
|
169
|
-
各位可以搭建自己的 LaTeX 在线渲染服务,或者直接本地渲染,如果提交到本仓库,在下不胜感激。\
|
170
|
-
对于本地渲染服务,请不要使用 nonebot-plugin-htmlrender
|
@@ -1,10 +0,0 @@
|
|
1
|
-
nonebot_plugin_latex/__init__.py,sha256=uPYvgMdBr9M9G1oGvJieU9ylXQnFiH5M3WvQMz3y8tI,2193
|
2
|
-
nonebot_plugin_latex/config.py,sha256=5WOJF-vsuLqGTDGgklpMm-xLd_qdwVb0VCq-n8EwoJQ,198
|
3
|
-
nonebot_plugin_latex/converter.py,sha256=rTyeJoZOhXciLcfZ6FWOe0mHczmd2E_sTrqEbJRZ6d8,194
|
4
|
-
nonebot_plugin_latex/data.py,sha256=ygcJClUUM4lNR9PotPC1E0rtrRq1swanPWIBnwAvcWM,11443
|
5
|
-
nonebot_plugin_latex/main.py,sha256=iKlkYndPrKi72oXMASmdgPKuT5scEIxtfEuLO7s5OHw,2950
|
6
|
-
nonebot_plugin_latex-0.0.3.2.dist-info/LICENSE,sha256=ISc-fUbtRp39lxd4MpdVr2Saz7XF2yik0RTSRNuhlaM,9375
|
7
|
-
nonebot_plugin_latex-0.0.3.2.dist-info/METADATA,sha256=hl_48J9ObpRK41asIg1ru2phKjJQgs_rr6hIAsmO71k,11735
|
8
|
-
nonebot_plugin_latex-0.0.3.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
9
|
-
nonebot_plugin_latex-0.0.3.2.dist-info/top_level.txt,sha256=AEtxXrscUdkhTvgg--hAE9WRsW0QVttzK2H-fI9xbGs,21
|
10
|
-
nonebot_plugin_latex-0.0.3.2.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
nonebot_plugin_latex
|
{nonebot_plugin_latex-0.0.3.2.dist-info → nonebot_plugin_latex-0.0.3.4.dist-info/licenses}/LICENSE
RENAMED
File without changes
|