npm.io
1.1.26 • Published 3h ago

@interrogate/remark-plugin-plantuml

Licence
MIT
Version
1.1.26
Deps
3
Size
24 kB
Vulns
0
Weekly
0
Stars
1

@interrogate/remark-plugin-plantuml

NPM version License: MIT

Process PlantUML diagrams in markdown with Remark.

Quick reference

Installation

npm install @interrogate/remark-plugin-plantuml

What is this?

A Remark plugin that processes PlantUML code blocks in markdown and attaches diagram data as additional properties. It's designed to work with @interrogate/rehype-plugin-plantuml to generate the final HTML output.

When should I use this?

  • When you need to include PlantUML diagrams in your markdown documentation
  • When you're processing PlantUML syntax during the markdown transformation phase
  • When generating documentation with PlantUML diagrams (e.g., in Docusaurus)
  • As part of a complete markdown-to-HTML pipeline using Remark and Rehype

Usage

Basic usage with unified:

import remarkPlantuml from "@interrogate/remark-plugin-plantuml"
import { unified } from "unified"
import remarkParse from "remark-parse"
import remarkRehype from "remark-rehype"

const processor = unified().use(remarkParse).use(remarkPlantuml).use(remarkRehype)
Example: Inline PlantUML
Here's a sequence diagram:

```plantuml
@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi there
@enduml
```

### Example: External PlantUML Files

```markdown
![Sequence Diagram](./path/to/diagram.puml)

API

remarkPlantuml([options])

Transform PlantUML code blocks in markdown and attach diagram data as properties for consumption by rehype plugins. Options documentation coming soon.

License

MIT James Lafferty

Keywords