npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

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 %}

install

npm i gitbook-plugin-plantuml-svg2

Downloadsweekly downloads

8

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability