Awesome
Pandoc PlantUML Filter
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
plantuml
inPATH
which launches PlantUML jar (seescripts
folder)pandoc
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
- No tests
- Calls hard-coded
plantuml
which should be inPATH
(on Windows,plantuml.jar
needs to be inC:\Bin
. - Temporary files are generated in
CWD
and not removed. - No tests
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