asciidoctor-diagram 2.2.3 → 3.0.0

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.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +159 -0
  3. data/README.adoc +17 -13
  4. data/lib/asciidoctor-diagram/a2s/converter.rb +7 -2
  5. data/lib/asciidoctor-diagram/barcode/converter.rb +83 -78
  6. data/lib/asciidoctor-diagram/blockdiag/converter.rb +12 -2
  7. data/lib/asciidoctor-diagram/bpmn/converter.rb +4 -1
  8. data/lib/asciidoctor-diagram/bytefield/converter.rb +4 -1
  9. data/lib/asciidoctor-diagram/d2/converter.rb +57 -0
  10. data/lib/asciidoctor-diagram/d2/extension.rb +18 -0
  11. data/lib/asciidoctor-diagram/d2.rb +8 -0
  12. data/lib/asciidoctor-diagram/dbml/converter.rb +27 -0
  13. data/lib/asciidoctor-diagram/dbml/extension.rb +18 -0
  14. data/lib/asciidoctor-diagram/dbml.rb +8 -0
  15. data/lib/asciidoctor-diagram/diagram_processor.rb +49 -9
  16. data/lib/asciidoctor-diagram/diagram_source.rb +35 -33
  17. data/lib/asciidoctor-diagram/diagrams/converter.rb +4 -1
  18. data/lib/asciidoctor-diagram/ditaa/converter.rb +15 -7
  19. data/lib/asciidoctor-diagram/ditaa/ditaa-2.2.0.jar +0 -0
  20. data/lib/asciidoctor-diagram/dpic/converter.rb +4 -1
  21. data/lib/asciidoctor-diagram/erd/converter.rb +5 -2
  22. data/lib/asciidoctor-diagram/gnuplot/converter.rb +7 -1
  23. data/lib/asciidoctor-diagram/graphviz/converter.rb +4 -1
  24. data/lib/asciidoctor-diagram/graphviz_py/converter.rb +4 -1
  25. data/lib/asciidoctor-diagram/http/converter.rb +16 -7
  26. data/lib/asciidoctor-diagram/http/server.rb +2 -2
  27. data/lib/asciidoctor-diagram/lilypond/converter.rb +3 -2
  28. data/lib/asciidoctor-diagram/meme/converter.rb +29 -3
  29. data/lib/asciidoctor-diagram/mermaid/converter.rb +4 -2
  30. data/lib/asciidoctor-diagram/msc/converter.rb +6 -2
  31. data/lib/asciidoctor-diagram/nomnoml/converter.rb +4 -1
  32. data/lib/asciidoctor-diagram/penrose/converter.rb +53 -0
  33. data/lib/asciidoctor-diagram/penrose/extension.rb +18 -0
  34. data/lib/asciidoctor-diagram/penrose.rb +8 -0
  35. data/lib/asciidoctor-diagram/pikchr/converter.rb +4 -1
  36. data/lib/asciidoctor-diagram/pintora/converter.rb +60 -0
  37. data/lib/asciidoctor-diagram/pintora/extension.rb +18 -0
  38. data/lib/asciidoctor-diagram/pintora.rb +8 -0
  39. data/lib/asciidoctor-diagram/plantuml/converter.rb +256 -43
  40. data/lib/asciidoctor-diagram/plantuml/plantuml-2.2.4.jar +0 -0
  41. data/lib/asciidoctor-diagram/shaape/converter.rb +4 -1
  42. data/lib/asciidoctor-diagram/smcat/converter.rb +5 -1
  43. data/lib/asciidoctor-diagram/structurizr/converter.rb +69 -0
  44. data/lib/asciidoctor-diagram/structurizr/extension.rb +52 -0
  45. data/lib/asciidoctor-diagram/structurizr/renderers.rb +63 -0
  46. data/lib/asciidoctor-diagram/structurizr/structurizr-2.2.2.jar +0 -0
  47. data/lib/asciidoctor-diagram/structurizr.rb +7 -0
  48. data/lib/asciidoctor-diagram/svgbob/converter.rb +6 -2
  49. data/lib/asciidoctor-diagram/symbolator/converter.rb +4 -1
  50. data/lib/asciidoctor-diagram/syntrax/converter.rb +72 -17
  51. data/lib/asciidoctor-diagram/syntrax/syntrax-2.2.0.jar +0 -0
  52. data/lib/asciidoctor-diagram/tikz/converter.rb +5 -2
  53. data/lib/asciidoctor-diagram/umlet/converter.rb +4 -1
  54. data/lib/asciidoctor-diagram/util/base64.rb +25 -0
  55. data/lib/asciidoctor-diagram/util/cli.rb +11 -3
  56. data/lib/asciidoctor-diagram/util/cli_generator.rb +1 -0
  57. data/lib/asciidoctor-diagram/util/java.rb +15 -7
  58. data/lib/asciidoctor-diagram/util/java_jruby.rb +14 -0
  59. data/lib/asciidoctor-diagram/util/java_socket.rb +4 -0
  60. data/lib/asciidoctor-diagram/util/server-2.2.3.jar +0 -0
  61. data/lib/asciidoctor-diagram/util/svg.rb +5 -3
  62. data/lib/asciidoctor-diagram/vega/converter.rb +5 -3
  63. data/lib/asciidoctor-diagram/version.rb +1 -1
  64. data/lib/asciidoctor-diagram/wavedrom/converter.rb +38 -24
  65. data/lib/asciidoctor-diagram.rb +5 -0
  66. metadata +32 -115
  67. data/Rakefile +0 -9
  68. data/docs/antora.yml +0 -3
  69. data/docs/modules/ROOT/images/asciidoctor-diagram-classes.png +0 -0
  70. data/docs/modules/ROOT/images/asciidoctor-diagram-process.png +0 -0
  71. data/docs/modules/ROOT/pages/index.adoc +0 -21
  72. data/docs/modules/ROOT/partials/advanced.adoc +0 -365
  73. data/docs/modules/ROOT/partials/create_diagram.adoc +0 -134
  74. data/docs/modules/ROOT/partials/generate.adoc +0 -15
  75. data/docs/modules/ROOT/partials/installation.adoc +0 -19
  76. data/docs/modules/ROOT/partials/uris.adoc +0 -41
  77. data/examples/Gemfile +0 -3
  78. data/examples/README.adoc +0 -18
  79. data/examples/design.adoc +0 -78
  80. data/examples/features.adoc +0 -189
  81. data/lib/asciidoctor-diagram/ditaa/ditaa-1.3.21.jar +0 -0
  82. data/lib/asciidoctor-diagram/plantuml/plantuml-1.3.21.jar +0 -0
  83. data/lib/asciidoctor-diagram/util/server-1.3.21.jar +0 -0
  84. data/spec/a2s_spec.rb +0 -33
  85. data/spec/barcode_spec.rb +0 -176
  86. data/spec/blockdiag_spec.rb +0 -20
  87. data/spec/bpmn_spec.rb +0 -60
  88. data/spec/bytefield_spec.rb +0 -96
  89. data/spec/diagrams_spec.rb +0 -27
  90. data/spec/ditaa_spec.rb +0 -191
  91. data/spec/dpic_spec.rb +0 -23
  92. data/spec/erd_spec.rb +0 -96
  93. data/spec/gnuplot_spec.rb +0 -229
  94. data/spec/graphviz_py_spec.rb +0 -33
  95. data/spec/graphviz_spec.rb +0 -24
  96. data/spec/lilypond_spec.rb +0 -17
  97. data/spec/man.jpg +0 -0
  98. data/spec/meme_spec.rb +0 -67
  99. data/spec/mermaid_spec.rb +0 -198
  100. data/spec/msc_spec.rb +0 -37
  101. data/spec/nomnoml_spec.rb +0 -36
  102. data/spec/pikchr_spec.rb +0 -73
  103. data/spec/plantuml_spec.rb +0 -772
  104. data/spec/shaape_spec.rb +0 -20
  105. data/spec/shared_examples.rb +0 -764
  106. data/spec/smcat_spec.rb +0 -30
  107. data/spec/svgbob_spec.rb +0 -33
  108. data/spec/symbolator_spec.rb +0 -27
  109. data/spec/syntrax_spec.rb +0 -22
  110. data/spec/test_helper.rb +0 -113
  111. data/spec/tikz_spec.rb +0 -181
  112. data/spec/umlet_spec.rb +0 -32
  113. data/spec/vega_spec.rb +0 -133
  114. data/spec/wavedrom_spec.rb +0 -21
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-diagram
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pepijn Van Eeckhoudt
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-05-21 00:00:00.000000000 Z
10
+ date: 2025-04-24 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -72,34 +71,6 @@ dependencies:
72
71
  - - "<"
73
72
  - !ruby/object:Gem::Version
74
73
  version: 3.x
75
- - !ruby/object:Gem::Dependency
76
- name: asciidoctor-diagram-ditaamini
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.0'
82
- type: :runtime
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.0'
89
- - !ruby/object:Gem::Dependency
90
- name: asciidoctor-diagram-plantuml
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '1.2021'
96
- type: :runtime
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '1.2021'
103
74
  - !ruby/object:Gem::Dependency
104
75
  name: rexml
105
76
  requirement: !ruby/object:Gem::Requirement
@@ -124,20 +95,6 @@ files:
124
95
  - CHANGELOG.adoc
125
96
  - LICENSE.txt
126
97
  - README.adoc
127
- - Rakefile
128
- - docs/antora.yml
129
- - docs/modules/ROOT/images/asciidoctor-diagram-classes.png
130
- - docs/modules/ROOT/images/asciidoctor-diagram-process.png
131
- - docs/modules/ROOT/pages/index.adoc
132
- - docs/modules/ROOT/partials/advanced.adoc
133
- - docs/modules/ROOT/partials/create_diagram.adoc
134
- - docs/modules/ROOT/partials/generate.adoc
135
- - docs/modules/ROOT/partials/installation.adoc
136
- - docs/modules/ROOT/partials/uris.adoc
137
- - examples/Gemfile
138
- - examples/README.adoc
139
- - examples/design.adoc
140
- - examples/features.adoc
141
98
  - lib/asciidoctor-diagram.rb
142
99
  - lib/asciidoctor-diagram/a2s.rb
143
100
  - lib/asciidoctor-diagram/a2s/converter.rb
@@ -156,6 +113,12 @@ files:
156
113
  - lib/asciidoctor-diagram/bytefield.rb
157
114
  - lib/asciidoctor-diagram/bytefield/converter.rb
158
115
  - lib/asciidoctor-diagram/bytefield/extension.rb
116
+ - lib/asciidoctor-diagram/d2.rb
117
+ - lib/asciidoctor-diagram/d2/converter.rb
118
+ - lib/asciidoctor-diagram/d2/extension.rb
119
+ - lib/asciidoctor-diagram/dbml.rb
120
+ - lib/asciidoctor-diagram/dbml/converter.rb
121
+ - lib/asciidoctor-diagram/dbml/extension.rb
159
122
  - lib/asciidoctor-diagram/diagram_converter.rb
160
123
  - lib/asciidoctor-diagram/diagram_processor.rb
161
124
  - lib/asciidoctor-diagram/diagram_source.rb
@@ -164,7 +127,7 @@ files:
164
127
  - lib/asciidoctor-diagram/diagrams/extension.rb
165
128
  - lib/asciidoctor-diagram/ditaa.rb
166
129
  - lib/asciidoctor-diagram/ditaa/converter.rb
167
- - lib/asciidoctor-diagram/ditaa/ditaa-1.3.21.jar
130
+ - lib/asciidoctor-diagram/ditaa/ditaa-2.2.0.jar
168
131
  - lib/asciidoctor-diagram/ditaa/extension.rb
169
132
  - lib/asciidoctor-diagram/dpic.rb
170
133
  - lib/asciidoctor-diagram/dpic/converter.rb
@@ -198,13 +161,19 @@ files:
198
161
  - lib/asciidoctor-diagram/nomnoml.rb
199
162
  - lib/asciidoctor-diagram/nomnoml/converter.rb
200
163
  - lib/asciidoctor-diagram/nomnoml/extension.rb
164
+ - lib/asciidoctor-diagram/penrose.rb
165
+ - lib/asciidoctor-diagram/penrose/converter.rb
166
+ - lib/asciidoctor-diagram/penrose/extension.rb
201
167
  - lib/asciidoctor-diagram/pikchr.rb
202
168
  - lib/asciidoctor-diagram/pikchr/converter.rb
203
169
  - lib/asciidoctor-diagram/pikchr/extension.rb
170
+ - lib/asciidoctor-diagram/pintora.rb
171
+ - lib/asciidoctor-diagram/pintora/converter.rb
172
+ - lib/asciidoctor-diagram/pintora/extension.rb
204
173
  - lib/asciidoctor-diagram/plantuml.rb
205
174
  - lib/asciidoctor-diagram/plantuml/converter.rb
206
175
  - lib/asciidoctor-diagram/plantuml/extension.rb
207
- - lib/asciidoctor-diagram/plantuml/plantuml-1.3.21.jar
176
+ - lib/asciidoctor-diagram/plantuml/plantuml-2.2.4.jar
208
177
  - lib/asciidoctor-diagram/salt.rb
209
178
  - lib/asciidoctor-diagram/shaape.rb
210
179
  - lib/asciidoctor-diagram/shaape/converter.rb
@@ -212,6 +181,11 @@ files:
212
181
  - lib/asciidoctor-diagram/smcat.rb
213
182
  - lib/asciidoctor-diagram/smcat/converter.rb
214
183
  - lib/asciidoctor-diagram/smcat/extension.rb
184
+ - lib/asciidoctor-diagram/structurizr.rb
185
+ - lib/asciidoctor-diagram/structurizr/converter.rb
186
+ - lib/asciidoctor-diagram/structurizr/extension.rb
187
+ - lib/asciidoctor-diagram/structurizr/renderers.rb
188
+ - lib/asciidoctor-diagram/structurizr/structurizr-2.2.2.jar
215
189
  - lib/asciidoctor-diagram/svgbob.rb
216
190
  - lib/asciidoctor-diagram/svgbob/converter.rb
217
191
  - lib/asciidoctor-diagram/svgbob/extension.rb
@@ -221,12 +195,14 @@ files:
221
195
  - lib/asciidoctor-diagram/syntrax.rb
222
196
  - lib/asciidoctor-diagram/syntrax/converter.rb
223
197
  - lib/asciidoctor-diagram/syntrax/extension.rb
198
+ - lib/asciidoctor-diagram/syntrax/syntrax-2.2.0.jar
224
199
  - lib/asciidoctor-diagram/tikz.rb
225
200
  - lib/asciidoctor-diagram/tikz/converter.rb
226
201
  - lib/asciidoctor-diagram/tikz/extension.rb
227
202
  - lib/asciidoctor-diagram/umlet.rb
228
203
  - lib/asciidoctor-diagram/umlet/converter.rb
229
204
  - lib/asciidoctor-diagram/umlet/extension.rb
205
+ - lib/asciidoctor-diagram/util/base64.rb
230
206
  - lib/asciidoctor-diagram/util/binaryio.rb
231
207
  - lib/asciidoctor-diagram/util/cli.rb
232
208
  - lib/asciidoctor-diagram/util/cli_generator.rb
@@ -237,7 +213,7 @@ files:
237
213
  - lib/asciidoctor-diagram/util/pdf.rb
238
214
  - lib/asciidoctor-diagram/util/platform.rb
239
215
  - lib/asciidoctor-diagram/util/png.rb
240
- - lib/asciidoctor-diagram/util/server-1.3.21.jar
216
+ - lib/asciidoctor-diagram/util/server-2.2.3.jar
241
217
  - lib/asciidoctor-diagram/util/svg.rb
242
218
  - lib/asciidoctor-diagram/util/which.rb
243
219
  - lib/asciidoctor-diagram/vega.rb
@@ -247,42 +223,15 @@ files:
247
223
  - lib/asciidoctor-diagram/wavedrom.rb
248
224
  - lib/asciidoctor-diagram/wavedrom/converter.rb
249
225
  - lib/asciidoctor-diagram/wavedrom/extension.rb
250
- - spec/a2s_spec.rb
251
- - spec/barcode_spec.rb
252
- - spec/blockdiag_spec.rb
253
- - spec/bpmn_spec.rb
254
- - spec/bytefield_spec.rb
255
- - spec/diagrams_spec.rb
256
- - spec/ditaa_spec.rb
257
- - spec/dpic_spec.rb
258
- - spec/erd_spec.rb
259
- - spec/gnuplot_spec.rb
260
- - spec/graphviz_py_spec.rb
261
- - spec/graphviz_spec.rb
262
- - spec/lilypond_spec.rb
263
- - spec/man.jpg
264
- - spec/meme_spec.rb
265
- - spec/mermaid_spec.rb
266
- - spec/msc_spec.rb
267
- - spec/nomnoml_spec.rb
268
- - spec/pikchr_spec.rb
269
- - spec/plantuml_spec.rb
270
- - spec/shaape_spec.rb
271
- - spec/shared_examples.rb
272
- - spec/smcat_spec.rb
273
- - spec/svgbob_spec.rb
274
- - spec/symbolator_spec.rb
275
- - spec/syntrax_spec.rb
276
- - spec/test_helper.rb
277
- - spec/tikz_spec.rb
278
- - spec/umlet_spec.rb
279
- - spec/vega_spec.rb
280
- - spec/wavedrom_spec.rb
281
226
  homepage: https://github.com/asciidoctor/asciidoctor-diagram
282
227
  licenses:
283
228
  - MIT
284
- metadata: {}
285
- post_install_message:
229
+ metadata:
230
+ bug_tracker_uri: https://github.com/asciidoctor/asciidoctor-diagram/issues
231
+ changelog_uri: https://github.com/asciidoctor/asciidoctor-diagram/blob/main/CHANGELOG.adoc
232
+ documentation_uri: https://docs.asciidoctor.org/diagram-extension/latest/
233
+ homepage_uri: https://github.com/asciidoctor/asciidoctor-diagram
234
+ source_code_uri: https://github.com/asciidoctor/asciidoctor-diagram.git
286
235
  rdoc_options: []
287
236
  require_paths:
288
237
  - lib
@@ -297,41 +246,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
246
  - !ruby/object:Gem::Version
298
247
  version: '0'
299
248
  requirements: []
300
- rubygems_version: 3.2.22
301
- signing_key:
249
+ rubygems_version: 3.6.3
302
250
  specification_version: 4
303
251
  summary: A family of Asciidoctor extensions that generate images from a broad range
304
252
  of embedded plain text diagram descriptions, including PlantUML, ditaa, Kroki, and
305
253
  many others.
306
- test_files:
307
- - spec/a2s_spec.rb
308
- - spec/barcode_spec.rb
309
- - spec/blockdiag_spec.rb
310
- - spec/bpmn_spec.rb
311
- - spec/bytefield_spec.rb
312
- - spec/diagrams_spec.rb
313
- - spec/ditaa_spec.rb
314
- - spec/dpic_spec.rb
315
- - spec/erd_spec.rb
316
- - spec/gnuplot_spec.rb
317
- - spec/graphviz_py_spec.rb
318
- - spec/graphviz_spec.rb
319
- - spec/lilypond_spec.rb
320
- - spec/man.jpg
321
- - spec/meme_spec.rb
322
- - spec/mermaid_spec.rb
323
- - spec/msc_spec.rb
324
- - spec/nomnoml_spec.rb
325
- - spec/pikchr_spec.rb
326
- - spec/plantuml_spec.rb
327
- - spec/shaape_spec.rb
328
- - spec/shared_examples.rb
329
- - spec/smcat_spec.rb
330
- - spec/svgbob_spec.rb
331
- - spec/symbolator_spec.rb
332
- - spec/syntrax_spec.rb
333
- - spec/test_helper.rb
334
- - spec/tikz_spec.rb
335
- - spec/umlet_spec.rb
336
- - spec/vega_spec.rb
337
- - spec/wavedrom_spec.rb
254
+ test_files: []
data/Rakefile DELETED
@@ -1,9 +0,0 @@
1
- require 'rubygems/package_task'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:test)
5
-
6
- task :default => :test
7
-
8
- spec = Gem::Specification.load('asciidoctor-diagram.gemspec')
9
- Gem::PackageTask.new(spec) { |task| }
data/docs/antora.yml DELETED
@@ -1,3 +0,0 @@
1
- name: diagram-extension
2
- title: Asciidoctor Diagram
3
- version: '2.2'
@@ -1,21 +0,0 @@
1
- = Asciidoctor Diagram
2
- Pepijn Van_Eeckhoudt <https://github.com/pepijnve[@pepijnve]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- :description: README for the Asciidoctor Diagram extension for Asciidoctor.
4
- include::partial$uris.adoc[]
5
-
6
- Asciidoctor Diagram is a set of Asciidoctor extensions that enable you to add diagrams, which you describe using plain text, to your AsciiDoc document.
7
-
8
- 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-jsyntrax}[JSyntrax], {uri-umlet}[UMLet], {uri-vega}[Vega], {uri-vegalite}[Vega-Lite] and {uri-wavedrom}[WaveDrom] syntax.
9
-
10
- Each extension runs the diagram processor to generate an SVG, PNG, or TXT file from the input text.
11
- The generated file is then inserted into your converted document.
12
-
13
- Asciidoctor Diagram was inspired by the {uri-py-plantuml}[AsciiDoc PlantUML filter].
14
-
15
- include::partial$installation.adoc[]
16
-
17
- include::partial$create_diagram.adoc[]
18
-
19
- include::partial$generate.adoc[]
20
-
21
- include::partial$advanced.adoc[]
@@ -1,365 +0,0 @@
1
- == Advanced Usage
2
-
3
- === Enabling Extensions
4
-
5
- In your program, you can either load and register the entire set of diagram extensions
6
-
7
- [source,ruby]
8
- ----
9
- require 'asciidoctor-diagram'
10
- ----
11
-
12
- or load and register each extension individually.
13
-
14
- [source,ruby]
15
- ----
16
- require 'asciidoctor-diagram/<extension_name>'
17
- ----
18
-
19
- `<extension_name>` can be one of `a2s`, `blockdiag`, `bytefield`, `diagrams`, `ditaa`, `dpic`, `erd`, `gnuplot`, `graphviz`, `meme`, `mermaid`, `msc`, `pikchr`, `plantuml`, `shaape`, `smcat`, `svgbob`, `syntrax`, `umlet`, `vega` or `wavedrom`.
20
-
21
- Requiring one or more of these files will automatically register the extensions for all processed documents.
22
-
23
- If you need more fine grained control over when the extensions are enabled, `asciidoctor-diagram/<extension_name>/extension` can be used instead.
24
- This loads the extensions but does not register it in the Asciidoctor extension registry.
25
- You can then manually register the extensions at the appropriate times using the `Asciidoctor::Extensions` API.
26
-
27
- This document explains the various features of asciidoctor-diagram blocks using ditaa diagrams as an example.
28
-
29
- === Diagram Macros
30
-
31
- The diagram extensions can also be used in inline, or block macro form.
32
-
33
- .Anatomy of a diagram block macro
34
- ----
35
- diagram-type::source-file-name[format=output-format] // <1> <2> <3>
36
- ----
37
- <1> The macro name specifies the diagram syntax that is being used.
38
- <2> The source file name specifies the external file that contains the diagram source code.
39
- <3> The `format` attribute determines the output image format to use. If a format is not specified, the default output format for the chosen diagram type will be used.
40
-
41
- When the source file name is a relative path it is resolved with respect to the location of the document being processed.
42
-
43
- === Image Output Location
44
-
45
- When Asciidoctor Diagram writes images to disk it will go over the following options in order to determine where to write the files.
46
-
47
- . `\{imagesoutdir\}` if the `imagesoutdir` attribute has been specified
48
- . `\{outdir\}/\{imagesdir\}` if the `outdir` attribute has been specified
49
- . `\{to_dir\}/\{imagesdir\}` if the `to_dir` attribute has been specified
50
- . `\{base_dir\}/\{imagesdir\}`
51
-
52
- === Image Cache Location
53
-
54
- The image generation also outputs metadata files that by default are located in `.asciidoctor/diagram`.
55
- To place them in different location, Asciidoctor Diagram checks for (in this order).
56
-
57
- . `\{cachedir\}` attribute is specified in the block header (ie. `[plantuml, png, cachedir=my-cache]`)
58
- . `\{diagram-cachedir\}` if the `diagram-cachedir` attribute has been specified
59
- . `\{outdir\}/\{imagesdir\}`
60
-
61
- === Specifying Diagram Generator Paths
62
-
63
- Asciidoctor Diagram depends on external tools to generates images.
64
- In most cases it will locate these tools automatically for you by looking for specific executables in each directory in the `PATH` environment variable.
65
- In case you've installed a tool in a way where the executable is not in the `PATH`, you can override its location manually using document attributes.
66
- The following table lists the tools that are required for each diagram type, the location where they can be downloaded and the document attribute you can use to override their locations.
67
-
68
- [cols=">,2*<",options="header"]
69
- |===
70
- |Diagram Type |Tool |Attribute
71
- |a2s |{uri-a2s}[AsciiToSvg] |`a2s`
72
- |actdiag |{uri-actdiag}[ActDiag] |`actdiag`
73
- |blockdiag |{uri-blockdiag}[BlockDiag] |`blockdiag`
74
- |bpmn |{uri-bpmn}[bpmn-js-cmd] |`bpmn`
75
- |bytefield |{uri-bytefield}[bytefield-svg] |`bytefield-svg`
76
- |diagrams |{uri-python}[Python] |`diagrams-python`
77
- |ditaa |{uri-java}[Java] |`java`
78
- |dpic |{uri-dpic}[dpic] |`dpic`
79
- |erd |{uri-erd}[Erd] |`erd`
80
- |gnuplot |{uri-gnuplot}[Gnuplot] |`gnuplot`
81
- |graphviz |{uri-graphviz}[GraphViz] |`dot` or `graphvizdot`
82
- |meme |{uri-imagemagick}[ImageMagick] |`convert` and `identify`
83
- |mermaid |{uri-mermaid}[Mermaid.cli] |`mmdc`
84
- |msc |{uri-mscgen}[Mscgen] |`mscgen`
85
- |nomnoml |{uri-nomnoml}[Nomnoml] |`nomnoml`
86
- |nwdiag |{uri-nwdiag}[NwDiag] |`nwdiag`
87
- |packetdiag |{uri-nwdiag}[NwDiag] |`packetdiag`
88
- |pikchr |{uri-pikchr}[Pikchr] |`pikchr`
89
- |plantuml |{uri-java}[Java] |`java`
90
- |rackdiag |{uri-nwdiag}[NwDiag] |`rackdiag`
91
- |seqdiag |{uri-seqdiag}[SeqDiag] |`seqdiag`
92
- |shaape |{uri-shaape}[Shaape] |`shaape`
93
- |smcat |{uri-smcat}[State Machine Cat] |`smcat`
94
- |svgbob |{uri-svgbob}[SvgBob] |`svgbob`
95
- |symbolator |{uri-symbolator}[Symbolator] |`symbolator`
96
- |syntrax |{uri-syntrax}[Syntrax]/{uri-jsyntrax}[JSyntrax] |`syntrax`
97
- |tikz |A TeX distribution that supports {uri-tikz}[TikZ] |`pdflatex` and `pdf2svg`
98
- |umlet |{uri-umlet}[Umlet] |`umlet`
99
- |vega |{uri-vega}[vg2png] and/or {uri-vega}[vg2png] |`vg2png` and `vg2svg`
100
- |vegalite |{uri-vegalite}[vl2vg] and {uri-vega}[vg2png] and/or {uri-vega}[vg2svg]|`vl2vg`, `vg2png` and `vg2svg`
101
- .2+|wavedrom |{uri-wavedromeditor}[WaveDrom Editor] |`wavedrom`
102
- <|{uri-wavedromcli}[WaveDrom CLI] (and {uri-phantomjs}[PhantomJS] for WaveDrom CLI v1) |`wavedrom` (and `phantomjs`)
103
- |===
104
-
105
- 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
106
-
107
- $ asciidoctor -a actdiag=/home/me/actdiag/bin/actdiag -r asciidoctor-diagram sample.adoc
108
-
109
- [[meme]]
110
- === The Meme Extension
111
-
112
- The meme extension provides a basic '`Advice Animal`' style image generator.
113
- It's usage is easiest to explain with an example.
114
-
115
- ----
116
- meme::yunoguy.jpg[Doc writers,Y U NO // AsciiDoc]
117
- ----
118
-
119
- The target of the block macro tells the extension which image to use as background.
120
- The first two positional attributes are `top` and `bottom` and are used for the top and bottom label.
121
- Occurrences of `//` surrounded by whitespace are interpreted as line breaks.
122
-
123
- [[barcode]]
124
- === The Barcode Extension
125
-
126
- The barcode extension provides barcode rendering.
127
- Barcode macros can be specified using blocks, inline macros or block macros using one of the following templates.
128
-
129
- [source, asciidoc]
130
- ------
131
- // Barcode block
132
- [<type>, <attributes>] <1> <2>
133
- ----
134
- <content> <3>
135
- ----
136
-
137
- // Barcode block macro
138
- <type>::<content>[<attributes>]
139
-
140
- // Barcode inline macro
141
- <type>::<content>[<attributes>]
142
- ------
143
- <1> Type barcode type. One of `bookland`, `codabar`, `code25`, `code25iata`, `code25interleaved`, `code39`, `code93`, `code128`, `code128a`, `code128b`, `code128c`, `ean8`, `ean13`, `gs1_128`, `qrcode`, or `upca`.
144
- <2> Barcode attributes (see the <<barcode_attributes>> attributes section)
145
- <3> The content to encode in the barcode
146
-
147
- By default the `content` field of the barcode macros will be interpreted as the barcode content.
148
- This works fine for simple barcodes, but for complex data (e.g., a vCard encoded as a QR code) this is not practical.
149
- If the `external` attribute is set on a barcode macro, the target is interpreted as a file path.
150
- The barcode content will then be obtained by reading the contents of the referenced file.
151
-
152
- === Diagram Attributes
153
-
154
- Certain diagram types allow image generation to be customized using attributes.
155
- Each attribute can be specified per individual diagram block or for all blocks of a given diagram type in a document level.
156
- This is illustrated for the blockdiag `fontpath` attribute in the example below.
157
-
158
- ----
159
- = Asciidoctor Diagram
160
- :blockdiag-fontpath: /path/to/font.ttf <1>
161
-
162
- [blockdiag] <2>
163
- ....
164
- ....
165
-
166
- [blockdiag, fontpath="/path/to/otherfont.ttf"] <3>
167
- ....
168
- ....
169
- ----
170
- <1> Attributes can be specified for all diagram of a certain type at the document level by prefixing them with `<blocktype>-`.
171
- In this example, the `fontpath` attribute is specified for all diagrams of type `blockdiag`.
172
- <2> The first diagram does not specify an explicit value for `fontpath` so the global `blockdiag-fontpath` value will be used
173
- <3> The second diagram does specify a `fontpath` value.
174
- This overrides the global `blockdiag-fontpath` value.
175
-
176
- Each attribute can either be specified at the block level or at the document level.
177
- The attribute name at the document level should be prefixed with the diagram type name and a dash.
178
-
179
- ==== Shared Attributes
180
-
181
- The set of shared attributes applies to all diagram types.
182
- The value for these attributes can be defined at the document level for a single diagram type using the diagram type as prefix or for all diagram types using `diagram` as prefix.
183
-
184
- [cols=">,<,<",options="header"]
185
- |===
186
- |Name |Default value |Description
187
- |svg-type |unspecified |One of `static`, `inline` or `interactive`.
188
- This determines the style of SVG embedding that's used in certain backends.
189
- The xref:asciidoc:macros:image-svg.adoc[asciidoc spec] describes this in more detail.
190
- |server-url |unspecified |External service to render diagram.
191
- Usage removes the need to depend on external tools to be installed locally.
192
- |server-type |unspecified |One of `plantuml` or `kroki_io`
193
- |max-get-size |1024 |The maximum size of the URI path for HTTP GET requests.
194
- If the maximum size is exceeded, POST requests are used instead
195
- |===
196
-
197
- ==== AsciiToSVG
198
-
199
- [cols=">,<,<",options="header"]
200
- |===
201
- |Name |Default value |Description
202
- |fontfamily |unspecified |The font family to use in the generated SVG image
203
- |noblur |unspecified |Disable drop-shadow blurring
204
- |===
205
-
206
- [[barcode_attributes]]
207
- ==== Barcode
208
-
209
- [cols=">,<,<",options="header"]
210
- |===
211
- |Name |Default value |Description
212
- |height |100 |The height of the bars. (1D only, 2D uses ydim)
213
- |xdim |1 |The width of the narrowest bar in a barcode. Thicker bars are multiples of the xdim.
214
- |ydim |Same as xdim |This is the same as xdim, but for the height of the blocks in a 2D barcode.
215
- |margin |10 |The width of the quiet zone around the barcode.
216
- |foreground |black |The color of the bars specified as a 3 or 6 digit hex RGB value or HTML color name.
217
- |background |white |The color of the background specified as a 3 or 6 digit hex RGB value or HTML color name.
218
- |===
219
-
220
- ==== Blockdiag
221
-
222
- [cols=">,<,<",options="header"]
223
- |===
224
- |Name |Default value |Description
225
- |fontpath |unspecified |The path to the font that should be used by blockdiag
226
- |===
227
-
228
- ==== BPMN
229
-
230
- [cols=">,<,<",options="header"]
231
- |===
232
- |Name |Default value |Description
233
- |height |786 |The target height of the diagram. Does not apply for output type `svg`.
234
- |width |1024 |The target width of the diagram. Does not apply for output type `svg`.
235
- |===
236
-
237
- ==== Diagrams
238
-
239
- No specific attributes.
240
-
241
- ==== Ditaa
242
-
243
- [cols=">,<,<",options="header"]
244
- |===
245
- |Name |Default value |Description
246
- |scale |1 |A scale factor that is applied to the image.
247
- |tabs |8 |An integer value that specifies the tab size as a number of spaces.
248
- |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.
249
- |antialias |true |Enables or disables anti-aliasing.
250
- |separation |true |Prevents the separation of common edges of shapes.
251
- |round-corners|false |Causes all corners to be rendered as round corners.
252
- |shadows |true |Enables or disable drop shadows.
253
- |debug |false |Renders the debug grid over the resulting image.
254
- |fixed-slope |false |Makes sides of parallelograms and trapezoids fixed slope instead of fixed width.
255
- |transparent |false |Makes the background of the image transparent instead of using the background color.
256
- |bullet-characters|*o |The characters to recognize as bullets
257
- |===
258
-
259
- ==== Gnuplot
260
-
261
- [cols=">,<,<",options="header"]
262
- |===
263
- |Name |Default value |Description
264
- |background |unspecified |Background color, e.g. `red`, `#FF0000`. Does not work with `txt`.
265
- |height |unspecified |The height of the plot. Must be specified together with `width`.
266
- |width |unspecified |The width of the plot. Must be specified together with `height`.
267
- |crop |unspecified |Trims blank space from the edges of the completed plot (true/false). Does not work with `svg`, `pdf`.
268
- |transparent |unspecified |Generate transparent background (true/false). Does not work with `svg`, `pdf`, `txt`.
269
- |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`.
270
- |fontscale |unspecified |Scales all label for given factor. Does not work with `txt`.
271
- |===
272
-
273
- ==== GraphViz
274
-
275
- [cols=">,<,<",options="header"]
276
- |===
277
- |Name |Default value |Description
278
- |layout |unspecified |The graphviz layout engine to use (dot -K option).
279
- |===
280
-
281
- ==== Meme
282
-
283
- [cols=">,<,<",options="header"]
284
- |===
285
- |Name |Default value |Description
286
- |fill-color |white |The fill color for the text.
287
- |stroke-color |black |The outline color for the text
288
- |stroke-width |2 |The width of the text outline.
289
- |font |Impact |The font face to use for the text.
290
- |options |unspecified |a comma separate list of flags that modify the image rendering. Currently only `noupcase` is supported which disable upper casing the labels.
291
- |===
292
-
293
- ==== Mermaid
294
-
295
- [cols=">,<,<",options="header"]
296
- |===
297
- |Name |Default value |Description
298
- |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.
299
- |css |unspecified |Path to a CSS file to pass to mermaid.
300
- |config |unspecified |Path to a JSON config file to pass to mermaid.
301
- |gantt-config |unspecified |Path to a gantt config file to pass to mermaid.
302
- |puppeteer-config|unspecified |Path to a puppeteer config file to pass to mermaid.
303
- |sequence-config |unspecified |Path to a sequence config file to pass to mermaid.
304
- |theme |unspecified |Theme of the chart, could be default, forest, dark or neutral.
305
- |width |unspecified |Width of the page.
306
- |height |unspecified |Height of the page.
307
- |===
308
-
309
- ==== Msc
310
-
311
- [cols=">,<,<",options="header"]
312
- |===
313
- |Name |Default value |Description
314
- |font |unspecified |The name of the font that should be used by mscgen
315
- |===
316
-
317
- ==== PlantUML
318
-
319
- [cols=">,<,<",options="header"]
320
- |===
321
- |Name |Default value |Description
322
- |config |unspecified |Path to a config file to pass to PlantUML.
323
- |size-limit |4096 |The maximum dimensions (width and height) of generated diagrams.
324
- |includedir |unspecified |sets a common directory for puml includes (plantuml.include.path)
325
- |preprocess |true |Preprocess PlantUML code before rendering the diagram.
326
- |===
327
-
328
- ==== State Machine Cat
329
-
330
- [cols=">,<,<",options="header"]
331
- |===
332
- |Name |Default value |Description
333
- |direction |unspecifed |The direction of the state machine diagram. One of `top-down`, `bottom-top`, `left-right` or `right-left`.
334
- |engine |unspecified |The layout engine to use. One of `dot`, `circo`, `fdp`, `neato`, `osage`, or `twopi`
335
- |===
336
-
337
- ==== svgbob
338
-
339
- [cols=">,<,<",options="header"]
340
- |===
341
- |Name |Default value |Description
342
- |font-family |arial |text will be rendered with this font
343
- |font-size |14 |text will be rendered with this font size
344
- |scale |1 |scale the entire svg (dimensions, font size, stroke width) by this factor
345
- |stroke-width |2 |stroke width for all lines
346
- |===
347
-
348
- ==== Syntrax
349
-
350
- [cols=">,<,<",options="header"]
351
- |===
352
- |Name |Default value |Description
353
- |heading |unspecifed |Diagram title
354
- |scale |1 |A scale factor that is applied to the image.
355
- |style-file |unspecifed |Path to a style config file to pass to Syntrax.
356
- |transparent |false |Makes the background of the image transparent instead of opaque white.
357
- |===
358
-
359
- ==== TikZ
360
-
361
- [cols=">,<,<",options="header"]
362
- |===
363
- |Name |Default value |Description
364
- |preamble |unspecified |Code definitions to pass to TikZ.
365
- |===