asciidoctor-diagram 2.2.8 → 2.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +7 -0
- data/lib/asciidoctor-diagram/d2/converter.rb +1 -1
- data/lib/asciidoctor-diagram/diagram_processor.rb +6 -0
- data/lib/asciidoctor-diagram/diagram_source.rb +8 -0
- data/lib/asciidoctor-diagram/structurizr/converter.rb +2 -2
- data/lib/asciidoctor-diagram/structurizr/extension.rb +1 -1
- data/lib/asciidoctor-diagram/version.rb +1 -1
- data/spec/a2s_spec.rb +1 -1
- data/spec/barcode_spec.rb +1 -1
- data/spec/blockdiag_spec.rb +1 -1
- data/spec/bpmn_spec.rb +1 -1
- data/spec/bytefield_spec.rb +1 -1
- data/spec/d2_spec.rb +29 -2
- data/spec/dbml_spec.rb +1 -1
- data/spec/diagrams_spec.rb +1 -1
- data/spec/ditaa_spec.rb +1 -1
- data/spec/dpic_spec.rb +1 -1
- data/spec/erd_spec.rb +1 -1
- data/spec/gnuplot_spec.rb +1 -1
- data/spec/graphviz_py_spec.rb +1 -1
- data/spec/graphviz_spec.rb +1 -1
- data/spec/lilypond_spec.rb +1 -1
- data/spec/meme_spec.rb +1 -1
- data/spec/mermaid_spec.rb +1 -1
- data/spec/msc_spec.rb +1 -1
- data/spec/nomnoml_spec.rb +1 -1
- data/spec/pikchr_spec.rb +1 -1
- data/spec/plantuml_spec.rb +1 -1
- data/spec/shaape_spec.rb +1 -1
- data/spec/shared_examples.rb +3 -1
- data/spec/smcat_spec.rb +1 -1
- data/spec/structurizr_spec.rb +41 -0
- data/spec/svgbob_spec.rb +1 -1
- data/spec/symbolator_spec.rb +1 -1
- data/spec/syntrax_spec.rb +1 -1
- data/spec/{test_helper.rb → test_helper_methods.rb} +2 -0
- data/spec/tikz_spec.rb +1 -1
- data/spec/umlet_spec.rb +1 -1
- data/spec/vega_spec.rb +1 -1
- data/spec/wavedrom_spec.rb +1 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f5d112b2ce57cb2380687fce2fac5fe15f2f6d2c6198f722edd5aeaa08d6b7d
|
4
|
+
data.tar.gz: 8d45d7df6757adfb72c0c4c4b9ba95bab649fe6a1686418f2a4ffc49fc20facb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56d0bffc577cd54b56853b02454760767ff5642c935eb57e9909a0aad974ad598897e2d5f312c780471f55318de0789df39e760b917e846ec702ad0ee1640a7f
|
7
|
+
data.tar.gz: 67496690a923714ba8b3757781b674862dc318680797bb118ecc00d834125b42d27770465b57db440b47ce0df3e4eebab8658d7a2aec8e5cf610bef886005655
|
data/CHANGELOG.adoc
CHANGED
@@ -33,7 +33,7 @@ module Asciidoctor
|
|
33
33
|
options.each_pair do |key, value|
|
34
34
|
flag = "--#{key.to_s.gsub('_', '-')}"
|
35
35
|
|
36
|
-
if key == :sketch && value != 'false'
|
36
|
+
if key == :sketch && !value.nil? && value != 'false'
|
37
37
|
args << flag
|
38
38
|
elsif key.to_s.start_with?('font') && !value.nil?
|
39
39
|
args << Platform.native_path(value)
|
@@ -64,6 +64,12 @@ module Asciidoctor
|
|
64
64
|
location = parent.document.reader.cursor_at_mark
|
65
65
|
|
66
66
|
normalised_attributes = attributes.inject({}) { |h, (k, v)| h[normalise_attribute_name(k)] = v; h }
|
67
|
+
pos_attr_index = config.fetch(:positional_attrs, []).length + 1
|
68
|
+
until attributes[pos_attr_index].nil?
|
69
|
+
normalised_attributes[attributes[pos_attr_index]] = 'true'
|
70
|
+
pos_attr_index = pos_attr_index + 1
|
71
|
+
end
|
72
|
+
|
67
73
|
converter = config[:converter].new
|
68
74
|
|
69
75
|
supported_formats = supported_formats(converter)
|
@@ -193,6 +193,14 @@ module Asciidoctor
|
|
193
193
|
name = [name] unless name.is_a?(Enumerable)
|
194
194
|
|
195
195
|
value = name.lazy.map { |n| @attributes[n] }.reject { |v| v.nil? }.first
|
196
|
+
if value.nil?
|
197
|
+
attr_position = config[:positional_attrs] || 1
|
198
|
+
while value.nil? && !@attributes[attr_position].nil?
|
199
|
+
if @attributes[attr_position] == name
|
200
|
+
value = true
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
196
204
|
|
197
205
|
if value.nil? && inherit
|
198
206
|
inherited_values = name.lazy.map do |n|
|
@@ -17,7 +17,7 @@ module Asciidoctor
|
|
17
17
|
ENV[CLASSPATH_ENV].split(File::PATH_SEPARATOR)
|
18
18
|
elsif ENV.has_key?(CLI_HOME_ENV)
|
19
19
|
lib_dir = File.expand_path('lib', ENV[CLI_HOME_ENV])
|
20
|
-
Dir.
|
20
|
+
Dir[File.join(lib_dir, '*.jar')]
|
21
21
|
else
|
22
22
|
nil
|
23
23
|
end
|
@@ -52,7 +52,7 @@ module Asciidoctor
|
|
52
52
|
|
53
53
|
response = Java.send_request(
|
54
54
|
:url => '/structurizr',
|
55
|
-
:body => source.
|
55
|
+
:body => source.code,
|
56
56
|
:headers => headers
|
57
57
|
)
|
58
58
|
|
data/spec/a2s_spec.rb
CHANGED
data/spec/barcode_spec.rb
CHANGED
data/spec/blockdiag_spec.rb
CHANGED
data/spec/bpmn_spec.rb
CHANGED
data/spec/bytefield_spec.rb
CHANGED
data/spec/d2_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'test_helper_methods'
|
2
2
|
|
3
3
|
D2_CODE = <<-eos
|
4
4
|
# Actors
|
@@ -35,6 +35,31 @@ end
|
|
35
35
|
describe Asciidoctor::Diagram::D2BlockProcessor, :broken_on_windows do
|
36
36
|
include_examples "block", :d2, D2_CODE, [:svg]
|
37
37
|
|
38
|
+
it "should not use sketch mode by default" do
|
39
|
+
doc = <<-eos
|
40
|
+
= Hello, D2!
|
41
|
+
Doc Writer <doc@example.com>
|
42
|
+
|
43
|
+
== First Section
|
44
|
+
|
45
|
+
[d2]
|
46
|
+
----
|
47
|
+
#{D2_CODE}
|
48
|
+
----
|
49
|
+
eos
|
50
|
+
|
51
|
+
d = load_asciidoc doc
|
52
|
+
expect(d).to_not be_nil
|
53
|
+
|
54
|
+
b = d.find { |bl| bl.context == :image }
|
55
|
+
expect(b).to_not be_nil
|
56
|
+
target = b.attributes['target']
|
57
|
+
expect(target).to match(/\.svg$/)
|
58
|
+
expect(File.exist?(target)).to be true
|
59
|
+
svg = File.read(target, :encoding => Encoding::UTF_8)
|
60
|
+
expect(svg).to_not match(/class='.*?sketch-overlay-B5.*?'/)
|
61
|
+
end
|
62
|
+
|
38
63
|
it "should support sketch mode" do
|
39
64
|
doc = <<-eos
|
40
65
|
= Hello, D2!
|
@@ -42,7 +67,7 @@ Doc Writer <doc@example.com>
|
|
42
67
|
|
43
68
|
== First Section
|
44
69
|
|
45
|
-
[d2, sketch
|
70
|
+
[d2, foobar, svg, sketch]
|
46
71
|
----
|
47
72
|
#{D2_CODE}
|
48
73
|
----
|
@@ -56,5 +81,7 @@ Doc Writer <doc@example.com>
|
|
56
81
|
target = b.attributes['target']
|
57
82
|
expect(target).to match(/\.svg$/)
|
58
83
|
expect(File.exist?(target)).to be true
|
84
|
+
svg = File.read(target, :encoding => Encoding::UTF_8)
|
85
|
+
expect(svg).to match(/class='.*?sketch-overlay-B5.*?'/)
|
59
86
|
end
|
60
87
|
end
|
data/spec/dbml_spec.rb
CHANGED
data/spec/diagrams_spec.rb
CHANGED
data/spec/ditaa_spec.rb
CHANGED
data/spec/dpic_spec.rb
CHANGED
data/spec/erd_spec.rb
CHANGED
data/spec/gnuplot_spec.rb
CHANGED
data/spec/graphviz_py_spec.rb
CHANGED
data/spec/graphviz_spec.rb
CHANGED
data/spec/lilypond_spec.rb
CHANGED
data/spec/meme_spec.rb
CHANGED
data/spec/mermaid_spec.rb
CHANGED
data/spec/msc_spec.rb
CHANGED
data/spec/nomnoml_spec.rb
CHANGED
data/spec/pikchr_spec.rb
CHANGED
data/spec/plantuml_spec.rb
CHANGED
data/spec/shaape_spec.rb
CHANGED
data/spec/shared_examples.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
require 'rspec'
|
2
|
+
require_relative 'test_helper_methods'
|
2
3
|
|
3
4
|
RSpec.shared_examples "block_macro" do |name, code, formats|
|
4
5
|
formats.each do |format|
|
@@ -497,6 +498,7 @@ Doc Writer <doc@example.com>
|
|
497
498
|
|
498
499
|
[#{name}, format="foobar"]
|
499
500
|
----
|
501
|
+
#{code}
|
500
502
|
----
|
501
503
|
eos
|
502
504
|
|
data/spec/smcat_spec.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
require_relative 'test_helper_methods'
|
2
|
+
|
3
|
+
STRUCTURIZR_CODE = <<-eos
|
4
|
+
workspace {
|
5
|
+
|
6
|
+
model {
|
7
|
+
user = person "User"
|
8
|
+
softwareSystem = softwareSystem "Software System" {
|
9
|
+
webapp = container "Web Application" {
|
10
|
+
user -> this "Uses"
|
11
|
+
}
|
12
|
+
container "Database" {
|
13
|
+
webapp -> this "Reads from and writes to"
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
views {
|
19
|
+
systemContext softwareSystem {
|
20
|
+
include *
|
21
|
+
autolayout lr
|
22
|
+
}
|
23
|
+
|
24
|
+
container softwareSystem {
|
25
|
+
include *
|
26
|
+
autolayout lr
|
27
|
+
}
|
28
|
+
|
29
|
+
theme default
|
30
|
+
}
|
31
|
+
|
32
|
+
}
|
33
|
+
eos
|
34
|
+
|
35
|
+
describe Asciidoctor::Diagram::StructurizrBlockMacroProcessor, :broken_on_windows, :broken_on_github do
|
36
|
+
include_examples "block_macro", :structurizr, STRUCTURIZR_CODE, [:png, :png]
|
37
|
+
end
|
38
|
+
|
39
|
+
describe Asciidoctor::Diagram::StructurizrBlockProcessor, :broken_on_windows, :broken_on_github do
|
40
|
+
include_examples "block", :structurizr, STRUCTURIZR_CODE, [:png, :png]
|
41
|
+
end
|
data/spec/svgbob_spec.rb
CHANGED
data/spec/symbolator_spec.rb
CHANGED
data/spec/syntrax_spec.rb
CHANGED
data/spec/tikz_spec.rb
CHANGED
data/spec/umlet_spec.rb
CHANGED
data/spec/vega_spec.rb
CHANGED
data/spec/wavedrom_spec.rb
CHANGED
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pepijn Van Eeckhoudt
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -284,10 +284,11 @@ files:
|
|
284
284
|
- spec/shaape_spec.rb
|
285
285
|
- spec/shared_examples.rb
|
286
286
|
- spec/smcat_spec.rb
|
287
|
+
- spec/structurizr_spec.rb
|
287
288
|
- spec/svgbob_spec.rb
|
288
289
|
- spec/symbolator_spec.rb
|
289
290
|
- spec/syntrax_spec.rb
|
290
|
-
- spec/
|
291
|
+
- spec/test_helper_methods.rb
|
291
292
|
- spec/tikz_spec.rb
|
292
293
|
- spec/umlet_spec.rb
|
293
294
|
- spec/vega_spec.rb
|
@@ -301,7 +302,7 @@ metadata:
|
|
301
302
|
documentation_uri: https://docs.asciidoctor.org/diagram-extension/latest/
|
302
303
|
homepage_uri: https://github.com/asciidoctor/asciidoctor-diagram
|
303
304
|
source_code_uri: https://github.com/asciidoctor/asciidoctor-diagram.git
|
304
|
-
post_install_message:
|
305
|
+
post_install_message:
|
305
306
|
rdoc_options: []
|
306
307
|
require_paths:
|
307
308
|
- lib
|
@@ -316,8 +317,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
317
|
- !ruby/object:Gem::Version
|
317
318
|
version: '0'
|
318
319
|
requirements: []
|
319
|
-
rubygems_version: 3.
|
320
|
-
signing_key:
|
320
|
+
rubygems_version: 3.4.13
|
321
|
+
signing_key:
|
321
322
|
specification_version: 4
|
322
323
|
summary: A family of Asciidoctor extensions that generate images from a broad range
|
323
324
|
of embedded plain text diagram descriptions, including PlantUML, ditaa, Kroki, and
|
@@ -348,10 +349,11 @@ test_files:
|
|
348
349
|
- spec/shaape_spec.rb
|
349
350
|
- spec/shared_examples.rb
|
350
351
|
- spec/smcat_spec.rb
|
352
|
+
- spec/structurizr_spec.rb
|
351
353
|
- spec/svgbob_spec.rb
|
352
354
|
- spec/symbolator_spec.rb
|
353
355
|
- spec/syntrax_spec.rb
|
354
|
-
- spec/
|
356
|
+
- spec/test_helper_methods.rb
|
355
357
|
- spec/tikz_spec.rb
|
356
358
|
- spec/umlet_spec.rb
|
357
359
|
- spec/vega_spec.rb
|