Skip to content

Commit

Permalink
Try mermaid diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Feb 9, 2024
1 parent 401ea8d commit 5974f85
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

:root { --md-code-font-family: Roboto Mono, SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace !important; }

.mermaid { text-align: center; }

.md-typeset #references, .md-typeset .no-underline { margin-bottom: 0; padding-bottom: 0; border: none; }
.md-typeset h2 { padding-bottom: 0.2em; border-bottom: 1px solid #d3d3d3; }
.md-typeset h3 { padding-bottom: 0.2em; border-bottom: 1px dashed #d3d3d3; }
Expand Down
4 changes: 4 additions & 0 deletions docs/css/extra.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ $color-codes: red, darkred, orangered, green, limegreen;
--md-code-font-family: Roboto Mono, SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace !important;
}

.mermaid {
text-align: center;
}

.md-typeset {
#references,
.no-underline {
Expand Down
10 changes: 10 additions & 0 deletions docs/ops/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ Systemd 是一大坨软件,包括服务管理(PID 1)、日志管理(syst

在 systemd 中,运行一个完整系统所需的每个部件都作为“单元”(unit)管理。一个 unit 可以是服务(`.service`)、挂载点(`.mount`)、设备(`.device`)、定时器(`.timer`)以至于目标(`.target`)等,完整的列表可以在 [`systemd.unit(5)`][systemd.unit.5] 中找到。

```mermaid
graph TD
U(unit) --> A(service)
U --> B(mount)
U --> C(device)
U --> D(target)
U --> E(slice)
U --> F(scope)
```

Systemd unit 的配置文件**主要**从以下目录按顺序载入,其中同名的文件只取找到的第一个:

- `/etc/systemd/system`:本地配置文件,优先级最高,这也是唯一一个管理员可以手动修改文件的地方。
Expand Down
6 changes: 5 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ markdown_extensions:
- pymdownx.snippets:
auto_append:
- includes/man.md
- pymdownx.superfences
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- toc:
permalink: true

Expand Down

0 comments on commit 5974f85

Please sign in to comment.