blob: 3ca3a1c5b12a43ee124b957786b511c0a65b8fd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
---
title: "JS Sequence Diagrams"
date: 2015-03-04T21:57:45+08:00
draft: false
sequenceDiagrams:
enable: true
options: "{theme: 'hand'}"
---
## Usage
```sequence
Andrew->China: Says Hello
Note right of China: China thinks\nabout it
China-->Andrew: How are you?
Andrew->>China: I am good thanks!
```
<!--more-->
```sequence
Andrew->China: Says Hello
Note right of China: China thinks\nabout it
China-->Andrew: How are you?
Andrew->>China: I am good thanks!
```
## Configuration
Configure for all home and regular pages:
```toml
[params.sequenceDiagrams]
enable = true
options = "{theme: 'hand'}"
```
Configure for a single post in the front matter (**Params in front matter have higher precedence**):
```yml
sequenceDiagrams:
enable: true
options: "{theme: 'hand'}"
```
### Options
```js
options = {
// Change the styling of the diagram, typically one of 'simple', 'hand'. New themes can be registered with registerTheme(...).
theme: string,
// CSS style to apply to the diagram's svg tag. (Only supported if using snap.svg)
css_class: string,
}
```
See more information from https://github.com/bramp/js-sequence-diagrams.
## Examples
```sequence
Title: Here is a title
A->B: Normal line
B-->C: Dashed line
C->>D: Open arrow
D-->>A: Dashed open arrow
```
```sequence
Title: Here is a title
A->B: Normal line
B-->C: Dashed line
C->>D: Open arrow
D-->>A: Dashed open arrow
```
---
```sequence
# Example of a comment.
Note left of A: Note to the\n left of A
Note right of A: Note to the\n right of A
Note over A: Note over A
Note over A,B: Note over both A and B
```
```sequence
# Example of a comment.
Note left of A: Note to the\n left of A
Note right of A: Note to the\n right of A
Note over A: Note over A
Note over A,B: Note over both A and B
```
|