JS Sequence Diagrams

2020-09-23 09:46:17 浏览数 (1)

Usage

代码语言:javascript复制
Andrew->China: Says Hello
Note right of China: China thinksnabout it
China-->Andrew: How are you?
Andrew->>China: I am good thanks!
代码语言:javascript复制
    Andrew->China: Says Hello
    Note right of China: China thinksnabout 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'}"
代码语言:javascript复制
sequenceDiagrams: 
  enable: true
  options: "{theme: 'hand'}"

Configure for a single post in the front matter (Params in front matter have higher precedence):

代码语言:javascript复制
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,
}

Options

代码语言:javascript复制
Title: Here is a title
A->B: Normal line
B-->C: Dashed line
C->>D: Open arrow
D-->>A: Dashed open arrow

See more information from https://github.com/bramp/js-sequence-diagrams.

Examples

代码语言:javascript复制
```sequence
Title: Here is a title
A->B: Normal line
B-->C: Dashed line
C->>D: Open arrow
D-->>A: Dashed open arrow
```
代码语言:javascript复制
# Example of a comment.
Note left of A: Note to then left of A
Note right of A: Note to then right of A
Note over A: Note over A
Note over A,B: Note over both A and B
代码语言:javascript复制
```sequence
# Example of a comment.
Note left of A: Note to then left of A
Note right of A: Note to then right of A
Note over A: Note over A
Note over A,B: Note over both A and B
```

0 人点赞