0.3.0 • Published 11 months ago

@beoe/rehype-plantuml v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@beoe/rehype-plantuml

Rehype plugin to generate plantuml diagrams in place of code fences. This:

```plantuml
Bob->Alice : Hello!
```

will be converted to

<figure class="beoe plantuml">
  <svg>...</svg>
</figure>

which can look like this:

PlantUML installation options

There are several ways how to run PlantUML

  • with public server e.g. https://www.plantuml.com/plantuml/svg/
  • with docker
  • install PlantUML locally e.g. install Java, Graphviz and download copy of plantuml.jar

I don't like any of those options, but for now settled down with the last one.

Usage

You need to install Java and Graphviz in order to use this plugin.

import rehypePlantuml from "@beoe/rehype-plantuml";

const html = await unified()
  .use(remarkParse)
  .use(remarkRehype)
  .use(rehypePlantuml)
  .use(rehypeStringify)
  .process(`markdown`);

It support caching the same way as @beoe/rehype-code-hook does.

0.3.0

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago