# markdown-it-plantuml

> Plugin to create block-level uml diagrams for markdown-it markdown parser

Latest version **1.4.1** (published 2019-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-it-plantuml
pnpm add markdown-it-plantuml
yarn add markdown-it-plantuml
bun add markdown-it-plantuml
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2019-06-05 |
| First published | 2017-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/markdown-it-plantuml) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 62.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 109 |
| Author | Gerardo Munguia |
| Maintainers | gmunguia |
| Keywords | markdown-it-plugin, markdown-it, markdown, uml, plantuml |

## Links

- npm: https://www.npmjs.com/package/markdown-it-plantuml
- Repository: https://github.com/gmunguia/markdown-it-plantuml
- Homepage: https://github.com/gmunguia/markdown-it-plantuml#readme
- Issues: https://github.com/gmunguia/markdown-it-plantuml/issues
- npm.io page: https://npm.io/package/markdown-it-plantuml

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.4.1 (latest) — 2019-06-05
- 1.4.0 — 2019-04-24
- 1.3.0 — 2018-09-27
- 1.2.0 — 2018-07-23
- 1.1.0 — 2018-06-22
- 1.0.0 — 2018-02-24
- 0.3.2 — 2018-02-24
- 0.3.1 — 2017-12-04
- 0.3.0 — 2017-10-31
- 0.2.0 — 2017-10-29
- 0.1.0 — 2017-10-27

## README

# markdown-it-plantuml

[![npm version](https://img.shields.io/npm/v/markdown-it-plantuml.svg)](https://www.npmjs.com/package/markdown-it-plantuml)
[![CircleCI build](https://img.shields.io/circleci/project/github/gmunguia/markdown-it-plantuml.svg)](https://circleci.com/gh/gmunguia/markdown-it-plantuml/tree/master)

> Plugin for creating block-level uml diagrams for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.

With this plugin you can create uml diagrams inside your markdown files:

```markdown
# UML example:

@startuml
Bob -> Alice : hello
@enduml
```

See [plantuml website](https://plantuml.com) for more details.

## Installation

node.js, browser:

```bash
$ npm install markdown-it-plantuml --save
```

## Basic usage

```js
const md = require('markdown-it')()
           .use(require('markdown-it-plantuml'));
```

See [markdown-it repository](https://github.com/markdown-it/markdown-it) for more details.

## Advanced usage

```js
const md = require('markdown-it')()
           .use(require('markdown-it-plantuml'), options);
```

Options:
  - __openMarker__ - optional, defaults to `@startuml`. String to use as oppening delimiter.
  - __closeMarker__ - optional, defaults to `@enduml`. String to use as closing delimiter.
  - __generateSource__ - optional, defaults to using public plant-uml server. Generates the `src` property of the image element.
  - __diagramName__ - optional, defaults to `uml`. Name used by generateSoruce to generate diagram tags like `@startuml`, `@startditaa`, etc.
  - __imageFormat__ - optional, defaults to `svg`. Format used by `generateSource` to generate the `src` of the image element.
  - __render__ - optional, defaults to markdown-it image renderer. Renderer function for opening/closing tokens.
  - __server__ - optional, defaults to `http://www.plantuml.com/plantuml`. Defines the plantuml server used for image generation.

#### Example: using custom URL to serve diagrams

```js
const options = {
  generateSource: function generateSource(umlCode) {
    return `https://your.server/plant-uml/${yourEncodeFunction(umlCode)}`;
  }
}

const md = require('markdown-it')()
           .use(require('markdown-it-plantuml'), options);
```

#### Example: generating ditaa diagrams

```js
const options = {
  openMarker: '@startditaa',
  closeMarker: '@endditaa',
  diagramName: 'ditaa',
  imageFormat: 'png'
}

const md = require('markdown-it')()
           .use(require('markdown-it-plantuml'), options);
```

## License

[MIT](https://github.com/gmunguia/markdown-it-plantuml/blob/master/LICENSE)

---
_Source: https://npm.io/package/markdown-it-plantuml · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
