asciidoctor-diagram 1.5.19 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.adoc +71 -0
- data/README.adoc +66 -20
- data/examples/features.adoc +2 -2
- data/lib/asciidoctor-diagram.rb +5 -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 +374 -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/converter.rb +63 -0
- data/lib/asciidoctor-diagram/gnuplot/extension.rb +6 -62
- 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/converter.rb +54 -0
- data/lib/asciidoctor-diagram/lilypond/extension.rb +6 -53
- 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 +192 -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/converter.rb +44 -0
- data/lib/asciidoctor-diagram/smcat/extension.rb +6 -42
- 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 +75 -0
- data/lib/asciidoctor-diagram/tikz/extension.rb +6 -60
- data/lib/asciidoctor-diagram/umlet/converter.rb +33 -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 +114 -1
- data/lib/asciidoctor-diagram/util/java_socket.rb +8 -120
- 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 -54
- data/lib/ditaa-1.3.15.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 +2 -255
- data/spec/graphviz_spec.rb +6 -145
- data/spec/lilypond_spec.rb +2 -140
- data/spec/mermaid_spec.rb +62 -209
- 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 +603 -0
- data/spec/smcat_spec.rb +2 -140
- 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 -21
- data/spec/tikz_spec.rb +65 -15
- data/spec/umlet_spec.rb +2 -58
- data/spec/vega_spec.rb +4 -117
- data/spec/wavedrom_spec.rb +2 -199
- metadata +58 -8
- data/lib/asciidoctor-diagram/extensions.rb +0 -568
- data/lib/ditaa-1.3.13.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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 682b06be01eb9a3aa29f735c134fe97e813db674f3e7d4a76ae86dcc8241e826
|
4
|
+
data.tar.gz: fdf1252fc4f30c1ec56a64bb1928306f1b73341b81442c233111e1fdf8bbc038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0b928e103aef0f5123cd3a3810c210d28c626493bf536ec7e0ed4363e761df0c2fa23ec8a2a5bbb6c4cc748c2a66d13a846e2d5c06a9b38405d8c7ec0148569
|
7
|
+
data.tar.gz: 1387ead776db0d3df332fb585e99be44eb49245f1b32d8be5275034d0de6e9fb89e1085ca485a6336be9e190119e193d6bdebefe44dcfa51eacb277739ee8a91
|
data/CHANGELOG.adoc
CHANGED
@@ -1,5 +1,76 @@
|
|
1
1
|
= Asciidoctor-diagram Changelog
|
2
2
|
|
3
|
+
== 2.0.5
|
4
|
+
|
5
|
+
Enhancements::
|
6
|
+
|
7
|
+
* Improve internal target path resolution logic
|
8
|
+
* TikZ diagrams can now add content to the LaTeX preamble by setting the `preamble` block attribute to `true`.
|
9
|
+
The preamble and diagram should be separated by a line consisting of `\~~~~`. (@colbyn)
|
10
|
+
* The `scale` attribute is now passed on to Mermaid. (@gustav-b)
|
11
|
+
* Issue #271: Launch UMLet directly using `java` instead of using the UMLet wrapper scripts or executables
|
12
|
+
|
13
|
+
Bug Fixes::
|
14
|
+
|
15
|
+
* Issue #294: Treat the first positional parameter of diagram block macros as the desired output format rather than as the target.
|
16
|
+
|
17
|
+
== 2.0.4
|
18
|
+
|
19
|
+
Enhancements::
|
20
|
+
|
21
|
+
* Issue #110: Added support for an experimental attribute `diagram-autoimagesdir` that sets per image node `imagesdir` values.
|
22
|
+
|
23
|
+
Bug Fixes::
|
24
|
+
|
25
|
+
* Issue #292: A regression in 2.0.3 caused SVG diagrams to get a zero width and height when documents were regenerated.
|
26
|
+
|
27
|
+
== 2.0.3
|
28
|
+
|
29
|
+
Enhancements::
|
30
|
+
|
31
|
+
* Issue #261: Ensure generated SVG diagrams always specify a view box
|
32
|
+
* Issue #284: Add support for HTTP redirect responses when using a rendering server
|
33
|
+
* Issue #290: Add support for Pikchr
|
34
|
+
* Add support for dpic
|
35
|
+
* Add support for Symboloator (@gsmecher)
|
36
|
+
|
37
|
+
Bug Fixes::
|
38
|
+
|
39
|
+
* Issue #247: Fix `svg-type`/`diagram-svg-type`.
|
40
|
+
* Issue #257: Avoid potential hangs when generating Mermaid diagrams
|
41
|
+
|
42
|
+
== 2.0.2
|
43
|
+
|
44
|
+
Enhancements::
|
45
|
+
|
46
|
+
* #260: Update PlantUML to v1.2020.6
|
47
|
+
* #270: Add support for svgbob options (@hackingotter)
|
48
|
+
* #268: Changing diagram attribute values will now also trigger image regeneration
|
49
|
+
* #276: Add support for bytefield-svg
|
50
|
+
|
51
|
+
Bug Fixes::
|
52
|
+
|
53
|
+
* Issue #253: Add support for PlantUML `atxt` and `utxt` output formats
|
54
|
+
* Issue #266: Resolve execution issue when the path for GnuPlot or Vega contains spaces
|
55
|
+
* Issue #267: Use binary mode when reading generated images from stdout
|
56
|
+
* Issue #273: Report Ditaa syntax errors correctly
|
57
|
+
|
58
|
+
== 2.0.1
|
59
|
+
|
60
|
+
Bug Fixes::
|
61
|
+
|
62
|
+
* Issue #254: On Windows generating PlantUML or Ditaa diagrams would cause asciidoctor-diagram to block indefinitely
|
63
|
+
|
64
|
+
== 2.0.0
|
65
|
+
|
66
|
+
Enhancements::
|
67
|
+
* Cleaned up internals of the extension
|
68
|
+
* Add support for BPMN (@gtudan)
|
69
|
+
* Update PlantUML to v1.2019.12
|
70
|
+
* #231 Improve PlantUML error reporting
|
71
|
+
* #247 Add support for document-level `diagram-svg-type` and block-level `svg-type` attributes to control SVG interactivity
|
72
|
+
* #250 Add support for Mermaid's `puppeteerConfig` option (@ldz-w)
|
73
|
+
|
3
74
|
== 1.5.19
|
4
75
|
|
5
76
|
Bug Fixes::
|
data/README.adoc
CHANGED
@@ -18,19 +18,23 @@ 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
|
24
27
|
:uri-gnuplot: http://gnuplot.info
|
25
28
|
:uri-graphviz: https://graphviz.gitlab.io
|
26
29
|
:uri-imagemagick: http://www.imagemagick.org
|
27
30
|
:uri-java: http://java.sun.com
|
28
|
-
:uri-mermaid: https://github.com/
|
31
|
+
:uri-mermaid: https://github.com/mermaid-js/mermaid-cli
|
29
32
|
:uri-mscgen: http://www.mcternan.me.uk/mscgen/
|
30
33
|
:uri-nomnoml: http://nomnoml.com
|
31
34
|
:uri-nwdiag: http://blockdiag.com/en/nwdiag/index.html
|
32
35
|
:uri-packetdiag: http://blockdiag.com/en/nwdiag/index.html
|
33
36
|
:uri-phantomjs: http://phantomjs.org
|
37
|
+
:uri-pikchr: https://pikchr.org
|
34
38
|
:uri-plantuml: http://plantuml.sourceforge.net
|
35
39
|
:uri-py-plantuml: https://code.google.com/p/asciidoc-plantuml/
|
36
40
|
:uri-rackdiag: http://blockdiag.com/en/nwdiag/index.html
|
@@ -38,6 +42,7 @@ ifndef::env-site[:status:]
|
|
38
42
|
:uri-shaape: https://github.com/christiangoltz/shaape
|
39
43
|
:uri-smcat: https://github.com/sverweij/state-machine-cat
|
40
44
|
:uri-svgbob: https://github.com/ivanceras/svgbobrus
|
45
|
+
:uri-symbolator: https://github.com/kevinpt/symbolator
|
41
46
|
:uri-syntrax: https://kevinpt.github.io/syntrax/
|
42
47
|
:uri-umlet: http://www.umlet.com/
|
43
48
|
:uri-vega: https://vega.github.io/vega/
|
@@ -48,7 +53,7 @@ ifndef::env-site[:status:]
|
|
48
53
|
|
49
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.
|
50
55
|
|
51
|
-
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-gnuplot}[Gnuplot], {uri-dot}[GraphViz], {uri-mermaid}[Mermaid], {uri-mscgen}[Msc], {uri-nomnoml}[Nomnoml], {uri-plantuml}[PlantUML], {uri-shaape}[Shaape], {uri-smcat}[State Machine Cat], {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.
|
52
57
|
|
53
58
|
Each extension runs the diagram processor to generate an SVG, PNG, or TXT file from the input text.
|
54
59
|
The generated file is then inserted into your converted document.
|
@@ -121,7 +126,10 @@ The following diagram types and output formats are available:
|
|
121
126
|
|{uri-a2s}[a2s] | | | |{check}|
|
122
127
|
|{uri-actdiag}[actdiag] | |{check}|{check}|{check}|
|
123
128
|
|{uri-blockdiag}[blockdiag] | |{check}|{check}|{check}|
|
129
|
+
|{uri-bpmn}[bpmn] | |{check}|{check}|{check}|
|
130
|
+
|{uri-bytefield}[bytefield] | | | |{check}|
|
124
131
|
|{uri-ditaa}[ditaa] | | |{check}|{check}|
|
132
|
+
|{uri-dpic}[dpic] | | | |{check}|
|
125
133
|
|{uri-erd}[erd] | | |{check}|{check}|
|
126
134
|
|{uri-gnuplot}[gnuplot] |{check}| |{check}|{check}|{check}
|
127
135
|
|{uri-dot}[graphviz] | |{check}|{check}|{check}|
|
@@ -131,12 +139,14 @@ The following diagram types and output formats are available:
|
|
131
139
|
|{uri-nomnoml}[nomnoml] | | | |{check}|
|
132
140
|
|{uri-nwdiag}[nwdiag] | |{check}|{check}|{check}|
|
133
141
|
|{uri-packetdiag}[packetdiag]| |{check}|{check}|{check}|
|
142
|
+
|{uri-pikchr}[pikchr] | | | |{check}|
|
134
143
|
|{uri-plantuml}[plantuml] | | |{check}|{check}|{check}
|
135
144
|
|{uri-rackdiag}[rackdiag] | |{check}|{check}|{check}|
|
136
145
|
|{uri-seqdiag}[seqdiag] | |{check}|{check}|{check}|
|
137
146
|
|{uri-shaape}[shaape] | | |{check}|{check}|
|
138
147
|
|{uri-smcat}[smcat] | | | |{check}|
|
139
148
|
|{uri-svgbob}[svgbob] | | | |{check}|
|
149
|
+
|{uri-symbolator}[symbolator]| |{check}|{check}|{check}|
|
140
150
|
|{uri-syntrax}[syntrax] | |{check}|{check}|{check}|
|
141
151
|
|{uri-umlet}[umlet] |{check}|{check}|{check}|{check}|
|
142
152
|
|{uri-vega}[vega] | | |{check}|{check}|
|
@@ -253,7 +263,7 @@ or load and register each extension individually.
|
|
253
263
|
require 'asciidoctor-diagram/<extension_name>'
|
254
264
|
----
|
255
265
|
|
256
|
-
`<extension_name>` can be one of `a2s`, `blockdiag`, `ditaa`, `erd`, `gnuplot`, `graphviz`, `meme`, `mermaid`, `msc`, `plantuml`, `shaape`, `smcat`, `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`.
|
257
267
|
|
258
268
|
Requiring one or more of these files will automatically register the extensions for all processed documents.
|
259
269
|
|
@@ -299,22 +309,27 @@ The following table lists the tools that are required for each diagram type, the
|
|
299
309
|
|a2s |{uri-a2s}[AsciiToSvg] |`a2s`
|
300
310
|
|actdiag |{uri-actdiag}[ActDiag] |`actdiag`
|
301
311
|
|blockdiag |{uri-blockdiag}[BlockDiag] |`blockdiag`
|
312
|
+
|bpmn |{uri-bpmn}[bpmn-js-cmd] |`bpmn`
|
313
|
+
|bytefield |{uri-bytefield}[bytefield-svg] |`bytefield-svg`
|
302
314
|
|ditaa |{uri-java}[Java] |`java`
|
315
|
+
|dpic |{uri-dpic}[dpic] |`dpic`
|
303
316
|
|erd |{uri-erd}[Erd] |`erd`
|
304
317
|
|gnuplot |{uri-gnuplot}[Gnuplot] |`gnuplot`
|
305
318
|
|graphviz |{uri-graphviz}[GraphViz] |`dot` or `graphvizdot`
|
306
319
|
|meme |{uri-imagemagick}[ImageMagick] |`convert` and `identify`
|
307
|
-
|mermaid |{uri-mermaid}[Mermaid.cli] |`
|
320
|
+
|mermaid |{uri-mermaid}[Mermaid.cli] |`mmdc`
|
308
321
|
|msc |{uri-mscgen}[Mscgen] |`mscgen`
|
309
322
|
|nomnoml |{uri-nomnoml}[Nomnoml] |`nomnoml`
|
310
323
|
|nwdiag |{uri-nwdiag}[NwDiag] |`nwdiag`
|
311
324
|
|packetdiag |{uri-nwdiag}[NwDiag] |`packetdiag`
|
325
|
+
|pikchr |{uri-pikchr}[Pikchr] |`pikchr`
|
312
326
|
|plantuml |{uri-java}[Java] |`java`
|
313
327
|
|rackdiag |{uri-nwdiag}[NwDiag] |`rackdiag`
|
314
328
|
|seqdiag |{uri-seqdiag}[SeqDiag] |`seqdiag`
|
315
329
|
|shaape |{uri-shaape}[Shaape] |`shaape`
|
316
330
|
|smcat |{uri-smcat}[State Machine Cat] |`smcat`
|
317
331
|
|svgbob |{uri-svgbob}[SvgBob] |`svgbob`
|
332
|
+
|symbolator |{uri-symbolator}[Symbolator] |`symbolator`
|
318
333
|
|syntrax |{uri-syntrax}[Syntrax] |`syntrax`
|
319
334
|
|umlet |{uri-umlet}[Umlet] |`umlet`
|
320
335
|
|vega |{uri-vega}[vg2png] and/or {uri-vega}[vg2png] |`vg2png` and `vg2svg`
|
@@ -344,7 +359,7 @@ Occurrences of `//` surrounded by whitespace are interpreted as line breaks.
|
|
344
359
|
=== Diagram Attributes
|
345
360
|
|
346
361
|
Certain diagram types allow image generation to be customized using attributes.
|
347
|
-
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.
|
348
363
|
This is illustrated for the blockdiag `fontpath` attribute in the example below.
|
349
364
|
|
350
365
|
----
|
@@ -359,13 +374,23 @@ This is illustrated for the blockdiag `fontpath` attribute in the example below.
|
|
359
374
|
....
|
360
375
|
....
|
361
376
|
----
|
362
|
-
<1>
|
363
|
-
|
364
|
-
<
|
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.
|
365
382
|
|
366
383
|
Each attribute can either be specified at the block level or at the document level.
|
367
384
|
The attribute name at the block level should be prefixed with the name of the diagram type and a dash.
|
368
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
|
+
|
369
394
|
==== AsciiToSVG
|
370
395
|
|
371
396
|
[cols=">,<,<",options="header"]
|
@@ -383,6 +408,15 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
383
408
|
|fontpath |unspecified |The path to the font that should be used by blockdiag
|
384
409
|
|===
|
385
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
|
+
|
386
420
|
==== Ditaa
|
387
421
|
|
388
422
|
[cols=">,<,<",options="header"]
|
@@ -427,9 +461,9 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
427
461
|
[cols=">,<,<",options="header"]
|
428
462
|
|===
|
429
463
|
|Name |Default value |Description
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
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.
|
433
467
|
|font |Impact |The font face to use for the text.
|
434
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.
|
435
469
|
|===
|
@@ -438,15 +472,16 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
438
472
|
|
439
473
|
[cols=">,<,<",options="header"]
|
440
474
|
|===
|
441
|
-
|Name
|
442
|
-
|background
|
443
|
-
|css
|
444
|
-
|config
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
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.
|
450
485
|
|===
|
451
486
|
|
452
487
|
==== Msc
|
@@ -474,6 +509,17 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
474
509
|
|engine |unspecified |The layout engine to use. One of `dot`, `circo`, `fdp`, `neato`, `osage`, or `twopi`
|
475
510
|
|===
|
476
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
|
+
|
477
523
|
==== Syntrax
|
478
524
|
|
479
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,6 +1,9 @@
|
|
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'
|
5
8
|
require_relative 'asciidoctor-diagram/gnuplot'
|
6
9
|
require_relative 'asciidoctor-diagram/graphviz'
|
@@ -9,11 +12,13 @@ require_relative 'asciidoctor-diagram/meme'
|
|
9
12
|
require_relative 'asciidoctor-diagram/mermaid'
|
10
13
|
require_relative 'asciidoctor-diagram/msc'
|
11
14
|
require_relative 'asciidoctor-diagram/nomnoml'
|
15
|
+
require_relative 'asciidoctor-diagram/pikchr'
|
12
16
|
require_relative 'asciidoctor-diagram/plantuml'
|
13
17
|
require_relative 'asciidoctor-diagram/salt'
|
14
18
|
require_relative 'asciidoctor-diagram/shaape'
|
15
19
|
require_relative 'asciidoctor-diagram/smcat'
|
16
20
|
require_relative 'asciidoctor-diagram/svgbob'
|
21
|
+
require_relative 'asciidoctor-diagram/symbolator'
|
17
22
|
require_relative 'asciidoctor-diagram/syntrax'
|
18
23
|
require_relative 'asciidoctor-diagram/tikz'
|
19
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
|