/reveal-plantuml.github.io

A reveal.js plugin that allow using PlantUML diagrams on slides

Primary LanguageHTMLMIT LicenseMIT

reveal-plantuml

NPM License: MIT Issues

A reveal.js plugin that allow using PlantUML diagrams on HTML and Markdown slides. Check live demo to see plugin in action.

Installation

You can use the plugin directly from CDN:

Reveal.initialize({
  dependencies: [
    { src: '//cdn.jsdelivr.net/npm/reveal-plantuml' },
  ]
});

or install using npm:

npm i reveal-plantuml

Usage

Simply put PlantUML diagrams in code block. In markdown use plantuml language type:

```plantuml
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml
```

The @startuml and @enduml lines are optional.

In HTML use language-plantuml class in code element inside of pre element:

<pre>
<code class="language-plantuml">
  @startuml
  Alice -> Bob: Authentication Request
  Bob --> Alice: Authentication Response
  Alice -> Bob: Another authentication Request
  Bob --> Alice: Another authentication Response
  @enduml
</code>
</pre>

The @startuml and @enduml lines are optional.

Options

You can set PlantUML server path using serverPath configuration option:

Reveal.initialize({
  plantuml: {
      serverPath: 'https://plantuml.example.com/plantuml/svg/'
  }
  dependencies: [
    { src: '//cdn.jsdelivr.net/npm/reveal-plantuml' },
  ]
});

The default server path is //www.plantuml.com/plantuml/svg

License

This project is licensed under the MIT License. See the LICENSE for details.