From d3a61790d4160a7890c3ea3cfb548863ec67ca68 Mon Sep 17 00:00:00 2001 From: ifyun Date: Mon, 4 Mar 2024 11:04:07 +0000 Subject: [PATCH] deploy: e61621cf01ad2a52d44f33261565b95c4b74759c --- docs/README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 4 ++++ jian-doc.umd.js | 50 ++++++++++++++++++++--------------------- 3 files changed, 88 insertions(+), 25 deletions(-) diff --git a/docs/README.md b/docs/README.md index 4646204..61429da 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,6 +6,8 @@ - 创建一个 `
` 元素 - 引入 `jian-doc.umd.js` +可以从此处获取:[jian-doc.umd.js](https://ifyun.github.io/jian-doc/jian-doc.umd.js) + ```html @@ -102,6 +104,19 @@ ``` +### 图表 + +引入 `mermaid`,挂载到 `window` 对象: + +```html + +``` + +代码块语言为 `mermaid` 即可编写图表。 + ## 文档样式测试 ### 段落 @@ -144,3 +159,47 @@ A_{m,n} = a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix} $$ + +### Mermaid + +序列图: + +```mermaid +sequenceDiagram + participant C as Client + participant S as Server + + Note right of S: LISTEN + C ->> S : SYN = 1, seq = x + Note left of C: SYN_SENT + S ->> C : SYN = 1, ACK = 1, seq = y, ack = x + 1 + Note right of S: SYN_RECV + C ->> S : ACK = 1, seq = x + 1, ack = y + 1 + Note left of C: ESTABLISHED + Note right of S: ESTABLISHED +``` + +状态图: + +```mermaid +stateDiagram-v2 + [*] --> NEW + NEW --> RUNNABLE: Thread.start() + + state RUNNABLE { + RUNNING --> READY + READY --> RUNNING + } + + RUNNABLE --> BLOCKED: 未获取到锁 + BLOCKED --> RUNNABLE: 获取到锁 + + RUNNABLE --> TIMED_WAITING: Thread.sleep(long)\nObject.wait(long) + TIMED_WAITING --> RUNNABLE: Object.notify() + + RUNNABLE --> WAITING: Thread.join() + WAITING --> RUNNABLE: Object.notify() + + RUNNABLE --> TERMINATED: 执行完成 + TERMINATED --> [*] +``` diff --git a/index.html b/index.html index c5ed7c2..10ef12a 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,10 @@ rel="stylesheet" href="https://unpkg.com/katex@0.16.9/dist/katex.min.css" /> +