gitbook-plugin-plantuml-svg2

1.0.0 • Public • Published

gitbook-plugin-plantuml-svg

Inject PlantUML into GitBook as an SVG element.

NPM Travis CI Coveralls

This is forked from wewei/gitbook-plugin-plantuml-svg.

This plugin makes 1 additional improvement, you can do some configurations in book.json:

{
  "pluginsConfig": {
    "plantuml-svg": {
      "serviceUrl": "http://plantuml-service-url/svg",
      "config": [
        "skinparam defaultFontName Microsoft YaHei",
        "skinparam defaultFontSize 14"
      ]
    }
  }
}

Setup

# With NPM 
$ npm install gitbook-plugin-plantuml-svg2
 
# With Yarn 
$ yarn add gitbook-plugin-plantuml-svg2

In your book.json, add plantuml-svg2 to the plugin list

{
  "plugins": ["plantuml-svg2"]
}

Usage

Standalone PlantUML file

Say, you have graph/my-chart.puml.

@startuml
object Hello
object World
Hello --> World
@enduml

In your Markdown document, put following lines.

{% uml src="graph/my-chart.puml" %}
{% enduml %}

By default, the file path is relative to the project root. If you want the path to be relative to current document, do

{% uml src="graph/my-chart.puml", relativeTo=file %}
{% enduml %}

Inline PlantUML

The standalone PlantUML file is recommended for large graphs. However, for simple graphs, you can also use inline plugin PlantUML.

{% uml %}
@startuml
object Hello
object World
Hello --> World
@enduml
{% enduml %}

Dependents (0)

Package Sidebar

Install

npm i gitbook-plugin-plantuml-svg2

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.63 kB

Total Files

5

Last publish

Collaborators

  • akuma