js-sequence-diagrams plugin for Honkit and GitBook.
npm install gitbook-plugin-sequence
Add this plugin into book.json
.
{
"plugins": ["sequence"]
}
- Support HTML, PDF, EPUB output(make sure your gitbook support SVG)
- Support ```flow code block quote
- Multi code style support
The default config is "theme": "simple"
.
book.json add the js-sequence-diagrams options
"pluginsConfig": {
"sequence": {
"theme": "simple"
}
}
To include a sequence diagram, just wrap your definition in a "sequence" code block. For example:
```sequence
Title: Here is a title
A->B: Normal line
B-->C: Dashed line
C->>D: Open arrow
D-->>A: Dashed open arrow
```
Also you can put in your book block as
{% sequence %}
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!
{% endsequence %}
{% sequence width=770 %}
This project learn from:
- midnightSuyama/gitbook-plugin-flowchart.
- midnightSuyama/gitbook-plugin-sequence-diagrams.
- massanek/gitbook-plugin-js-sequence-diagram.
- nsdont/gitbook-plugin-new-flowchart.
- lyhcode/gitbook-plugin-plantuml.
These plugins are also available on honkit.
Plugin | Description |
---|---|
gitbook-plugin-uml | A plug-in that use plantuml to draw beautiful pictures |
gitbook-plugin-wavedrom | A plug-in that can draw waveforms and register tables |
gitbook-plugin-sequence | A plug-in that can draw sequence diagrams |
gitbook-plugin-flow | A plug-in that can draw flowchart.js diagrams |
gitbook-plugin-echarts | A plug-in that can draw various charts such as bar charts and pie charts |