asciidoctor-diagram 1.5.18 → 1.5.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.adoc +18 -0
- data/README.adoc +34 -5
- data/lib/asciidoctor-diagram.rb +3 -0
- data/lib/asciidoctor-diagram/ditaa/extension.rb +1 -1
- data/lib/asciidoctor-diagram/gnuplot.rb +7 -0
- data/lib/asciidoctor-diagram/gnuplot/extension.rb +70 -0
- data/lib/asciidoctor-diagram/lilypond.rb +7 -0
- data/lib/asciidoctor-diagram/lilypond/extension.rb +61 -0
- data/lib/asciidoctor-diagram/smcat.rb +7 -0
- data/lib/asciidoctor-diagram/smcat/extension.rb +50 -0
- data/lib/asciidoctor-diagram/tikz/extension.rb +2 -2
- data/lib/asciidoctor-diagram/version.rb +1 -1
- data/lib/asciidoctor-diagram/wavedrom/extension.rb +20 -12
- data/lib/ditaamini-0.12.jar +0 -0
- data/spec/gnuplot_spec.rb +478 -0
- data/spec/lilypond_spec.rb +151 -0
- data/spec/smcat_spec.rb +164 -0
- data/spec/test_helper.rb +3 -0
- metadata +18 -6
- data/lib/ditaamini-0.11.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: df890b150a6c0d6baf42b0064ddbc0456ef89dff
|
4
|
+
data.tar.gz: b25f7ca96e4cf5db0d4b319b0f93eded8a876503
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f555b3c805b2903356da1925b888f6d3165418334a8eea10438732fe81ef118cdf28f652e7f0cb77dd85995bd65382bb9e538c05cffa7d38f16f53b081ec475d
|
7
|
+
data.tar.gz: 3ba60e0ef78777920fd654f549488e87be57e87a215a34067574e6aeb04a5764070b4d23f7027ae681a65487c22694e3bbf3f9263ec3eeae2a7df3f1ccc221ed
|
data/CHANGELOG.adoc
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
= Asciidoctor-diagram Changelog
|
2
2
|
|
3
|
+
== 1.5.19
|
4
|
+
|
5
|
+
Bug Fixes::
|
6
|
+
* Issue #233: Resolve character encoding issues with Ditaa on Windows with Java runtimes that do not use UTF-8 encoding by default
|
7
|
+
* Fix generation of SVG output for TikZ diagrams (@joelsmith)
|
8
|
+
* Improve TikZ image cropping (@joelsmith)
|
9
|
+
|
10
|
+
Enhancements::
|
11
|
+
* Issue #225: Add support for WaveDrom CLI 2.0.0
|
12
|
+
* Issue #234: Add support for State Machine Cat
|
13
|
+
* Add support for gnuplot (@MariuszCwikla)
|
14
|
+
|
15
|
+
== 1.5.18
|
16
|
+
|
17
|
+
Bug Fixes::
|
18
|
+
|
19
|
+
* Issue #224: Fix asciidoctor 1.5.x compatibility regression introduced in 1.5.17
|
20
|
+
|
3
21
|
== 1.5.17
|
4
22
|
|
5
23
|
Enhancements::
|
data/README.adoc
CHANGED
@@ -21,6 +21,7 @@ ifndef::env-site[:status:]
|
|
21
21
|
:uri-ditaa: http://ditaa.sourceforge.net/
|
22
22
|
:uri-dot: https://graphviz.gitlab.io/_pages/doc/info/lang.html
|
23
23
|
:uri-erd: https://github.com/BurntSushi/erd
|
24
|
+
:uri-gnuplot: http://gnuplot.info
|
24
25
|
:uri-graphviz: https://graphviz.gitlab.io
|
25
26
|
:uri-imagemagick: http://www.imagemagick.org
|
26
27
|
:uri-java: http://java.sun.com
|
@@ -35,6 +36,7 @@ ifndef::env-site[:status:]
|
|
35
36
|
:uri-rackdiag: http://blockdiag.com/en/nwdiag/index.html
|
36
37
|
:uri-seqdiag: http://blockdiag.com/en/seqdiag/index.html
|
37
38
|
:uri-shaape: https://github.com/christiangoltz/shaape
|
39
|
+
:uri-smcat: https://github.com/sverweij/state-machine-cat
|
38
40
|
:uri-svgbob: https://github.com/ivanceras/svgbobrus
|
39
41
|
:uri-syntrax: https://kevinpt.github.io/syntrax/
|
40
42
|
:uri-umlet: http://www.umlet.com/
|
@@ -46,7 +48,7 @@ ifndef::env-site[:status:]
|
|
46
48
|
|
47
49
|
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
50
|
|
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.
|
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.
|
50
52
|
|
51
53
|
Each extension runs the diagram processor to generate an SVG, PNG, or TXT file from the input text.
|
52
54
|
The generated file is then inserted into your converted document.
|
@@ -121,6 +123,7 @@ The following diagram types and output formats are available:
|
|
121
123
|
|{uri-blockdiag}[blockdiag] | |{check}|{check}|{check}|
|
122
124
|
|{uri-ditaa}[ditaa] | | |{check}|{check}|
|
123
125
|
|{uri-erd}[erd] | | |{check}|{check}|
|
126
|
+
|{uri-gnuplot}[gnuplot] |{check}| |{check}|{check}|{check}
|
124
127
|
|{uri-dot}[graphviz] | |{check}|{check}|{check}|
|
125
128
|
|<<meme,meme>> |{check}| |{check}| |
|
126
129
|
|{uri-mermaid}[mermaid] | |{check}|{check}|{check}|
|
@@ -132,6 +135,7 @@ The following diagram types and output formats are available:
|
|
132
135
|
|{uri-rackdiag}[rackdiag] | |{check}|{check}|{check}|
|
133
136
|
|{uri-seqdiag}[seqdiag] | |{check}|{check}|{check}|
|
134
137
|
|{uri-shaape}[shaape] | | |{check}|{check}|
|
138
|
+
|{uri-smcat}[smcat] | | | |{check}|
|
135
139
|
|{uri-svgbob}[svgbob] | | | |{check}|
|
136
140
|
|{uri-syntrax}[syntrax] | |{check}|{check}|{check}|
|
137
141
|
|{uri-umlet}[umlet] |{check}|{check}|{check}|{check}|
|
@@ -249,7 +253,7 @@ or load and register each extension individually.
|
|
249
253
|
require 'asciidoctor-diagram/<extension_name>'
|
250
254
|
----
|
251
255
|
|
252
|
-
`<extension_name>` can be one of `a2s`, `blockdiag`, `ditaa`, `erd`, `graphviz`, `meme`, `mermaid`, `msc`, `plantuml`, `shaape`, `svgbob`, `syntrax`, `umlet`, `vega` or `wavedrom`.
|
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`.
|
253
257
|
|
254
258
|
Requiring one or more of these files will automatically register the extensions for all processed documents.
|
255
259
|
|
@@ -297,6 +301,7 @@ The following table lists the tools that are required for each diagram type, the
|
|
297
301
|
|blockdiag |{uri-blockdiag}[BlockDiag] |`blockdiag`
|
298
302
|
|ditaa |{uri-java}[Java] |`java`
|
299
303
|
|erd |{uri-erd}[Erd] |`erd`
|
304
|
+
|gnuplot |{uri-gnuplot}[Gnuplot] |`gnuplot`
|
300
305
|
|graphviz |{uri-graphviz}[GraphViz] |`dot` or `graphvizdot`
|
301
306
|
|meme |{uri-imagemagick}[ImageMagick] |`convert` and `identify`
|
302
307
|
|mermaid |{uri-mermaid}[Mermaid.cli] |`mermaid`
|
@@ -308,13 +313,14 @@ The following table lists the tools that are required for each diagram type, the
|
|
308
313
|
|rackdiag |{uri-nwdiag}[NwDiag] |`rackdiag`
|
309
314
|
|seqdiag |{uri-seqdiag}[SeqDiag] |`seqdiag`
|
310
315
|
|shaape |{uri-shaape}[Shaape] |`shaape`
|
316
|
+
|smcat |{uri-smcat}[State Machine Cat] |`smcat`
|
311
317
|
|svgbob |{uri-svgbob}[SvgBob] |`svgbob`
|
312
318
|
|syntrax |{uri-syntrax}[Syntrax] |`syntrax`
|
313
319
|
|umlet |{uri-umlet}[Umlet] |`umlet`
|
314
320
|
|vega |{uri-vega}[vg2png] and/or {uri-vega}[vg2png] |`vg2png` and `vg2svg`
|
315
321
|
|vegalite |{uri-vegalite}[vl2vg] and {uri-vega}[vg2png] and/or {uri-vega}[vg2svg]|`vl2vg`, `vg2png` and `vg2svg`
|
316
322
|
.2+|wavedrom |{uri-wavedromeditor}[WaveDrom Editor] |`wavedrom`
|
317
|
-
|{uri-wavedromcli}[WaveDrom CLI] and {uri-phantomjs}[PhantomJS]
|
323
|
+
|{uri-wavedromcli}[WaveDrom CLI] (and {uri-phantomjs}[PhantomJS] for WaveDrom CLI v1) |`wavedrom` (and `phantomjs`)
|
318
324
|
|===
|
319
325
|
|
320
326
|
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,12 +334,12 @@ The meme extension provides a basic '`Advice Animal`' style image generator.
|
|
328
334
|
It's usage is easiest to explain with an example.
|
329
335
|
|
330
336
|
----
|
331
|
-
meme::yunoguy.jpg[Doc writers,Y U NO
|
337
|
+
meme::yunoguy.jpg[Doc writers,Y U NO // AsciiDoc]
|
332
338
|
----
|
333
339
|
|
334
340
|
The target of the block macro tells the extension which image to use as background.
|
335
341
|
The first two positional attributes are `top` and `bottom` and are used for the top and bottom label.
|
336
|
-
Occurrences of
|
342
|
+
Occurrences of `//` surrounded by whitespace are interpreted as line breaks.
|
337
343
|
|
338
344
|
=== Diagram Attributes
|
339
345
|
|
@@ -394,6 +400,20 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
394
400
|
|transparent |false |Makes the background of the image transparent instead of using the background color.
|
395
401
|
|===
|
396
402
|
|
403
|
+
==== Gnuplot
|
404
|
+
|
405
|
+
[cols=">,<,<",options="header"]
|
406
|
+
|===
|
407
|
+
|Name |Default value |Description
|
408
|
+
|background |unspecified |Background color, e.g. `red`, `#FF0000`. Does not work with `txt`.
|
409
|
+
|height |unspecified |The height of the plot. Must be specified together with `width`.
|
410
|
+
|width |unspecified |The width of the plot. Must be specified together with `height`.
|
411
|
+
|crop |unspecified |Trims blank space from the edges of the completed plot (true/false). Does not work with `svg`, `pdf`.
|
412
|
+
|transparent |unspecified |Generate transparent background (true/false). Does not work with `svg`, `pdf`, `txt`.
|
413
|
+
|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`.
|
414
|
+
|fontscale |unspecified |Scales all label for given factor. Does not work with `txt`.
|
415
|
+
|===
|
416
|
+
|
397
417
|
==== GraphViz
|
398
418
|
|
399
419
|
[cols=">,<,<",options="header"]
|
@@ -445,6 +465,15 @@ The attribute name at the block level should be prefixed with the name of the di
|
|
445
465
|
|config |unspecified |Path to a config file to pass to PlantUML.
|
446
466
|
|===
|
447
467
|
|
468
|
+
==== State Machine Cat
|
469
|
+
|
470
|
+
[cols=">,<,<",options="header"]
|
471
|
+
|===
|
472
|
+
|Name |Default value |Description
|
473
|
+
|direction |unspecifed |The direction of the state machine diagram. One of `top-down`, `bottom-top`, `left-right` or `right-left`.
|
474
|
+
|engine |unspecified |The layout engine to use. One of `dot`, `circo`, `fdp`, `neato`, `osage`, or `twopi`
|
475
|
+
|===
|
476
|
+
|
448
477
|
==== Syntrax
|
449
478
|
|
450
479
|
[cols=">,<,<",options="header"]
|
data/lib/asciidoctor-diagram.rb
CHANGED
@@ -2,7 +2,9 @@ require_relative 'asciidoctor-diagram/a2s'
|
|
2
2
|
require_relative 'asciidoctor-diagram/blockdiag'
|
3
3
|
require_relative 'asciidoctor-diagram/ditaa'
|
4
4
|
require_relative 'asciidoctor-diagram/erd'
|
5
|
+
require_relative 'asciidoctor-diagram/gnuplot'
|
5
6
|
require_relative 'asciidoctor-diagram/graphviz'
|
7
|
+
require_relative 'asciidoctor-diagram/lilypond'
|
6
8
|
require_relative 'asciidoctor-diagram/meme'
|
7
9
|
require_relative 'asciidoctor-diagram/mermaid'
|
8
10
|
require_relative 'asciidoctor-diagram/msc'
|
@@ -10,6 +12,7 @@ require_relative 'asciidoctor-diagram/nomnoml'
|
|
10
12
|
require_relative 'asciidoctor-diagram/plantuml'
|
11
13
|
require_relative 'asciidoctor-diagram/salt'
|
12
14
|
require_relative 'asciidoctor-diagram/shaape'
|
15
|
+
require_relative 'asciidoctor-diagram/smcat'
|
13
16
|
require_relative 'asciidoctor-diagram/svgbob'
|
14
17
|
require_relative 'asciidoctor-diagram/syntrax'
|
15
18
|
require_relative 'asciidoctor-diagram/tikz'
|
@@ -20,7 +20,7 @@ module Asciidoctor
|
|
20
20
|
'transparent' => lambda { |o, v| o << '--transparent' if v == 'true'}
|
21
21
|
}
|
22
22
|
|
23
|
-
JARS = ['ditaa-1.3.13.jar', 'ditaamini-0.
|
23
|
+
JARS = ['ditaa-1.3.13.jar', 'ditaamini-0.12.jar'].map do |jar|
|
24
24
|
File.expand_path File.join('../..', jar), File.dirname(__FILE__)
|
25
25
|
end
|
26
26
|
Java.classpath.concat JARS
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require_relative '../extensions'
|
2
|
+
require_relative '../util/cli_generator'
|
3
|
+
require_relative '../util/platform'
|
4
|
+
require_relative '../util/which'
|
5
|
+
|
6
|
+
module Asciidoctor
|
7
|
+
module Diagram
|
8
|
+
# @private
|
9
|
+
module Gnuplot
|
10
|
+
include CliGenerator
|
11
|
+
include Which
|
12
|
+
|
13
|
+
def self.included(mod)
|
14
|
+
[:png, :svg, :gif].each do |f|
|
15
|
+
mod.register_format(f, :image) do |parent, source|
|
16
|
+
gnuplot(parent, source, f)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
mod.register_format(:txt, :literal) do |parent, source|
|
21
|
+
gnuplot(parent, source, :txt)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def gnuplot(parent, source, format)
|
26
|
+
inherit_prefix = name
|
27
|
+
|
28
|
+
width = source.attr("width", nil, inherit_prefix)
|
29
|
+
height = source.attr("height", nil, inherit_prefix)
|
30
|
+
|
31
|
+
if format == :txt
|
32
|
+
format = 'dumb'
|
33
|
+
end
|
34
|
+
|
35
|
+
code = "set term #{format}"
|
36
|
+
code << " size #{width},#{height}" unless width.nil? or height.nil?
|
37
|
+
|
38
|
+
transparent = source.attr("transparent", nil, inherit_prefix)
|
39
|
+
code << (transparent ? " transparent" : " notransparent") unless transparent.nil?
|
40
|
+
|
41
|
+
crop = source.attr("crop", nil, inherit_prefix)
|
42
|
+
code << (crop ? " crop" : " nocrop") unless crop.nil?
|
43
|
+
|
44
|
+
font = source.attr("font", nil, inherit_prefix)
|
45
|
+
code << %( font "#{font}") unless font.nil?
|
46
|
+
|
47
|
+
font_scale = source.attr("fontscale", nil, inherit_prefix)
|
48
|
+
code << " fontscale #{font_scale}" unless font_scale.nil?
|
49
|
+
|
50
|
+
background = source.attr("background", nil, inherit_prefix)
|
51
|
+
code << %( background "#{background}") unless background.nil?
|
52
|
+
|
53
|
+
code << "\n"
|
54
|
+
code << source.to_s
|
55
|
+
generate_stdin_stdout(which(parent, 'gnuplot'), code) do |tool_path|
|
56
|
+
[tool_path]
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class GnuplotBlockProcessor < Extensions::DiagramBlockProcessor
|
63
|
+
include Gnuplot
|
64
|
+
end
|
65
|
+
|
66
|
+
class GnuplotBlockMacroProcessor < Extensions::DiagramBlockMacroProcessor
|
67
|
+
include Gnuplot
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require_relative '../extensions'
|
2
|
+
require_relative '../util/cli_generator'
|
3
|
+
require_relative '../util/platform'
|
4
|
+
require_relative '../util/which'
|
5
|
+
|
6
|
+
module Asciidoctor
|
7
|
+
module Diagram
|
8
|
+
# @private
|
9
|
+
module Lilypond
|
10
|
+
include CliGenerator
|
11
|
+
include Which
|
12
|
+
|
13
|
+
def self.included(mod)
|
14
|
+
[:png, :pdf].each do |f|
|
15
|
+
mod.register_format(f, :image) do |parent, source|
|
16
|
+
lilypond(parent, source, f)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def lilypond(parent, source, format)
|
22
|
+
code = <<-EOF
|
23
|
+
\\paper{
|
24
|
+
oddFooterMarkup=##f
|
25
|
+
oddHeaderMarkup=##f
|
26
|
+
bookTitleMarkup=##f
|
27
|
+
scoreTitleMarkup=##f
|
28
|
+
}
|
29
|
+
|
30
|
+
EOF
|
31
|
+
code << source.to_s
|
32
|
+
|
33
|
+
inherit_prefix = name
|
34
|
+
resolution = source.attr('resolution', nil, inherit_prefix)
|
35
|
+
|
36
|
+
generate_stdin(which(parent, 'lilypond'), format.to_s, code) do |tool_path, output_path|
|
37
|
+
args = [tool_path, '-daux-files=#f', '-dbackend=eps', '-dno-gs-load-fonts', '-dinclude-eps-fonts', '-o', Platform.native_path(output_path), '-f', format.to_s]
|
38
|
+
|
39
|
+
args << '-dsafe'
|
40
|
+
args << "-dresolution=#{resolution}" if resolution
|
41
|
+
args << "-dpixmap-format=pngalpha" if format == :png
|
42
|
+
|
43
|
+
args << '-'
|
44
|
+
|
45
|
+
{
|
46
|
+
:args => args,
|
47
|
+
:out_file => "#{output_path}.#{format.to_s}"
|
48
|
+
}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class LilypondBlockProcessor < Extensions::DiagramBlockProcessor
|
54
|
+
include Lilypond
|
55
|
+
end
|
56
|
+
|
57
|
+
class LilypondBlockMacroProcessor < Extensions::DiagramBlockMacroProcessor
|
58
|
+
include Lilypond
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require_relative '../extensions'
|
2
|
+
require_relative '../util/cli_generator'
|
3
|
+
require_relative '../util/platform'
|
4
|
+
require_relative '../util/which'
|
5
|
+
|
6
|
+
module Asciidoctor
|
7
|
+
module Diagram
|
8
|
+
# @private
|
9
|
+
module Smcat
|
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
|
+
smcat(parent, source, f)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def smcat(parent, source, format)
|
22
|
+
inherit_prefix = name
|
23
|
+
direction = source.attr('direction', nil, inherit_prefix)
|
24
|
+
engine = source.attr('engine', nil, inherit_prefix)
|
25
|
+
|
26
|
+
generate_stdin(which(parent, 'smcat'), format.to_s, source.to_s) do |tool_path, output_path|
|
27
|
+
args = [tool_path, '-o', Platform.native_path(output_path), '-T', format.to_s]
|
28
|
+
if direction
|
29
|
+
args << '-d' << direction
|
30
|
+
end
|
31
|
+
|
32
|
+
if engine
|
33
|
+
args << '-E' << engine
|
34
|
+
end
|
35
|
+
|
36
|
+
args << '-'
|
37
|
+
args
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class SmcatBlockProcessor < Extensions::DiagramBlockProcessor
|
43
|
+
include Smcat
|
44
|
+
end
|
45
|
+
|
46
|
+
class SmcatBlockMacroProcessor < Extensions::DiagramBlockMacroProcessor
|
47
|
+
include Smcat
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -28,7 +28,7 @@ module Asciidoctor
|
|
28
28
|
end
|
29
29
|
|
30
30
|
latex = <<'END'
|
31
|
-
\documentclass[border=2bp]{standalone}
|
31
|
+
\documentclass[border=2bp, tikz]{standalone}
|
32
32
|
\usepackage{tikz}
|
33
33
|
\begin{document}
|
34
34
|
\begingroup
|
@@ -49,7 +49,7 @@ END
|
|
49
49
|
|
50
50
|
if svgpath
|
51
51
|
generate_file(svgpath, 'pdf', 'svg', pdf) do |tool_path, input_path, output_path|
|
52
|
-
[tool_path, Platform.native_path(
|
52
|
+
[tool_path, Platform.native_path(input_path), Platform.native_path(output_path)]
|
53
53
|
end
|
54
54
|
else
|
55
55
|
pdf
|
@@ -19,25 +19,33 @@ module Asciidoctor
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def wavedrom(parent, source, format)
|
22
|
-
wavedrom_cli = which(parent, 'wavedrom', :raise_on_error => false)
|
23
|
-
phantomjs = which(parent, 'phantomjs', :alt_attrs => ['phantomjs_2'], :raise_on_error => false)
|
22
|
+
wavedrom_cli = which(parent, 'wavedrom-cli', :raise_on_error => false)
|
24
23
|
|
25
|
-
if wavedrom_cli
|
24
|
+
if wavedrom_cli
|
26
25
|
generate_file(wavedrom_cli, 'wvd', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
27
|
-
[
|
26
|
+
[Platform.native_path(tool_path), '--input', Platform.native_path(input_path), "--#{format.to_s}", Platform.native_path(output_path)]
|
28
27
|
end
|
29
28
|
else
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
wavedrom_cli = which(parent, 'wavedrom', :raise_on_error => false)
|
30
|
+
phantomjs = which(parent, 'phantomjs', :alt_attrs => ['phantomjs_2'], :raise_on_error => false)
|
31
|
+
|
32
|
+
if wavedrom_cli && !wavedrom_cli.include?('WaveDromEditor') && phantomjs
|
33
|
+
generate_file(wavedrom_cli, 'wvd', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
34
|
+
[phantomjs, Platform.native_path(tool_path), '-i', Platform.native_path(input_path), "-#{format.to_s[0]}", Platform.native_path(output_path)]
|
34
35
|
end
|
35
36
|
else
|
36
|
-
|
37
|
-
|
37
|
+
if ::Asciidoctor::Diagram::Platform.os == :macosx
|
38
|
+
wavedrom = which(parent, 'WaveDromEditor.app', :alt_cmds => ['wavedrom-editor.app'], :attrs => ['WaveDromEditorApp'],:path => ['/Applications'])
|
39
|
+
if wavedrom
|
40
|
+
wavedrom = File.join(wavedrom, 'Contents/MacOS/nwjs')
|
41
|
+
end
|
42
|
+
else
|
43
|
+
wavedrom = which(parent, 'WaveDromEditor')
|
44
|
+
end
|
38
45
|
|
39
|
-
|
40
|
-
|
46
|
+
generate_file(wavedrom, 'wvd', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
47
|
+
[tool_path, 'source', Platform.native_path(input_path), format.to_s, Platform.native_path(output_path)]
|
48
|
+
end
|
41
49
|
end
|
42
50
|
end
|
43
51
|
end
|