1.0.5 • Published 4 years ago

gitbook-plugin-websequencediagrams-generator v1.0.5

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
4 years ago

Websequencediagrams.com integration for GitBook

This plugin retrieves the diagram as image when the Gitbook is built.

Adding the plugin to a Gitbook project

Install plugin as npm dependency

npm install gitbook-plugin-websequencediagrams-generator --save

Add the plugin to book.json config

{
    "plugins": [ "websequencediagrams-generator"]
}

Optional configuration

  • 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-.

Using the plugin

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.

Test the plugin

Run the following command to test the generation of the diagram:

npm test

It saves an image in the testoutput directory.