pandoc2 filter that converts embedded asciiart to nicely rendered graphics
filters codeblocks annotated with ditaa
or plantuml
, shells out to render those
codeblocks (jdk1.8+ needed), caches images in rendered/
subdir, re-renders them only
on change (significant speedup)
- pandoc 2+
- jdk1.8+
- make
make
loads all needed libraries and puts them in the lib/
folder.
pandoc \
README.md \
--lua-filter render-asciiart-filter.lua \
-o README.pdf
the following codeblocks should be rendered as graphics, inspect the generated pdf.
+--------+ +-------+ +-------+
| | --+ ditaa +--> | |
| Text | +-------+ |diagram|
|Document| |!magic!| | a |
| {d}| | | | |
+---+----+ +-------+ +-------+
: ^
| Lots of work |
+-------------------------+
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml