gitbook-plugin-plantuml-svg
Advanced tools
Comparing version 1.0.0-beta.0 to 1.0.0
{ | ||
"name": "gitbook-plugin-plantuml-svg", | ||
"version": "1.0.0-beta.0", | ||
"version": "1.0.0", | ||
"description": "Inject PlantUML into gitbook as SVG", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/wewei/gitbook-plugin-plantuml-svg", |
# gitbook-plugin-plantuml-svg | ||
#### Inject PlantUML into GitBook as an SVG element. | ||
[![NPM][shield-npm]][npm] | ||
[![Travis CI][shield-travis]][travis] | ||
[![Coveralls][shield-coveralls]][coveralls] | ||
Inject PlantUML into GitBook as an SVG element | ||
This is inspired by [dy93][github-dy93]'s work | ||
[plugin-plantuml-cloud][github-plugin-plantuml-cloud]. There're already several | ||
PlantUML plugins for GitBook out there. However, most of them relies on a local | ||
[PlantUML][plantuml] & [Graphviz][graphviz]. | ||
The **plugin-plantuml-cloud** uses the public PlantUML services. It saves | ||
people's effort to maintain the local **plantuml.jar**. | ||
This plugin makes 2 additional improvements | ||
1. Insert `<object data="..." type="image/svg+xml">` instead of `<img>`, so that | ||
the links in `SVG` still work. | ||
2. Support standalone PlantUML file. | ||
### Setup | ||
```bash | ||
# With NPM | ||
$ npm install gitbook-plugin-plantuml-svg | ||
# With Yarn | ||
$ yarn add gitbook-plugin-plantuml-svg | ||
``` | ||
In your `book.json`, add plantuml-svg to the plugin list | ||
```json | ||
{ | ||
"plugins": ["plantuml-svg"] | ||
} | ||
``` | ||
### Usage | ||
#### Standalone PlantUML file | ||
Say, you have `graph/my-chart.puml`. | ||
```plantuml | ||
@startuml | ||
object Hello | ||
object World | ||
Hello --> World | ||
@enduml | ||
``` | ||
In your Markdown document, put following lines. | ||
```markdown | ||
{% 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 | ||
```markdown | ||
{% 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. | ||
```markdown | ||
{% uml %} | ||
@startuml | ||
object Hello | ||
object World | ||
Hello --> World | ||
@enduml | ||
{% enduml %} | ||
``` | ||
[shield-travis]: https://img.shields.io/travis/wewei/gitbook-plugin-plantuml-svg.svg | ||
@@ -11,1 +81,9 @@ [travis]: https://travis-ci.org/wewei/gitbook-plugin-plantuml-svg | ||
[coveralls]: https://coveralls.io/github/wewei/gitbook-plugin-plantuml-svg | ||
[shield-npm]: https://img.shields.io/npm/v/gitbook-plugin-plantuml-svg.svg | ||
[npm]: https://www.npmjs.com/package/gitbook-plugin-plantuml-svg | ||
[github-dy93]: https://github.com/dy93 | ||
[github-plugin-plantuml-cloud]: https://github.com/dy93/gitbook-plugin-plantuml-cloud | ||
[plantuml]: http://plantuml.com/ | ||
[graphviz]: http://graphviz.org/ | ||
[bitjourney]: https://github.com/bitjourney/plantuml-service | ||
[plantuml-server]: http://www.plantuml.com/plantuml/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9977
0
89