metalsmith-plantuml

A Metalsmith plugin to inline PlantUML code blocks as SVG images in Markdown files

Usage no npm install needed!

<script type="module">
  import metalsmithPlantuml from 'https://cdn.skypack.dev/metalsmith-plantuml';
</script>

README

npm version Build Status

metalsmith-plantuml

A Metalsmith plugin that converts PlantUML files to SVG UML diagram.

  1. Converting file with the .plantuml extension to an .svg image file.
  2. converting plantuml code blocks into inline SVG images in Markdown files.
@startuml
A -> B: Hello
@enduml

Installation

$ npm install metalsmith-plantuml

Usage

Create a file withe the .plantuml extension and add the PlantUML markup in it

Metalsmith CLI Usage

Install then add the metalsmith-plantuml key to your metalsmith.json (please remember he order is important, PlantUML must be processed before Markdown)

{
  "plugins": {
    "metalsmith-plantuml": {},
    "metalsmith-markdown": {}
  }
}

Metalsmith Javascript Usage

Create a Metalsmith build file with PlantUML in markdown (please remember he order is important, PlantUML must be processed before Markdown)

const plantuml = require('metalsmith-plantuml');
const markdown = require('metalsmith-markdown');

metalsmith
  .use(plantuml())
  .use(markdown({
    pedantic: false,
    gfm: true,
    tables: true,
    breaks: false,
    sanitize: false,
    smartLists: true,
    smartypants: false,
    xhtml: false
  }));

License

MIT