Installation
Prerequisites
- An Astro project (v3.0 or higher)
- Node.js 18 or higher
Installation
Install the astro-plantuml
package:
npm install astro-plantuml
Or with other package managers:
# yarnyarn add astro-plantuml
# pnpmpnpm add astro-plantuml
Basic Setup
Add the integration to your astro.config.mjs
:
import { defineConfig } from 'astro/config';import plantuml from 'astro-plantuml';
export default defineConfig({ integrations: [plantuml()],});
That’s it! You can now use PlantUML code blocks in your markdown files.
Test Your Installation
Create a markdown file with a PlantUML code block:
# Test Page
Here's a simple diagram:
```plantuml@startumlBob -> Alice : HelloAlice -> Bob : Hi!@enduml
Run your Astro dev server:
```bashnpm run dev
You should see your PlantUML diagram rendered as an image!
Next Steps
- Learn about configuration options
- See more examples
- Set up a custom PlantUML server