This commit is contained in:
PC 2024-11-25 11:24:24 +08:00
parent ac7826afe6
commit fd9cc50535
4 changed files with 19 additions and 6 deletions

View File

@ -7,7 +7,7 @@
<excludeFolder url="file://$MODULE_DIR$/dist" /> <excludeFolder url="file://$MODULE_DIR$/dist" />
<excludeFolder url="file://$MODULE_DIR$/venv" /> <excludeFolder url="file://$MODULE_DIR$/venv" />
</content> </content>
<orderEntry type="jdk" jdkName="Python 3.11 (CrossDown)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="PackageRequirementsSettings"> <component name="PackageRequirementsSettings">

View File

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (CrossDown)" project-jdk-type="Python SDK" /> <component name="Black">
<option name="sdkName" value="Python 3.13" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13" project-jdk-type="Python SDK" />
</project> </project>

View File

@ -189,9 +189,21 @@ class BasicExtension(Extension):
class InlineCode: class InlineCode:
def __init__(self, variable: Variable): def __init__(self, variable: Variable):
"""
初始化
:param variable: 变量字典
"""
self.variable = variable self.variable = variable
def __call__(self, source: str, language: str, css_class: str, md: markdown.core.Markdown): # 自定义的单行代码格式化器 def __call__(self, source: str, language: str, css_class: str, md: markdown.core.Markdown): # 自定义的单行代码格式化器
"""
InlineHiliteExtension的自定义格式化器
:param source:
:param language:
:param css_class:
:param md:
:return:
"""
if language != '': # 字符串已经定义了语言类型 if language != '': # 字符串已经定义了语言类型
return md.inlinePatterns['backtick'].highlight_code( return md.inlinePatterns['backtick'].highlight_code(
src=source, language=language, classname=css_class, src=source, language=language, classname=css_class,

View File

@ -1,9 +1,7 @@
Markdown>=3.7 Markdown>=3.7
matplotlib~=3.8.2
numpy~=1.26.2
pygments>=2.18.0 pygments>=2.18.0
CrossDown>=2.2.0
setuptools~=70.1.1 setuptools~=70.1.1
emoji~=2.13.2 emoji~=2.13.2
pymdown-extensions>=10.12 pymdown-extensions>=10.12
kbdextension>=1.0.1 kbdextension>=1.0.1
markdown_gfm_admonition>=0.1.1