This plugin retrieves the diagram as image when the Gitbook is built.
npm install gitbook-plugin-websequencediagrams-generator --save{
"plugins": [ "websequencediagrams-generator"]
}websequencediagrams-generator-directory: The directory where the images are saved. Default value:diagrams.websequencediagrams-generator-image-prefix: Filename prefix of the generated images. Default value:diagram-.
Add a fragment in the syntax of websequencediagrams.com to your book, for example:
{% websd style="rose" %}
title Authentication Sequence
Alice->Bob: Authentication Request
note right of Bob: Bob thinks about it
Bob->Alice: Authentication Response
{% endwebsd %}
The style parameter is optional, and defaults to "default" if not set.
Run the following command to test the generation of the diagram:
npm testIt saves an image in the testoutput directory.