asciidoctor-diagram 1.5.18 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +75 -0
- data/README.adoc +98 -23
- data/examples/features.adoc +2 -2
- data/lib/asciidoctor-diagram.rb +8 -0
- data/lib/asciidoctor-diagram/a2s/converter.rb +59 -0
- data/lib/asciidoctor-diagram/a2s/extension.rb +6 -52
- data/lib/asciidoctor-diagram/blockdiag/converter.rb +37 -0
- data/lib/asciidoctor-diagram/blockdiag/extension.rb +9 -116
- data/lib/asciidoctor-diagram/bpmn.rb +7 -0
- data/lib/asciidoctor-diagram/bpmn/converter.rb +62 -0
- data/lib/asciidoctor-diagram/bpmn/extension.rb +14 -0
- data/lib/asciidoctor-diagram/bytefield.rb +7 -0
- data/lib/asciidoctor-diagram/bytefield/converter.rb +26 -0
- data/lib/asciidoctor-diagram/bytefield/extension.rb +14 -0
- data/lib/asciidoctor-diagram/diagram_converter.rb +23 -0
- data/lib/asciidoctor-diagram/diagram_processor.rb +357 -0
- data/lib/asciidoctor-diagram/diagram_source.rb +322 -0
- data/lib/asciidoctor-diagram/ditaa/converter.rb +90 -0
- data/lib/asciidoctor-diagram/ditaa/extension.rb +6 -71
- data/lib/asciidoctor-diagram/dpic.rb +7 -0
- data/lib/asciidoctor-diagram/dpic/converter.rb +30 -0
- data/lib/asciidoctor-diagram/dpic/extension.rb +14 -0
- data/lib/asciidoctor-diagram/erd/converter.rb +31 -0
- data/lib/asciidoctor-diagram/erd/extension.rb +6 -35
- data/lib/asciidoctor-diagram/gnuplot.rb +7 -0
- data/lib/asciidoctor-diagram/gnuplot/converter.rb +63 -0
- data/lib/asciidoctor-diagram/gnuplot/extension.rb +14 -0
- data/lib/asciidoctor-diagram/graphviz/converter.rb +32 -0
- data/lib/asciidoctor-diagram/graphviz/extension.rb +6 -35
- data/lib/asciidoctor-diagram/http/converter.rb +99 -0
- data/lib/asciidoctor-diagram/http/server.rb +132 -0
- data/lib/asciidoctor-diagram/lilypond.rb +7 -0
- data/lib/asciidoctor-diagram/lilypond/converter.rb +54 -0
- data/lib/asciidoctor-diagram/lilypond/extension.rb +14 -0
- data/lib/asciidoctor-diagram/meme/converter.rb +122 -0
- data/lib/asciidoctor-diagram/meme/extension.rb +5 -107
- data/lib/asciidoctor-diagram/mermaid/converter.rb +179 -0
- data/lib/asciidoctor-diagram/mermaid/extension.rb +6 -159
- data/lib/asciidoctor-diagram/msc/converter.rb +35 -0
- data/lib/asciidoctor-diagram/msc/extension.rb +6 -36
- data/lib/asciidoctor-diagram/nomnoml/converter.rb +25 -0
- data/lib/asciidoctor-diagram/nomnoml/extension.rb +6 -28
- data/lib/asciidoctor-diagram/pikchr.rb +7 -0
- data/lib/asciidoctor-diagram/pikchr/converter.rb +26 -0
- data/lib/asciidoctor-diagram/pikchr/extension.rb +14 -0
- data/lib/asciidoctor-diagram/plantuml/converter.rb +117 -0
- data/lib/asciidoctor-diagram/plantuml/extension.rb +10 -119
- data/lib/asciidoctor-diagram/shaape/converter.rb +25 -0
- data/lib/asciidoctor-diagram/shaape/extension.rb +6 -28
- data/lib/asciidoctor-diagram/smcat.rb +7 -0
- data/lib/asciidoctor-diagram/smcat/converter.rb +44 -0
- data/lib/asciidoctor-diagram/smcat/extension.rb +14 -0
- data/lib/asciidoctor-diagram/svgbob/converter.rb +49 -0
- data/lib/asciidoctor-diagram/svgbob/extension.rb +6 -28
- data/lib/asciidoctor-diagram/symbolator.rb +7 -0
- data/lib/asciidoctor-diagram/symbolator/converter.rb +23 -0
- data/lib/asciidoctor-diagram/symbolator/extension.rb +14 -0
- data/lib/asciidoctor-diagram/syntrax/converter.rb +58 -0
- data/lib/asciidoctor-diagram/syntrax/extension.rb +6 -51
- data/lib/asciidoctor-diagram/tikz/converter.rb +56 -0
- data/lib/asciidoctor-diagram/tikz/extension.rb +6 -60
- data/lib/asciidoctor-diagram/umlet/converter.rb +24 -0
- data/lib/asciidoctor-diagram/umlet/extension.rb +6 -28
- data/lib/asciidoctor-diagram/util/cli.rb +14 -3
- data/lib/asciidoctor-diagram/util/cli_generator.rb +19 -1
- data/lib/asciidoctor-diagram/util/gif.rb +2 -2
- data/lib/asciidoctor-diagram/util/java.rb +1 -1
- data/lib/asciidoctor-diagram/util/java_socket.rb +7 -9
- data/lib/asciidoctor-diagram/util/pdf.rb +2 -2
- data/lib/asciidoctor-diagram/util/png.rb +2 -2
- data/lib/asciidoctor-diagram/util/svg.rb +46 -19
- data/lib/asciidoctor-diagram/util/which.rb +0 -29
- data/lib/asciidoctor-diagram/vega/converter.rb +47 -0
- data/lib/asciidoctor-diagram/vega/extension.rb +6 -44
- data/lib/asciidoctor-diagram/version.rb +1 -1
- data/lib/asciidoctor-diagram/wavedrom/converter.rb +50 -0
- data/lib/asciidoctor-diagram/wavedrom/extension.rb +6 -46
- data/lib/ditaa-1.3.15.jar +0 -0
- data/lib/ditaamini-0.12.jar +0 -0
- data/lib/plantuml-1.3.15.jar +0 -0
- data/lib/plantuml.jar +0 -0
- data/lib/server-1.3.15.jar +0 -0
- data/spec/a2s_spec.rb +2 -140
- data/spec/blockdiag_spec.rb +2 -200
- data/spec/bpmn_spec.rb +56 -0
- data/spec/bytefield_spec.rb +92 -0
- data/spec/ditaa_spec.rb +37 -143
- data/spec/dpic_spec.rb +19 -0
- data/spec/erd_spec.rb +2 -199
- data/spec/gnuplot_spec.rb +225 -0
- data/spec/graphviz_spec.rb +6 -145
- data/spec/lilypond_spec.rb +13 -0
- data/spec/mermaid_spec.rb +35 -200
- data/spec/msc_spec.rb +2 -199
- data/spec/nomnoml_spec.rb +4 -142
- data/spec/pikchr_spec.rb +51 -0
- data/spec/plantuml_spec.rb +24 -507
- data/spec/shaape_spec.rb +9 -221
- data/spec/shared_examples.rb +552 -0
- data/spec/smcat_spec.rb +26 -0
- data/spec/svgbob_spec.rb +2 -140
- data/spec/symbolator_spec.rb +23 -0
- data/spec/syntrax_spec.rb +5 -215
- data/spec/test_helper.rb +1 -18
- data/spec/tikz_spec.rb +4 -24
- data/spec/umlet_spec.rb +2 -58
- data/spec/vega_spec.rb +4 -117
- data/spec/wavedrom_spec.rb +2 -199
- metadata +73 -11
- data/lib/asciidoctor-diagram/extensions.rb +0 -568
- data/lib/ditaa-1.3.13.jar +0 -0
- data/lib/ditaamini-0.11.jar +0 -0
- data/lib/plantuml-1.3.13.jar +0 -0
- data/lib/server-1.3.13.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6929d068c82dc319a53dbcbc30da263e8356923fe2f92e6c4794f166c61b0252
|
4
|
+
data.tar.gz: 15b20dbe24d572cf174114d3e7cfa6146aa8bb7d46403de6c08284f6819d6e15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04bec237f4f0529bd12324a1794bb0cd863a82ec27b867572e0f14ff93dbbce4e1e553e48f43fe04fbf1c31cf9af6eaab4e5b7933fb6b820988eade9031653d4
|
7
|
+
data.tar.gz: 392c0d5e97b6527bb21019f146732a8028681362c5dc19c8c572b2dc06a2c1f528a06d9d3236e292c8166f9acca3be1892bcb35eb0591a3e1c4a40ce10ff9e06
|
data/CHANGELOG.adoc
CHANGED
@@ -1,5 +1,80 @@
|
|
1
1
|
= Asciidoctor-diagram Changelog
|
2
2
|
|
3
|
+
== 2.0.4
|
4
|
+
|
5
|
+
Enhancements::
|
6
|
+
|
7
|
+
* Issue #110: Added support for an experimental attribute `diagram-autoimagesdir` that sets per image node `imagesdir` values.
|
8
|
+
|
9
|
+
Bug Fixes::
|
10
|
+
|
11
|
+
* Issue #292: A regression in 2.0.3 caused SVG diagrams to get a zero width and height when documents were regenerated.
|
12
|
+
|
13
|
+
== 2.0.3
|
14
|
+
|
15
|
+
Enhancements::
|
16
|
+
|
17
|
+
* Issue #261: Ensure generated SVG diagrams always specify a view box
|
18
|
+
* Issue #284: Add support for HTTP redirect responses when using a rendering server
|
19
|
+
* Issue #290: Add support for Pikchr
|
20
|
+
* Add support for dpic
|
21
|
+
* Add support for Symboloator (@gsmecher)
|
22
|
+
|
23
|
+
Bug Fixes::
|
24
|
+
|
25
|
+
* Issue #247: Fix `svg-type`/`diagram-svg-type`.
|
26
|
+
* Issue #257: Avoid potential hangs when generating Mermaid diagrams
|
27
|
+
|
28
|
+
== 2.0.2
|
29
|
+
|
30
|
+
Enhancements::
|
31
|
+
|
32
|
+
* #260: Update PlantUML to v1.2020.6
|
33
|
+
* #270: Add support for svgbob options (@hackingotter)
|
34
|
+
* #268: Changing diagram attribute values will now also trigger image regeneration
|
35
|
+
* #276: Add support for bytefield-svg
|
36
|
+
|
37
|
+
Bug Fixes::
|
38
|
+
|
39
|
+
* Issue #253: Add support for PlantUML `atxt` and `utxt` output formats
|
40
|
+
* Issue #266: Resolve execution issue when the path for GnuPlot or Vega contains spaces
|
41
|
+
* Issue #267: Use binary mode when reading generated images from stdout
|
42
|
+
* Issue #273: Report Ditaa syntax errors correctly
|
43
|
+
|
44
|
+
== 2.0.1
|
45
|
+
|
46
|
+
Bug Fixes::
|
47
|
+
|
48
|
+
* Issue #254: On Windows generating PlantUML or Ditaa diagrams would cause asciidoctor-diagram to block indefinitely
|
49
|
+
|
50
|
+
== 2.0.0
|
51
|
+
|
52
|
+
Enhancements::
|
53
|
+
* Cleaned up internals of the extension
|
54
|
+
* Add support for BPMN (@gtudan)
|
55
|
+
* Update PlantUML to v1.2019.12
|
56
|
+
* #231 Improve PlantUML error reporting
|
57
|
+
* #247 Add support for document-level `diagram-svg-type` and block-level `svg-type` attributes to control SVG interactivity
|
58
|
+
* #250 Add support for Mermaid's `puppeteerConfig` option (@ldz-w)
|
59
|
+
|
60
|
+
== 1.5.19
|
61
|
+
|
62
|
+
Bug Fixes::
|
63
|
+
* Issue #233: Resolve character encoding issues with Ditaa on Windows with Java runtimes that do not use UTF-8 encoding by default
|
64
|
+
* Fix generation of SVG output for TikZ diagrams (@joelsmith)
|
65
|
+
* Improve TikZ image cropping (@joelsmith)
|
66
|
+
|
67
|
+
Enhancements::
|
68
|
+
* Issue #225: Add support for WaveDrom CLI 2.0.0
|
69
|
+
* Issue #234: Add support for State Machine Cat
|
70
|
+
* Add support for gnuplot (@MariuszCwikla)
|
71
|
+
|
72
|
+
== 1.5.18
|
73
|
+
|
74
|
+
Bug Fixes::
|
75
|
+
|
76
|
+
* Issue #224: Fix asciidoctor 1.5.x compatibility regression introduced in 1.5.17
|
77
|
+
|
3
78
|
== 1.5.17
|
4
79
|
|
5
80
|
Enhancements::
|
data/README.adoc
CHANGED
@@ -18,24 +18,31 @@ ifndef::env-site[:status:]
|
|
18
18
|
:uri-asciidoctor-api: http://asciidoctor.org/docs/user-manual/#api
|
19
19
|
:uri-asciidoctor-extensions: http://asciidoctor.org/docs/user-manual/#extension-points
|
20
20
|
:uri-blockdiag: http://blockdiag.com
|
21
|
+
:uri-bpmn: https://github.com/gtudan/bpmn-js-cmd
|
22
|
+
:uri-bytefield: https://github.com/Deep-Symmetry/bytefield-svg
|
21
23
|
:uri-ditaa: http://ditaa.sourceforge.net/
|
24
|
+
:uri-dpic: https://gitlab.com/aplevich/dpic
|
22
25
|
:uri-dot: https://graphviz.gitlab.io/_pages/doc/info/lang.html
|
23
26
|
:uri-erd: https://github.com/BurntSushi/erd
|
27
|
+
:uri-gnuplot: http://gnuplot.info
|
24
28
|
:uri-graphviz: https://graphviz.gitlab.io
|
25
29
|
:uri-imagemagick: http://www.imagemagick.org
|
26
30
|
:uri-java: http://java.sun.com
|
27
|
-
:uri-mermaid: https://github.com/
|
31
|
+
:uri-mermaid: https://github.com/mermaid-js/mermaid-cli
|
28
32
|
:uri-mscgen: http://www.mcternan.me.uk/mscgen/
|
29
33
|
:uri-nomnoml: http://nomnoml.com
|
30
34
|
:uri-nwdiag: http://blockdiag.com/en/nwdiag/index.html
|
31
35
|
:uri-packetdiag: http://blockdiag.com/en/nwdiag/index.html
|
32
36
|
:uri-phantomjs: http://phantomjs.org
|
37
|
+
:uri-pikchr: https://pikchr.org
|
33
38
|
:uri-plantuml: http://plantuml.sourceforge.net
|
34
39
|
:uri-py-plantuml: https://code.google.com/p/asciidoc-plantuml/
|
35
40
|
:uri-rackdiag: http://blockdiag.com/en/nwdiag/index.html
|
36
41
|
:uri-seqdiag: http://blockdiag.com/en/seqdiag/index.html
|
37
42
|
:uri-shaape: https://github.com/christiangoltz/shaape
|
43
|
+
:uri-smcat: https://github.com/sverweij/state-machine-cat
|
38
44
|
:uri-svgbob: https://github.com/ivanceras/svgbobrus
|
45
|
+
:uri-symbolator: https://github.com/kevinpt/symbolator
|
39
46
|
:uri-syntrax: https://kevinpt.github.io/syntrax/
|
40
47
|
:uri-umlet: http://www.umlet.com/
|
41
48
|
:uri-vega: https://vega.github.io/vega/
|
@@ -46,7 +53,7 @@ ifndef::env-site[:status:]
|
|
46
53
|
|
47
54
|
Asciidoctor Diagram is a set of Asciidoctor extensions that enable you to add diagrams, which you describe using plain text, to your AsciiDoc document.
|
48
55
|
|
49
|
-
The extensions supports the {uri-a2s}[AsciiToSVG], BlockDiag ({uri-blockdiag}[BlockDiag], {uri-seqdiag}[SeqDiag], {uri-actdiag}[ActDiag], {uri-nwdiag}[NwDiag]), {uri-ditaa}[Ditaa], {uri-erd}[Erd], {uri-dot}[GraphViz], {uri-mermaid}[Mermaid], {uri-mscgen}[Msc], {uri-nomnoml}[Nomnoml], {uri-plantuml}[PlantUML], {uri-shaape}[Shaape], {uri-svgbob}[SvgBob], {uri-syntrax}[Syntrax], {uri-umlet}[UMLet], {uri-vega}[Vega], {uri-vegalite}[Vega-Lite] and {uri-wavedrom}[WaveDrom] syntax.
|
56
|
+
The extensions supports the {uri-a2s}[AsciiToSVG], BlockDiag ({uri-blockdiag}[BlockDiag], {uri-seqdiag}[SeqDiag], {uri-actdiag}[ActDiag], {uri-nwdiag}[NwDiag]), {uri-bytefield}[Bytefield-SVG], {uri-ditaa}[Ditaa], {uri-dpic}[dpic], {uri-erd}[Erd], {uri-gnuplot}[Gnuplot], {uri-dot}[GraphViz], {uri-mermaid}[Mermaid], {uri-mscgen}[Msc], {uri-nomnoml}[Nomnoml], {uri-pikchr}[Pikchr], {uri-plantuml}[PlantUML], {uri-shaape}[Shaape], {uri-smcat}[State Machine Cat], {uri-svgbob}[SvgBob], {uri-symbolator}[Symbolator], {uri-syntrax}[Syntrax], {uri-umlet}[UMLet], {uri-vega}[Vega], {uri-vegalite}[Vega-Lite] and {uri-wavedrom}[WaveDrom] syntax.
|
50
57
|
|
51
58
|
Each extension runs the diagram processor to generate an SVG, PNG, or TXT file from the input text.
|
52
59
|
The generated file is then inserted into your converted document.
|
@@ -119,8 +126,12 @@ The following diagram types and output formats are available:
|
|
119
126
|
|{uri-a2s}[a2s] | | | |{check}|
|
120
127
|
|{uri-actdiag}[actdiag] | |{check}|{check}|{check}|
|
121
128
|
|{uri-blockdiag}[blockdiag] | |{check}|{check}|{check}|
|
129
|
+
|{uri-bpmn}[bpmn] | |{check}|{check}|{check}|
|
130
|
+
|{uri-bytefield}[bytefield] | | | |{check}|
|
122
131
|
|{uri-ditaa}[ditaa] | | |{check}|{check}|
|
132
|
+
|{uri-dpic}[dpic] | | | |{check}|
|
123
133
|
|{uri-erd}[erd] | | |{check}|{check}|
|
134
|
+
|{uri-gnuplot}[gnuplot] |{check}| |{check}|{check}|{check}
|
124
135
|
|{uri-dot}[graphviz] | |{check}|{check}|{check}|
|
125
136
|
|<<meme,meme>> |{check}| |{check}| |
|
126
137
|
|{uri-mermaid}[mermaid] | |{check}|{check}|{check}|
|
@@ -128,11 +139,14 @@ The following diagram types and output formats are available:
|
|
128
139
|
|{uri-nomnoml}[nomnoml] | | | |{check}|
|
129
140
|
|{uri-nwdiag}[nwdiag] | |{check}|{check}|{check}|
|
130
141
|
|{uri-packetdiag}[packetdiag]| |{check}|{check}|{check}|
|
142
|
+
|{uri-pikchr}[pikchr] | | | |{check}|
|
131
143
|
|{uri-plantuml}[plantuml] | | |{check}|{check}|{check}
|
132
144
|
|{uri-rackdiag}[rackdiag] | |{check}|{check}|{check}|
|
133
145
|
|{uri-seqdiag}[seqdiag] | |{check}|{check}|{check}|
|
134
146
|
|{uri-shaape}[shaape] | | |{check}|{check}|
|
147
|
+
|{uri-smcat}[smcat] | | | |{check}|
|
135
148
|
|{uri-svgbob}[svgbob] | | | |{check}|
|
149
|
+
|{uri-symbolator}[symbolator]| |{check}|{check}|{check}|
|
136
150
|
|{uri-syntrax}[syntrax] | |{check}|{check}|{check}|
|
137
151
|
|{uri-umlet}[umlet] |{check}|{check}|{check}|{check}|
|
138
152
|
|{uri-vega}[vega] | | |{check}|{check}|
|
@@ -249,7 +263,7 @@ or load and register each extension individually.
|
|
249
263
|
require 'asciidoctor-diagram/<extension_name>'
|
250
264
|
----
|
251
265
|
|
252
|
-
`<extension_name>` can be one of `a2s`, `blockdiag`, `ditaa`, `erd`, `graphviz`, `meme`, `mermaid`, `msc`, `plantuml`, `shaape`, `svgbob`, `syntrax`, `umlet`, `vega` or `wavedrom`.
|
266
|
+
`<extension_name>` can be one of `a2s`, `blockdiag`, `bytefield`, `ditaa`, `dpic`, `erd`, `gnuplot`, `graphviz`, `meme`, `mermaid`, `msc`, `pikchr`, `plantuml`, `shaape`, `smcat`, `svgbob`, `syntrax`, `umlet`, `vega` or `wavedrom`.
|
253
267
|
|
254
268
|
Requiring one or more of these files will automatically register the extensions for all processed documents.
|
255
269
|
|
@@ -295,26 +309,33 @@ The following table lists the tools that are required for each diagram type, the
|
|
295
309
|
|a2s |{uri-a2s}[AsciiToSvg] |`a2s`
|
296
310
|
|actdiag |{uri-actdiag}[ActDiag] |`actdiag`
|
297
311
|
|blockdiag |{uri-blockdiag}[BlockDiag] |`blockdiag`
|
312
|
+
|bpmn |{uri-bpmn}[bpmn-js-cmd] |`bpmn`
|
313
|
+
|bytefield |{uri-bytefield}[bytefield-svg] |`bytefield-svg`
|
298
314
|
|ditaa |{uri-java}[Java] |`java`
|
315
|
+
|dpic |{uri-dpic}[dpic] |`dpic`
|
299
316
|
|erd |{uri-erd}[Erd] |`erd`
|
317
|
+
|gnuplot |{uri-gnuplot}[Gnuplot] |`gnuplot`
|
300
318
|
|graphviz |{uri-graphviz}[GraphViz] |`dot` or `graphvizdot`
|
301
319
|
|meme |{uri-imagemagick}[ImageMagick] |`convert` and `identify`
|
302
|
-
|mermaid |{uri-mermaid}[Mermaid.cli] |`
|
320
|
+
|mermaid |{uri-mermaid}[Mermaid.cli] |`mmdc`
|
303
321
|
|msc |{uri-mscgen}[Mscgen] |`mscgen`
|
304
322
|
|nomnoml |{uri-nomnoml}[Nomnoml] |`nomnoml`
|
305
323
|
|nwdiag |{uri-nwdiag}[NwDiag] |`nwdiag`
|
306
324
|
|packetdiag |{uri-nwdiag}[NwDiag] |`packetdiag`
|
325
|
+
|pikchr |{uri-pikchr}[Pikchr] |`pikchr`
|
307
326
|
|plantuml |{uri-java}[Java] |`java`
|
308
327
|
|rackdiag |{uri-nwdiag}[NwDiag] |`rackdiag`
|
309
328
|
|seqdiag |{uri-seqdiag}[SeqDiag] |`seqdiag`
|
310
329
|
|shaape |{uri-shaape}[Shaape] |`shaape`
|
330
|
+
|smcat |{uri-smcat}[State Machine Cat] |`smcat`
|
311
331
|
|svgbob |{uri-svgbob}[SvgBob] |`svgbob`
|
332
|
+
|symbolator |{uri-symbolator}[Symbolator] |`symbolator`
|
312
333
|
|syntrax |{uri-syntrax}[Syntrax] |`syntrax`
|
313
334
|
|umlet |{uri-umlet}[Umlet] |`umlet`
|
314
335
|
|vega |{uri-vega}[vg2png] and/or {uri-vega}[vg2png] |`vg2png` and `vg2svg`
|
315
336
|
|vegalite |{uri-vegalite}[vl2vg] and {uri-vega}[vg2png] and/or {uri-vega}[vg2svg]|`vl2vg`, `vg2png` and `vg2svg`
|
316
337
|
.2+|wavedrom |{uri-wavedromeditor}[WaveDrom Editor] |`wavedrom`
|
317
|
-
|{uri-wavedromcli}[WaveDrom CLI] and {uri-phantomjs}[PhantomJS]
|
338
|
+
|{uri-wavedromcli}[WaveDrom CLI] (and {uri-phantomjs}[PhantomJS] for WaveDrom CLI v1) |`wavedrom` (and `phantomjs`)
|
318
339
|
|===
|
319
340
|
|
320
341
|
If for instance you installed `actdiag` in `/home/me/actdiag/bin` and this path is not included in the `PATH` you can specify its location on the command line
|
@@ -328,17 +349,17 @@ The meme extension provides a basic '`Advice Animal`' style image generator.
|
|
328
349
|
It's usage is easiest to explain with an example.
|
329
350
|
|
330
351
|
----
|
331
|
-
meme::yunoguy.jpg[Doc writers,Y U NO
|
352
|
+
meme::yunoguy.jpg[Doc writers,Y U NO // AsciiDoc]
|
332
353
|
----
|
333
354
|
|
334
355
|
The target of the block macro tells the extension which image to use as background.
|
335
356
|
The first two positional attributes are `top` and `bottom` and are used for the top and bottom label.
|
336
|
-
Occurrences of
|
357
|
+
Occurrences of `//` surrounded by whitespace are interpreted as line breaks.
|
337
358
|
|
338
359
|
=== Diagram Attributes
|
339
360
|
|
340
361
|
Certain diagram types allow image generation to be customized using attributes.
|
341
|
-
Each attribute can be specified
|
362
|
+
Each attribute can be specified per individual diagram block or for all blocks of a given diagram type in a document level.
|
342
363
|
This is illustrated for the blockdiag `fontpath` attribute in the example below.
|
343
364
|
|
344
365
|
----
|
@@ -353,13 +374,23 @@ This is illustrated for the blockdiag `fontpath` attribute in the example below.
|
|
353
374
|
....
|
354
375
|
....
|
355
376
|
----
|
356
|
-
<1>
|
357
|
-
|
358
|
-
<
|
377
|
+
<1> Attributes can be specified for all diagram of a certain type at the document level by prefixing them with `<blocktype>-`.
|
378
|
+
In this example, the `fontpath` attribute is specified for all diagrams of type `blockdiag`.
|
379
|
+
<2> The first diagram does not specify an explicit value for `fontpath` so the global `blockdiag-fontpath` value will be used
|
380
|
+
<3> The second diagram does specifie a `fontpath` value.
|
381
|
+
This overrides the global `blockdiag-fontpath` value.
|
359
382
|
|
360
383
|
Each attribute can either be specified at the block level or at the document level.
|
361
384
|
The attribute name at the block level should be prefixed with the name of the diagram type and a dash.
|
362
385
|
|
386
|
+
==== Shared Attributes
|
387
|
+
|
388
|
+
[cols=">,<,<",options="header"]
|
389
|
+
|===
|
390
|
+
|Name |Default value |Description
|
391
|
+
|svg-type |unspecified |One of `static`, `inline` or `interactive`. This determines the style of SVG embedding that's used in certain backends. The https://asciidoctor.org/docs/user-manual/#taming-svgs[asciidoctor user guide] describes this in more detail.
|
392
|
+
|===
|
393
|
+
|
363
394
|
==== AsciiToSVG
|
364
395
|
|
365
396
|
[cols=">,<,<",options="header"]
|
@@ -377,6 +408,15 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
377
408
|
|fontpath |unspecified |The path to the font that should be used by blockdiag
|
378
409
|
|===
|
379
410
|
|
411
|
+
==== BPMN
|
412
|
+
|
413
|
+
[cols=">,<,<",options="header"]
|
414
|
+
|===
|
415
|
+
|Name |Default value |Description
|
416
|
+
|height |786 |The target height of the diagram. Does not apply for output type `svg`.
|
417
|
+
|width |1024 |The target width of the diagram. Does not apply for output type `svg`.
|
418
|
+
|===
|
419
|
+
|
380
420
|
==== Ditaa
|
381
421
|
|
382
422
|
[cols=">,<,<",options="header"]
|
@@ -394,6 +434,20 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
394
434
|
|transparent |false |Makes the background of the image transparent instead of using the background color.
|
395
435
|
|===
|
396
436
|
|
437
|
+
==== Gnuplot
|
438
|
+
|
439
|
+
[cols=">,<,<",options="header"]
|
440
|
+
|===
|
441
|
+
|Name |Default value |Description
|
442
|
+
|background |unspecified |Background color, e.g. `red`, `#FF0000`. Does not work with `txt`.
|
443
|
+
|height |unspecified |The height of the plot. Must be specified together with `width`.
|
444
|
+
|width |unspecified |The width of the plot. Must be specified together with `height`.
|
445
|
+
|crop |unspecified |Trims blank space from the edges of the completed plot (true/false). Does not work with `svg`, `pdf`.
|
446
|
+
|transparent |unspecified |Generate transparent background (true/false). Does not work with `svg`, `pdf`, `txt`.
|
447
|
+
|font |unspecified |The font face with optional font size to use for the text, e.g. `font="Arial"`, `font="Arial,11"`. Does not work with `txt`.
|
448
|
+
|fontscale |unspecified |Scales all label for given factor. Does not work with `txt`.
|
449
|
+
|===
|
450
|
+
|
397
451
|
==== GraphViz
|
398
452
|
|
399
453
|
[cols=">,<,<",options="header"]
|
@@ -407,9 +461,9 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
407
461
|
[cols=">,<,<",options="header"]
|
408
462
|
|===
|
409
463
|
|Name |Default value |Description
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
464
|
+
|fill-color |white |The fill color for the text.
|
465
|
+
|stroke-color |black |The outline color for the text
|
466
|
+
|stroke-width |2 |The width of the text outline.
|
413
467
|
|font |Impact |The font face to use for the text.
|
414
468
|
|options |unspecified |a comma separate list of flags that modify the image rendering. Currently only `noupcase` is supported which disable upper casing the labels.
|
415
469
|
|===
|
@@ -418,15 +472,16 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
418
472
|
|
419
473
|
[cols=">,<,<",options="header"]
|
420
474
|
|===
|
421
|
-
|Name
|
422
|
-
|background
|
423
|
-
|css
|
424
|
-
|config
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
475
|
+
|Name |Default value |Description
|
476
|
+
|background |FFFFFF |The background colour of the image. The format should be a six-digit hexadecimal number (as in HTML, FF0000 for red). Pass an eight-digit hex to define transparency.
|
477
|
+
|css |unspecified |Path to a CSS file to pass to mermaid.
|
478
|
+
|config |unspecified |Path to a JSON config file to pass to mermaid.
|
479
|
+
|gantt-config |unspecified |Path to a gantt config file to pass to mermaid.
|
480
|
+
|puppeteer-config|unspecified |Path to a puppeteer config file to pass to mermaid.
|
481
|
+
|sequence-config |unspecified |Path to a sequence config file to pass to mermaid.
|
482
|
+
|theme |unspecified |Theme of the chart, could be default, forest, dark or neutral.
|
483
|
+
|width |unspecified |Width of the page.
|
484
|
+
|height |unspecified |Height of the page.
|
430
485
|
|===
|
431
486
|
|
432
487
|
==== Msc
|
@@ -445,6 +500,26 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
445
500
|
|config |unspecified |Path to a config file to pass to PlantUML.
|
446
501
|
|===
|
447
502
|
|
503
|
+
==== State Machine Cat
|
504
|
+
|
505
|
+
[cols=">,<,<",options="header"]
|
506
|
+
|===
|
507
|
+
|Name |Default value |Description
|
508
|
+
|direction |unspecifed |The direction of the state machine diagram. One of `top-down`, `bottom-top`, `left-right` or `right-left`.
|
509
|
+
|engine |unspecified |The layout engine to use. One of `dot`, `circo`, `fdp`, `neato`, `osage`, or `twopi`
|
510
|
+
|===
|
511
|
+
|
512
|
+
==== svgbob
|
513
|
+
|
514
|
+
[cols=">,<,<",options="header"]
|
515
|
+
|===
|
516
|
+
|Name |Default value |Description
|
517
|
+
|font-family |arial |text will be rendered with this font
|
518
|
+
|font-size |14 |text will be rendered with this font size
|
519
|
+
|scale |1 |scale the entire svg (dimensions, font size, stroke width) by this factor
|
520
|
+
|stroke-width |2 |stroke width for all lines
|
521
|
+
|===
|
522
|
+
|
448
523
|
==== Syntrax
|
449
524
|
|
450
525
|
[cols=">,<,<",options="header"]
|
data/examples/features.adoc
CHANGED
@@ -160,5 +160,5 @@ Instead the name of the generated image is derived from the target propery of th
|
|
160
160
|
The previous example in block macro form would look something like this with the text from the block located in a file called `activity_diagram.txt` instead of inline in the document.
|
161
161
|
|
162
162
|
----
|
163
|
-
plantuml
|
164
|
-
----
|
163
|
+
plantuml::activity_diagram.txt[format="svg", align="center"]
|
164
|
+
----
|
data/lib/asciidoctor-diagram.rb
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
require_relative 'asciidoctor-diagram/a2s'
|
2
2
|
require_relative 'asciidoctor-diagram/blockdiag'
|
3
|
+
require_relative 'asciidoctor-diagram/bpmn'
|
4
|
+
require_relative 'asciidoctor-diagram/bytefield'
|
3
5
|
require_relative 'asciidoctor-diagram/ditaa'
|
6
|
+
require_relative 'asciidoctor-diagram/dpic'
|
4
7
|
require_relative 'asciidoctor-diagram/erd'
|
8
|
+
require_relative 'asciidoctor-diagram/gnuplot'
|
5
9
|
require_relative 'asciidoctor-diagram/graphviz'
|
10
|
+
require_relative 'asciidoctor-diagram/lilypond'
|
6
11
|
require_relative 'asciidoctor-diagram/meme'
|
7
12
|
require_relative 'asciidoctor-diagram/mermaid'
|
8
13
|
require_relative 'asciidoctor-diagram/msc'
|
9
14
|
require_relative 'asciidoctor-diagram/nomnoml'
|
15
|
+
require_relative 'asciidoctor-diagram/pikchr'
|
10
16
|
require_relative 'asciidoctor-diagram/plantuml'
|
11
17
|
require_relative 'asciidoctor-diagram/salt'
|
12
18
|
require_relative 'asciidoctor-diagram/shaape'
|
19
|
+
require_relative 'asciidoctor-diagram/smcat'
|
13
20
|
require_relative 'asciidoctor-diagram/svgbob'
|
21
|
+
require_relative 'asciidoctor-diagram/symbolator'
|
14
22
|
require_relative 'asciidoctor-diagram/syntrax'
|
15
23
|
require_relative 'asciidoctor-diagram/tikz'
|
16
24
|
require_relative 'asciidoctor-diagram/umlet'
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require_relative '../diagram_converter'
|
2
|
+
require_relative '../util/cli_generator'
|
3
|
+
require_relative '../util/platform'
|
4
|
+
|
5
|
+
module Asciidoctor
|
6
|
+
module Diagram
|
7
|
+
# @private
|
8
|
+
class AsciiToSvgConverter
|
9
|
+
include DiagramConverter
|
10
|
+
include CliGenerator
|
11
|
+
|
12
|
+
def supported_formats
|
13
|
+
[:svg]
|
14
|
+
end
|
15
|
+
|
16
|
+
def collect_options(source)
|
17
|
+
options = {}
|
18
|
+
options[:sx] = source.attr('scalex')
|
19
|
+
options[:sy] = source.attr('scaley')
|
20
|
+
options[:scale] = source.attr('scale')
|
21
|
+
options[:noblur] = source.attr('noblur') == 'true'
|
22
|
+
options[:font] = source.attr('fontfamily')
|
23
|
+
options
|
24
|
+
end
|
25
|
+
|
26
|
+
def convert(source, format, options)
|
27
|
+
sx = options[:sx]
|
28
|
+
sy = options[:sy]
|
29
|
+
scale = options[:scale]
|
30
|
+
noblur = options[:noblur]
|
31
|
+
font = options[:font]
|
32
|
+
|
33
|
+
generate_stdin(source.find_command('a2s'), format.to_s, source.to_s) do |tool_path, output_path|
|
34
|
+
args = [tool_path, '-o', Platform.native_path(output_path)]
|
35
|
+
|
36
|
+
if sx && sy
|
37
|
+
args << '-s' << "#{sx},#{sy}"
|
38
|
+
elsif scale
|
39
|
+
args << '-s' << "#{scale},#{scale}"
|
40
|
+
end
|
41
|
+
|
42
|
+
if noblur
|
43
|
+
args << '-b'
|
44
|
+
end
|
45
|
+
|
46
|
+
if font
|
47
|
+
args << '-f' << font
|
48
|
+
end
|
49
|
+
|
50
|
+
args
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def native_scaling?
|
55
|
+
true
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -1,60 +1,14 @@
|
|
1
|
-
require_relative '
|
2
|
-
require_relative '../
|
3
|
-
require_relative '../util/platform'
|
4
|
-
require_relative '../util/which'
|
1
|
+
require_relative 'converter'
|
2
|
+
require_relative '../diagram_processor'
|
5
3
|
|
6
4
|
module Asciidoctor
|
7
5
|
module Diagram
|
8
|
-
|
9
|
-
|
10
|
-
include CliGenerator
|
11
|
-
include Which
|
12
|
-
|
13
|
-
def self.included(mod)
|
14
|
-
[:svg].each do |f|
|
15
|
-
mod.register_format(f, :image) do |parent, source|
|
16
|
-
a2s(parent, source, f)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def a2s(parent, source, format)
|
22
|
-
inherit_prefix = name
|
23
|
-
|
24
|
-
sx = source.attr('scalex', nil, inherit_prefix)
|
25
|
-
sy = source.attr('scaley', nil, inherit_prefix)
|
26
|
-
scale = source.attr('scale', nil, inherit_prefix)
|
27
|
-
noblur = source.attr('noblur', 'false', inherit_prefix) == 'true'
|
28
|
-
font = source.attr('fontfamily', nil, inherit_prefix)
|
29
|
-
|
30
|
-
generate_stdin(which(parent, 'a2s'), format.to_s, source.to_s) do |tool_path, output_path|
|
31
|
-
args = [tool_path, '-o', Platform.native_path(output_path)]
|
32
|
-
|
33
|
-
if sx && sy
|
34
|
-
args << '-s' << "#{sx},#{sy}"
|
35
|
-
elsif scale
|
36
|
-
args << '-s' << "#{scale},#{scale}"
|
37
|
-
end
|
38
|
-
|
39
|
-
if noblur
|
40
|
-
args << '-b'
|
41
|
-
end
|
42
|
-
|
43
|
-
if font
|
44
|
-
args << '-f' << font
|
45
|
-
end
|
46
|
-
|
47
|
-
args
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
class AsciiToSvgBlockProcessor < Extensions::DiagramBlockProcessor
|
53
|
-
include AsciiToSvg
|
6
|
+
class AsciiToSvgBlockProcessor < DiagramBlockProcessor
|
7
|
+
use_converter AsciiToSvgConverter
|
54
8
|
end
|
55
9
|
|
56
|
-
class AsciiToSvgBlockMacroProcessor <
|
57
|
-
|
10
|
+
class AsciiToSvgBlockMacroProcessor < DiagramBlockMacroProcessor
|
11
|
+
use_converter AsciiToSvgConverter
|
58
12
|
end
|
59
13
|
end
|
60
14
|
end
|