Skip to content

Commit 014bb0b

Browse files
committed
Add mermaid support to the document. Consider add mermaid.js to local (not from requesting unpkg.org?)
1 parent cff3462 commit 014bb0b

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

docs/Ch05/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ drwxrwxr-x 2 ustc ustc 4096 Feb 3 22:38 a_folder
318318
而 UNIX 系列采用了一种不一样的思路组织文件:整个系统的文件都从 `/`(根目录)开始,像一棵树一样,类似于下图。
319319

320320
```mermaid
321-
graph TD
321+
graph LR
322322
/ --> bin
323323
/ --> boot
324324
/ --> dev
@@ -348,7 +348,7 @@ graph TD
348348
lisi --> docs
349349
350350
mnt --> windows_disk
351-
subgraph
351+
subgraph mount
352352
windows_disk --> Windows
353353
windows_disk --> Users
354354
end

mkdocs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,19 @@ markdown_extensions:
4646
- pymdownx.emoji:
4747
emoji_index: !!python/name:material.extensions.emoji.twemoji
4848
emoji_generator: !!python/name:material.extensions.emoji.to_svg
49+
- pymdownx.superfences:
50+
custom_fences:
51+
- name: mermaid
52+
class: mermaid
53+
format: !!python/name:mermaid2.fence_mermaid_custom
4954
- pymdownx.inlinehilite
5055
- pymdownx.keys
5156
- pymdownx.superfences
5257
- markdown.extensions.def_list
5358
- toc:
5459
permalink: true
5560

61+
5662
extra:
5763
social:
5864
- icon: octicons/globe-16
@@ -63,6 +69,10 @@ extra:
6369
provider: google
6470
property: G-Q8WSZQS8E1
6571

72+
plugins:
73+
- mermaid2:
74+
javascript: https://unpkg.com/mermaid@10.4.0/dist/mermaid.esm.min.mjs
75+
6676
extra_css:
6777
- 'css/extra.css'
6878
- 'https://101.lug.ustc.edu.cn/_extra/roboto.css'

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
mkdocs>=1.5.3
22
mkdocs-material>=9.4.6
33
jieba
4+
mkdocs-mermaid2-plugin

0 commit comments

Comments
 (0)