asciidoctor-diagram 2.2.12 → 2.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +11 -0
- data/lib/asciidoctor-diagram/a2s/converter.rb +4 -1
- data/lib/asciidoctor-diagram/blockdiag/converter.rb +5 -1
- data/lib/asciidoctor-diagram/bpmn/converter.rb +4 -1
- data/lib/asciidoctor-diagram/bytefield/converter.rb +4 -1
- data/lib/asciidoctor-diagram/d2/converter.rb +2 -2
- data/lib/asciidoctor-diagram/dbml/converter.rb +6 -1
- data/lib/asciidoctor-diagram/diagram_processor.rb +10 -4
- data/lib/asciidoctor-diagram/diagram_source.rb +4 -0
- data/lib/asciidoctor-diagram/diagrams/converter.rb +4 -1
- data/lib/asciidoctor-diagram/dpic/converter.rb +4 -1
- data/lib/asciidoctor-diagram/erd/converter.rb +4 -1
- data/lib/asciidoctor-diagram/gnuplot/converter.rb +6 -1
- data/lib/asciidoctor-diagram/graphviz/converter.rb +4 -1
- data/lib/asciidoctor-diagram/graphviz_py/converter.rb +4 -1
- data/lib/asciidoctor-diagram/http/converter.rb +0 -1
- data/lib/asciidoctor-diagram/lilypond/converter.rb +2 -1
- data/lib/asciidoctor-diagram/mermaid/converter.rb +4 -2
- data/lib/asciidoctor-diagram/msc/converter.rb +5 -1
- data/lib/asciidoctor-diagram/nomnoml/converter.rb +4 -1
- data/lib/asciidoctor-diagram/penrose/converter.rb +4 -1
- data/lib/asciidoctor-diagram/pikchr/converter.rb +4 -1
- data/lib/asciidoctor-diagram/shaape/converter.rb +4 -1
- data/lib/asciidoctor-diagram/smcat/converter.rb +5 -1
- data/lib/asciidoctor-diagram/svgbob/converter.rb +4 -1
- data/lib/asciidoctor-diagram/symbolator/converter.rb +4 -1
- data/lib/asciidoctor-diagram/syntrax/converter.rb +4 -1
- data/lib/asciidoctor-diagram/tikz/converter.rb +4 -1
- data/lib/asciidoctor-diagram/umlet/converter.rb +4 -1
- data/lib/asciidoctor-diagram/vega/converter.rb +5 -3
- data/lib/asciidoctor-diagram/version.rb +1 -1
- data/lib/asciidoctor-diagram/wavedrom/converter.rb +13 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bcfe1104d151f5da05b3f237b06e2310ca670ee84f6e4e9b6f43a769820fcf0
|
4
|
+
data.tar.gz: 1d44562539b7320c7fd4b767d16428aa3bc896e181575be73e5e87f2dc59b93f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2fb9ac70813787758f76eccf886f4e538313c7c2574915c1034c19ebedd7b7af93ddeeed297c91e24db8d7056acecf9df98d7b01e522b61a7240ed52f8614e
|
7
|
+
data.tar.gz: 1a68a3fa835c7fb8c9d61d4754f4a2a7d1a37eaad67895aabcdb0183d101e45b30c61067e4293a8392e70f54bf19ef327eab00fc6255ea3507fa7cde1a77293d
|
data/CHANGELOG.adoc
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
= Asciidoctor-diagram Changelog
|
2
2
|
|
3
|
+
== 2.2.13
|
4
|
+
|
5
|
+
Enhancements::
|
6
|
+
|
7
|
+
* Issue #436: Allow diagram caching to be disabled using the `nocache` option.
|
8
|
+
|
9
|
+
Bugfixes::
|
10
|
+
|
11
|
+
* Issue #437: Set working directory when generating diagrams.
|
12
|
+
* Issue #439: Resolve errors when using relative imports in D2 diagrams
|
13
|
+
|
3
14
|
== 2.2.12
|
4
15
|
|
5
16
|
Enhancements::
|
@@ -25,7 +25,11 @@ module Asciidoctor
|
|
25
25
|
args = [tool_path, '-a', '-o', Platform.native_path(output_path), "-T#{format.to_s}"]
|
26
26
|
args << "-f#{Platform.native_path(font_path)}" if font_path
|
27
27
|
args << '-'
|
28
|
-
|
28
|
+
|
29
|
+
{
|
30
|
+
:args => args,
|
31
|
+
:chdir => source.base_dir
|
32
|
+
}
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
@@ -18,7 +18,10 @@ module Asciidoctor
|
|
18
18
|
bytefield_path = source.find_command('bytefield-svg')
|
19
19
|
|
20
20
|
generate_stdin(bytefield_path, format.to_s, source.to_s) do |tool_path, output_path|
|
21
|
-
|
21
|
+
{
|
22
|
+
:args => [tool_path, "--output", Platform.native_path(output_path)],
|
23
|
+
:chdir => source.base_dir
|
24
|
+
}
|
22
25
|
end
|
23
26
|
end
|
24
27
|
end
|
@@ -27,7 +27,7 @@ module Asciidoctor
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def convert(source, format, options)
|
30
|
-
|
30
|
+
generate_stdin(source.find_command('d2'), format.to_s, source.code) do |tool_path, output_path|
|
31
31
|
args = [tool_path, '--browser', 'false']
|
32
32
|
|
33
33
|
options.each_pair do |key, value|
|
@@ -43,7 +43,7 @@ module Asciidoctor
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
args <<
|
46
|
+
args << '-'
|
47
47
|
args << Platform.native_path(output_path)
|
48
48
|
|
49
49
|
{
|
@@ -15,7 +15,12 @@ module Asciidoctor
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def convert(source, format, options)
|
18
|
-
generate_stdin_stdout(source.find_command('dbml-renderer'), source.code)
|
18
|
+
generate_stdin_stdout(source.find_command('dbml-renderer'), source.code) do |tool|
|
19
|
+
{
|
20
|
+
:args => [tool],
|
21
|
+
:chdir => source.base_dir
|
22
|
+
}
|
23
|
+
end
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
@@ -165,7 +165,9 @@ module Asciidoctor
|
|
165
165
|
image_file = parent.normalize_system_path(image_name, image_output_dir(parent))
|
166
166
|
metadata_file = parent.normalize_system_path("#{image_name}.cache", cache_dir(source, parent))
|
167
167
|
|
168
|
-
|
168
|
+
use_cache = !source.global_opt('nocache')
|
169
|
+
|
170
|
+
if use_cache && File.exist?(metadata_file)
|
169
171
|
metadata = File.open(metadata_file, 'r') {|f| JSON.load(f, nil, :symbolize_names => true, :create_additions => false) }
|
170
172
|
else
|
171
173
|
metadata = {}
|
@@ -191,14 +193,18 @@ module Asciidoctor
|
|
191
193
|
metadata = source.create_image_metadata
|
192
194
|
metadata[:options] = options
|
193
195
|
|
194
|
-
allow_image_optimisation = source.
|
196
|
+
allow_image_optimisation = !source.global_opt('nooptimise')
|
195
197
|
result, metadata[:width], metadata[:height] = params[:decoder].post_process_image(result, allow_image_optimisation)
|
196
198
|
|
197
199
|
FileUtils.mkdir_p(File.dirname(image_file)) unless Dir.exist?(File.dirname(image_file))
|
198
200
|
File.open(image_file, 'wb') {|f| f.write result}
|
199
201
|
|
200
|
-
|
201
|
-
|
202
|
+
if use_cache
|
203
|
+
FileUtils.mkdir_p(File.dirname(metadata_file)) unless Dir.exist?(File.dirname(metadata_file))
|
204
|
+
File.open(metadata_file, 'w') { |f| JSON.dump(metadata, f) }
|
205
|
+
else
|
206
|
+
File.delete(metadata_file) if File.exist?(metadata_file)
|
207
|
+
end
|
202
208
|
end
|
203
209
|
|
204
210
|
scale = image_attributes['scale']
|
@@ -22,7 +22,10 @@ module Asciidoctor
|
|
22
22
|
code << "\n.PE" unless code.start_with?("\n.PE")
|
23
23
|
|
24
24
|
generate_file_stdout(dpic_path, format.to_s, code) do |tool_path, input_path|
|
25
|
-
|
25
|
+
{
|
26
|
+
:args => [tool_path, "-v", "-z", input_path],
|
27
|
+
:chdir => source.base_dir
|
28
|
+
}
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
@@ -23,7 +23,10 @@ module Asciidoctor
|
|
23
23
|
end
|
24
24
|
|
25
25
|
generate_stdin(dot_path, format.to_s, dot_code) do |tool_path, output_path|
|
26
|
-
|
26
|
+
{
|
27
|
+
:args => [tool_path, "-o#{Platform.native_path(output_path)}", "-T#{format.to_s}"],
|
28
|
+
:chdir => source.base_dir
|
29
|
+
}
|
27
30
|
end
|
28
31
|
end
|
29
32
|
end
|
@@ -56,7 +56,12 @@ module Asciidoctor
|
|
56
56
|
code << "\n"
|
57
57
|
code << source.to_s
|
58
58
|
|
59
|
-
generate_stdin_stdout(source.find_command('gnuplot'), code)
|
59
|
+
generate_stdin_stdout(source.find_command('gnuplot'), code) do |tool|
|
60
|
+
{
|
61
|
+
:args => [tool],
|
62
|
+
:chdir => source.base_dir
|
63
|
+
}
|
64
|
+
end
|
60
65
|
end
|
61
66
|
end
|
62
67
|
end
|
@@ -164,7 +164,8 @@ module Asciidoctor
|
|
164
164
|
|
165
165
|
{
|
166
166
|
:args => args,
|
167
|
-
:env => {'NODE_OPTIONS' => '--unhandled-rejections=strict'}
|
167
|
+
:env => {'NODE_OPTIONS' => '--unhandled-rejections=strict'},
|
168
|
+
:chdir => source.base_dir
|
168
169
|
}
|
169
170
|
end
|
170
171
|
end
|
@@ -200,7 +201,8 @@ module Asciidoctor
|
|
200
201
|
|
201
202
|
{
|
202
203
|
:args => args,
|
203
|
-
:out_file => output_file
|
204
|
+
:out_file => output_file,
|
205
|
+
:chdir => source.base_dir
|
204
206
|
}
|
205
207
|
end
|
206
208
|
end
|
@@ -17,7 +17,10 @@ module Asciidoctor
|
|
17
17
|
|
18
18
|
def convert(source, format, options)
|
19
19
|
generate_file(source.find_command('nomnoml'), 'nomnoml', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
20
|
-
|
20
|
+
{
|
21
|
+
:args => [tool_path, Platform.native_path(input_path), Platform.native_path(output_path)],
|
22
|
+
:chdir => source.base_dir
|
23
|
+
}
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
@@ -18,7 +18,10 @@ module Asciidoctor
|
|
18
18
|
pikchr_path = source.find_command('pikchr')
|
19
19
|
|
20
20
|
output = generate_file_stdout(pikchr_path, format.to_s, source.to_s) do |tool_path, input_path|
|
21
|
-
|
21
|
+
{
|
22
|
+
:args => [tool_path, "--svg-only", input_path],
|
23
|
+
:chdir => source.base_dir
|
24
|
+
}
|
22
25
|
end
|
23
26
|
|
24
27
|
if output.start_with? '<svg'
|
@@ -17,7 +17,10 @@ module Asciidoctor
|
|
17
17
|
|
18
18
|
def convert(source, format, options)
|
19
19
|
generate_stdin(source.find_command('shaape'), format.to_s, source.to_s) do |tool_path, output_path|
|
20
|
-
|
20
|
+
{
|
21
|
+
:args => [tool_path, '-o', Platform.native_path(output_path), '-t', format.to_s, '-'],
|
22
|
+
:chdir => source.base_dir
|
23
|
+
}
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
@@ -46,7 +46,10 @@ module Asciidoctor
|
|
46
46
|
end
|
47
47
|
|
48
48
|
generate_stdin(source.find_command('svgbob', :alt_cmds => ['svgbob_cli']), format.to_s, source.to_s) do |tool_path, output_path|
|
49
|
-
|
49
|
+
{
|
50
|
+
:args => ([tool_path, '-o', Platform.native_path(output_path)] + flags),
|
51
|
+
:chdir => source.base_dir
|
52
|
+
}
|
50
53
|
end
|
51
54
|
end
|
52
55
|
end
|
@@ -15,7 +15,10 @@ module Asciidoctor
|
|
15
15
|
|
16
16
|
def convert(source, format, options)
|
17
17
|
generate_stdin(source.find_command('symbolator'), format.to_s, source.to_s) do |tool_path, output_path|
|
18
|
-
|
18
|
+
{
|
19
|
+
:args => [tool_path, "-i-", "-o#{Platform.native_path(output_path)}", "-f#{format.to_s}"],
|
20
|
+
:chdir => source.base_dir
|
21
|
+
}
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
@@ -91,7 +91,10 @@ module Asciidoctor
|
|
91
91
|
response[:body]
|
92
92
|
else
|
93
93
|
generate_file(source.find_command('syntrax'), 'spec', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
94
|
-
|
94
|
+
{
|
95
|
+
:args => ([tool_path, '-i', Platform.native_path(input_path), '-o', Platform.native_path(output_path)] + shared_args),
|
96
|
+
:chdir => source.base_dir
|
97
|
+
}
|
95
98
|
end
|
96
99
|
end
|
97
100
|
|
@@ -64,7 +64,10 @@ END
|
|
64
64
|
|
65
65
|
if svgpath
|
66
66
|
generate_file(svgpath, 'pdf', 'svg', pdf) do |tool_path, input_path, output_path|
|
67
|
-
|
67
|
+
{
|
68
|
+
:args => [tool_path, Platform.native_path(input_path), Platform.native_path(output_path)],
|
69
|
+
:chdir => source.base_dir
|
70
|
+
}
|
68
71
|
end
|
69
72
|
else
|
70
73
|
pdf
|
@@ -25,7 +25,10 @@ module Asciidoctor
|
|
25
25
|
end
|
26
26
|
|
27
27
|
generate_file(java, 'uxf', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
28
|
-
|
28
|
+
{
|
29
|
+
:args => [tool_path, '-jar', Platform.native_path(umlet), '-action=convert', "-format=#{format.to_s}", "-filename=#{Platform.native_path(input_path)}", "-output=#{Platform.native_path(output_path)}"],
|
30
|
+
:chdir => source.base_dir
|
31
|
+
}
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
@@ -32,14 +32,16 @@ module Asciidoctor
|
|
32
32
|
vega_code = code
|
33
33
|
end
|
34
34
|
|
35
|
-
|
35
|
+
generate_stdin_stdout(source.find_command("vg2#{format}"), vega_code) do |tool_path|
|
36
36
|
args = [tool_path, '--base', Platform.native_path(base_dir)]
|
37
37
|
if format == :svg
|
38
38
|
args << '--header'
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
{
|
42
|
+
:args => args,
|
43
|
+
:chdir => source.base_dir
|
44
|
+
}
|
43
45
|
end
|
44
46
|
end
|
45
47
|
end
|
@@ -18,8 +18,11 @@ module Asciidoctor
|
|
18
18
|
def convert(source, format, options)
|
19
19
|
wavedrom_cli = source.find_command('wavedrom-cli', :raise_on_error => false)
|
20
20
|
if wavedrom_cli
|
21
|
-
|
22
|
-
|
21
|
+
generate_stdin(wavedrom_cli, format.to_s, source.to_s) do |tool_path, output_path|
|
22
|
+
{
|
23
|
+
:args => [Platform.native_path(tool_path), '--input', '-', "--#{format.to_s}", Platform.native_path(output_path)],
|
24
|
+
:chdir => source.base_dir
|
25
|
+
}
|
23
26
|
end
|
24
27
|
else
|
25
28
|
wavedrom_cli = source.find_command('wavedrom', :raise_on_error => false)
|
@@ -27,7 +30,10 @@ module Asciidoctor
|
|
27
30
|
|
28
31
|
if wavedrom_cli && !wavedrom_cli.include?('WaveDromEditor') && phantomjs
|
29
32
|
generate_file(wavedrom_cli, 'wvd', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
30
|
-
|
33
|
+
{
|
34
|
+
:args => [phantomjs, Platform.native_path(tool_path), '-i', Platform.native_path(input_path), "-#{format.to_s[0]}", Platform.native_path(output_path)],
|
35
|
+
:chdir => source.base_dir
|
36
|
+
}
|
31
37
|
end
|
32
38
|
else
|
33
39
|
if ::Asciidoctor::Diagram::Platform.os == :macosx
|
@@ -40,7 +46,10 @@ module Asciidoctor
|
|
40
46
|
end
|
41
47
|
|
42
48
|
generate_file(wavedrom, 'wvd', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
43
|
-
|
49
|
+
{
|
50
|
+
:args => [tool_path, 'source', Platform.native_path(input_path), format.to_s, Platform.native_path(output_path)],
|
51
|
+
:chdir => source.base_dir
|
52
|
+
}
|
44
53
|
end
|
45
54
|
end
|
46
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-diagram
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pepijn Van Eeckhoudt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|