A docker container for pandoc including mermaid and plantuml filters
10K+
Let's assume a file example.md with this content (see http://plantuml.com/ for more info)
This is an example
```plantuml
@startuml
class Car
Driver - Car : drives >
Car *- Wheel : have 4 >
Car -- Person : < owns
@enduml
```
Then, the following command is run to produce a PDF containing the rendering according to PlantUML
docker run -w /foo -v `pwd`:/foo escalope/pandoc-mermaid-plantuml pandoc -s -N example.md -o example.pdf --filter pandoc-plantuml-filter
If you want slides (more formatting ideas in http://rmarkdown.rstudio.com/beamer_presentation_format.html), your example file could have this content:
---
title: Introduction to UML
author: My name here
date: Octubre 2016
fontsize: 12pt
output:
beamer_presentation:
incremental: true
theme: "AnnArbor"
colortheme: "dolphin"
fonttheme: "structurebold"
---
This is an example
```plantuml
@startuml
class Car
Driver - Car : drives >
Car *- Wheel : have 4 >
Car -- Person : < owns
@enduml
```
And run again through pandoc
docker run -w /foo -v `pwd`:/foo escalope/pandoc-mermaid-plantuml pandoc -s -N -V theme:Warsaw example.md -o example.pdf --filter pandoc-plantuml-filter -t beamer
The file may contain mermaid diagrams (see https://knsv.github.io/mermaid/ for more info)
This is an example
```{.mermaid width=2000}
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
```
But, then, you need to run a different filder when using pandoc for slides
docker run -w /foo -v `pwd`:/foo escalope/pandoc-mermaid-plantuml pandoc -s -N -V theme:Warsaw example.md -o example.pdf --filter mermaid-filter -t beamer
or reports
docker run -w /foo -v `pwd`:/foo escalope/pandoc-mermaid-plantuml pandoc -s -N example.md -o example.pdf --filter mermaid-filter
The container has also installed java and a latex full install. Hence, this works too
docker run -w /foo -v `pwd`:/foo escalope/pandoc-mermaid-plantuml pdflatex mylatexfile.tex
Also, if you want to run the PlantUML
docker run -w /foo -v `pwd`:/foo escalope/pandoc-mermaid-plantuml java -jar /opt/plantuml/plantuml.jar example.txt
PlantUML: http://plantuml.com
Mermaid: https://knsv.github.io/mermaid/
PlantUML-pandoc integration: pandoc plantuml filter by https://github.com/stasberkov/pandoc-plantuml-filter
Mermaid-pandoc integration: https://github.com/raghur/mermaid-filter
Content type
Image
Digest
Size
941 MB
Last updated
almost 8 years ago
docker pull escalope/pandoc-mermaid-plantuml