aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorpacien2018-07-26 11:34:06 +0200
committerpacien2018-07-26 11:34:06 +0200
commit69bc6c2ae35883286d9c2b8cc77d5fa0a8c37351 (patch)
tree26d8635694b9d7f61b77772b29a9c980b632cc2c /readme.md
parent4d80dd03b75421f2fb40cb89f9634be47b09a779 (diff)
downloadpandoc-filter-plantuml-69bc6c2ae35883286d9c2b8cc77d5fa0a8c37351.tar.gz
Kotlin rewrite, adding diagram options
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md35
1 files changed, 26 insertions, 9 deletions
diff --git a/readme.md b/readme.md
index 015e375..c139337 100644
--- a/readme.md
+++ b/readme.md
@@ -3,34 +3,38 @@ pandoc-filter-plantuml
3 3
4A Pandoc AST filter rendering PlantUML code blocks into vector diagrams. 4A Pandoc AST filter rendering PlantUML code blocks into vector diagrams.
5 5
6This filter produces TikZ code that must then be rendered using another filter such as 6This filter produces TikZ code that can be rendered as vector diagrams in PDF documents,
7[tikz.py][tikz]. 7or as raster graphics by using another filter such as [tikz.py][tikz].
8 8
9 9
10Usage 10Example
11----- 11-------
12 12
13A PlantUML diagram in an example Pandoc Markdown file `example.md`: 13A PlantUML diagram in an example Pandoc Markdown file `example.md`:
14 14
15 ```puml 15 ---
16 header-includes: \usepackage{tikz}
17 ---
18
19 ```{.puml .centered caption="Courtesy protocol" width=\columnwidth}
16 @startuml 20 @startuml
17 Bob->Alice : hello 21 Bob->Alice : hello
22 Alice->Bob : hi
18 @enduml 23 @enduml
19 ``` 24 ```
20 25
21Using the helper scripts [tikz.py][tikz] and `pandoc-filter-plantuml.sh`: 26Using the helper scripts `pandoc-filter-plantuml.sh`:
22 27
23 #/bin/sh 28 #/bin/sh
24 java -jar pandoc-filter-plantuml.jar <&0 29 java -jar pandoc-filter-plantuml.jar <&0
25 30
26Can be rendered and included as a vector resource in a PDF by running: 31Can be rendered as a vector resource in a PDF by running:
27 32
28 % pandoc --filter=pandoc-filter-plantuml.sh \ 33 % pandoc --filter=pandoc-filter-plantuml.sh \
29 --filter=tikz.py \
30 --output=example.pdf \ 34 --output=example.pdf \
31 example.md 35 example.md
32 36
33Or as an image in an HTML document with the following command: 37Or as a raster image using [tikz.py][tikz] in an HTML document with the following command:
34 38
35 % pandoc --filter=pandoc-filter-plantuml.sh \ 39 % pandoc --filter=pandoc-filter-plantuml.sh \
36 --filter=tikz.py \ 40 --filter=tikz.py \
@@ -38,6 +42,18 @@ Or as an image in an HTML document with the following command:
38 example.md 42 example.md
39 43
40 44
45Options
46-------
47
48The following rendering options can be supplied as [fenced code attributes][fenced_code_attribute]:
49
50* `.centered`: centers the diagram horizontally on the page
51* `caption="Some caption"`: adds a figure caption below the diagram
52* `label="somelabel`: adds a label to the figure
53* `width=\columnwidth` and `height=100pt`: resize the diagram using the `\resizebox` command,
54 keeping the aspect ration of only one of the two is given
55
56
41Build 57Build
42----- 58-----
43 59
@@ -54,3 +70,4 @@ See /license.txt
54 70
55 71
56[tikz]: https://github.com/jgm/pandocfilters/blob/master/examples/tikz.py 72[tikz]: https://github.com/jgm/pandocfilters/blob/master/examples/tikz.py
73[fenced_code_attribute]: http://pandoc.org/MANUAL.html#fenced-code-blocks