Home

Awesome

Pandoc PlantUML Filter

Travis build status

Filter for pandoc that replaces CodeBlocks with a plantuml class with PlantUML generated UML diagrams.

This allows you to use code blocks in your documents containing PlantUML DSL which will be replaced by actual UML diagrams after coversion using pandoc and this filter.

This is a work in progress.

Example

This is an example .pdf generated of this document using the command found below in Usage.

Requirements

Install

From package repository (Ubuntu PPA)

add-apt-repository ppa:kbonne/pandoc-plantuml-filter
apt-get update
apt-get install pandoc-plantuml-filter

From Source (with Stack)

git clone https://github.com/jodonoghue/pandoc-plantuml-filter.git
cd pandoc-plantuml-filter/
stack install

From Source (with Cabal)

git clone https://github.com/jodonoghue/pandoc-plantuml-filter.git
cd pandoc-plantuml-filter/
cabal install

Usage

e.g. Generating .pdf from this file

pandoc README.md --variable=geometry:a4paper,margin=2cm \
--variable=fontsize:11pt -o README.pdf --filter pandoc-plantuml-filter

Limitations

Tests

Javascript

Should left as-is

var s = "JavaScript syntax highlighting";
alert(s);

PlantUML

Should be processed!

@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml

This one as well

@startuml
class Car

Driver - Car : drives >
Car *- Wheel : have 4 >
Car -- Person : < owns

@enduml