Skip to content

Commit 0a23a15

Browse files
committed
Update
1 parent 8f49e19 commit 0a23a15

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

images/mkdocs/scripts/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def get_site_template(copy_extra, template_name):
3333
nav = { 'nav': get_nav() }
3434
if copy_extra == True:
3535
info['extra'] = load_json('config/extra.json')
36+
if os.getenv('disable_giscus') == 'true':
37+
info['extra'].pop('giscus', None)
3638
template_defaults = get_template('/app/templates/' + template_name)
3739
return info | template_defaults | nav
3840

images/mkdocs/templates/templates.fragment.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,65 @@ markdown_extensions:
4040
toc_depth: 3
4141
- pymdownx.arithmatex:
4242
generic: true
43+
44+
- katex-ssr: # 自己做的插件
45+
# disable: true # 禁用 ssr,仅植入 js 代码
46+
katex_dist: "https://cdn.jsdelivr.net/npm/katex@0.16.27/dist/"
47+
add_katex_css: true
48+
katex_css_filename: "katex-swap.min.css"
49+
ssr_contribs:
50+
- mhchem
51+
client_scripts:
52+
- copy-tex
53+
katex_options:
54+
trust: true
55+
macros:
56+
# 下面是一些符号的兼容性定义
57+
"\\RR": "\\mathbb{R}"
58+
"\\i": "\\mathrm{i}"
59+
"\\d": "\\mathrm{d}"
60+
"\\C": "\\mathbb{C}"
61+
"\\R": "\\mathbb{R}"
62+
"\\Q": "\\mathbb{Q}"
63+
"\\Z": "\\mathbb{Z}"
64+
"\\N": "\\mathbb{N}"
65+
"\\P": "\\mathbb{P}"
66+
"\\degree": "^\\circ"
67+
"\\rank": "\\operatorname{rank}" # 矩阵的秩
68+
# 下面是一些简写的定义
69+
"\\op": "\\operatorname"
70+
"\\paren": "\\left({#1}\\right)"
71+
"\\bracket": "\\left[{#1}\\right]"
72+
"\\brace": "\\left\\{{#1}\\right\\}"
73+
"\\ceil": "\\left\\lceil{#1}\\right\\rceil"
74+
"\\floor": "\\left\\lfloor{#1}\\right\\rfloor"
75+
"\\vert": "\\left\\lvert{#1}\\right\\rvert"
76+
"\\vec": "\\bm" # 默认使用粗体表示向量
77+
"\\vecc": "\\overrightarrow" # 默认使用上标箭头表示有向线段
78+
# 下面是一些文化课用的定义
79+
"\\poly": "\\ce{-\\!\\!\\![ #1 ]_n\\!\\!\\!\\!\\!-}" # 有机化学 聚合物
80+
"\\el": "#1\\mathrm{#2}^{#3}" # 结构化学 能级
81+
"\\pH": "p\\ce{H}"
82+
"\\pOH": "p\\ce{OH}"
83+
"\\con": "\\left[\\ce{#1}\\right]" # 化学计量 一般表示摩尔浓度
84+
# 下面都是一些不标准的 Unicode 转移
85+
"": "'"
86+
"": ","
87+
"": "."
88+
"": ";"
89+
"": ":"
90+
"": "!"
91+
"": "?"
92+
"": "["
93+
"": "]"
94+
"": "("
95+
"": ")"
96+
"": ","
97+
"": "-"
98+
"": "\\dots"
99+
"·": "\\cdot"
100+
"->": "\\to"
101+
"<-": "\\gets"
43102
- pymdownx.caret
44103
- pymdownx.keys
45104
- pymdownx.mark

0 commit comments

Comments
 (0)