asciidoctor-diagram 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +77 -1
- data/README.adoc +25 -483
- data/Rakefile +1 -1
- data/docs/antora.yml +3 -0
- data/{images → docs/modules/ROOT/images}/asciidoctor-diagram-classes.png +0 -0
- data/docs/modules/ROOT/images/asciidoctor-diagram-process.png +0 -0
- data/docs/modules/ROOT/pages/index.adoc +21 -0
- data/docs/modules/ROOT/partials/advanced.adoc +303 -0
- data/docs/modules/ROOT/partials/create_diagram.adoc +131 -0
- data/docs/modules/ROOT/partials/generate.adoc +15 -0
- data/docs/modules/ROOT/partials/installation.adoc +19 -0
- data/docs/modules/ROOT/partials/uris.adoc +38 -0
- data/examples/features.adoc +1 -1
- data/lib/asciidoctor-diagram.rb +4 -0
- data/lib/asciidoctor-diagram/a2s/converter.rb +10 -6
- data/lib/asciidoctor-diagram/blockdiag/converter.rb +1 -1
- data/lib/asciidoctor-diagram/bpmn/converter.rb +4 -4
- 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 +5 -1
- data/lib/asciidoctor-diagram/diagram_processor.rb +106 -51
- data/lib/asciidoctor-diagram/diagram_source.rb +66 -19
- data/lib/asciidoctor-diagram/ditaa/converter.rb +20 -7
- data/lib/asciidoctor-diagram/ditaa/ditaa-1.3.17.jar +0 -0
- 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/gnuplot/converter.rb +8 -8
- data/lib/asciidoctor-diagram/graphviz/converter.rb +2 -2
- data/lib/asciidoctor-diagram/http/converter.rb +93 -0
- data/lib/asciidoctor-diagram/http/server.rb +10 -5
- data/lib/asciidoctor-diagram/lilypond/converter.rb +13 -3
- data/lib/asciidoctor-diagram/meme/converter.rb +24 -18
- data/lib/asciidoctor-diagram/mermaid/converter.rb +45 -14
- data/lib/asciidoctor-diagram/msc/converter.rb +2 -2
- data/lib/asciidoctor-diagram/pikchr.rb +7 -0
- data/lib/asciidoctor-diagram/pikchr/converter.rb +33 -0
- data/lib/asciidoctor-diagram/pikchr/extension.rb +14 -0
- data/lib/asciidoctor-diagram/plantuml/converter.rb +22 -14
- data/lib/asciidoctor-diagram/plantuml/plantuml-1.3.17.jar +0 -0
- data/lib/asciidoctor-diagram/smcat/converter.rb +3 -3
- data/lib/asciidoctor-diagram/svgbob/converter.rb +29 -1
- 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 +9 -6
- data/lib/asciidoctor-diagram/tikz/converter.rb +20 -1
- data/lib/asciidoctor-diagram/umlet/converter.rb +11 -2
- data/lib/asciidoctor-diagram/util/cli.rb +29 -3
- data/lib/asciidoctor-diagram/util/cli_generator.rb +22 -2
- data/lib/asciidoctor-diagram/util/gif.rb +2 -2
- data/lib/asciidoctor-diagram/util/java.rb +118 -3
- data/lib/asciidoctor-diagram/util/java_jruby.rb +4 -1
- data/lib/asciidoctor-diagram/util/java_socket.rb +9 -110
- data/lib/asciidoctor-diagram/util/pdf.rb +2 -2
- data/lib/asciidoctor-diagram/util/png.rb +2 -2
- data/lib/{server-1.3.14.jar → asciidoctor-diagram/util/server-1.3.17.jar} +0 -0
- data/lib/asciidoctor-diagram/util/svg.rb +66 -18
- data/lib/asciidoctor-diagram/vega/converter.rb +2 -2
- data/lib/asciidoctor-diagram/version.rb +1 -1
- data/spec/a2s_spec.rb +5 -143
- data/spec/blockdiag_spec.rb +5 -203
- data/spec/bpmn_spec.rb +52 -92
- 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 +5 -202
- data/spec/gnuplot_spec.rb +2 -255
- data/spec/graphviz_spec.rb +6 -145
- data/spec/lilypond_spec.rb +5 -143
- data/spec/mermaid_spec.rb +68 -210
- data/spec/msc_spec.rb +2 -199
- data/spec/nomnoml_spec.rb +4 -142
- data/spec/pikchr_spec.rb +69 -0
- data/spec/plantuml_spec.rb +6 -578
- data/spec/shaape_spec.rb +12 -224
- data/spec/shared_examples.rb +603 -0
- data/spec/smcat_spec.rb +2 -140
- data/spec/svgbob_spec.rb +5 -143
- data/spec/symbolator_spec.rb +23 -0
- data/spec/syntrax_spec.rb +7 -217
- data/spec/test_helper.rb +4 -28
- data/spec/tikz_spec.rb +68 -18
- data/spec/umlet_spec.rb +2 -58
- data/spec/vega_spec.rb +4 -117
- data/spec/wavedrom_spec.rb +2 -199
- metadata +80 -15
- data/README_zh-CN.adoc +0 -336
- data/images/asciidoctor-diagram-process.png +0 -0
- data/lib/batik-all-1.10.jar +0 -0
- data/lib/ditaa-1.3.14.jar +0 -0
- data/lib/ditaamini-0.12.jar +0 -0
- data/lib/jlatexmath-minimal-1.0.5.jar +0 -0
- data/lib/plantuml-1.3.14.jar +0 -0
- data/lib/plantuml.jar +0 -0
- data/spec/bpmn-example.xml +0 -44
@@ -15,42 +15,50 @@ module Asciidoctor
|
|
15
15
|
end
|
16
16
|
|
17
17
|
|
18
|
-
def collect_options(source
|
19
|
-
bg_img = source.attr('background'
|
18
|
+
def collect_options(source)
|
19
|
+
bg_img = source.attr('background')
|
20
20
|
raise "background attribute is required" unless bg_img
|
21
21
|
|
22
|
-
options = source.attr('options', ''
|
22
|
+
options = source.attr('options', '').split(',')
|
23
23
|
|
24
24
|
{
|
25
25
|
:bg_img => bg_img,
|
26
26
|
:top_label => source.attr('top'),
|
27
27
|
:bottom_label => source.attr('bottom'),
|
28
|
-
:fill_color => source.attr('fillcolor',
|
29
|
-
:stroke_color => source.attr('strokecolor',
|
30
|
-
:stroke_width => source.attr('strokewidth',
|
31
|
-
:font => source.attr('font', 'Impact'
|
28
|
+
:fill_color => source.attr(['fillcolor', 'fill-color']),
|
29
|
+
:stroke_color => source.attr(['strokecolor', 'stroke-color']),
|
30
|
+
:stroke_width => source.attr(['strokewidth', 'stroke-width']),
|
31
|
+
:font => source.attr('font', 'Impact'),
|
32
32
|
:noupcase => options.include?('noupcase'),
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
36
36
|
def convert(source, format, options)
|
37
|
-
|
38
|
-
|
37
|
+
magick = source.find_command('magick', :raise_on_error => false)
|
38
|
+
if magick
|
39
|
+
convert = ->(*args) { Cli.run(magick, 'convert', *args) }
|
40
|
+
identify = ->(*args) { Cli.run(magick, 'identify', *args) }
|
41
|
+
else
|
42
|
+
convert_cmd = source.find_command('convert')
|
43
|
+
convert = ->(*args) { Cli.run(convert_cmd, *args) }
|
44
|
+
identify_cmd = source.find_command('identify')
|
45
|
+
identify = ->(*args) { Cli.run(identify_cmd, *args) }
|
46
|
+
end
|
39
47
|
|
40
48
|
bg_img = options[:bg_img]
|
41
49
|
raise "background attribute is required" unless bg_img
|
42
50
|
|
43
51
|
bg_img = source.resolve_path(bg_img, source.attr('imagesdir'))
|
44
52
|
|
45
|
-
top_label = options[:
|
46
|
-
bottom_label = options[:
|
53
|
+
top_label = options[:top_label]
|
54
|
+
bottom_label = options[:bottom_label]
|
47
55
|
fill_color = options[:fill_color] || 'white'
|
48
56
|
stroke_color = options[:stroke_color] || 'black'
|
49
57
|
stroke_width = options[:stroke_width] || '2'
|
50
58
|
font = options[:font] || 'Impact'
|
51
59
|
noupcase = options[:noupcase]
|
52
60
|
|
53
|
-
dimensions =
|
61
|
+
dimensions = identify.call('-format', '%w %h', bg_img)[:out].match(/(?<w>\d+) (?<h>\d+)/)
|
54
62
|
bg_width = dimensions['w'].to_i
|
55
63
|
bg_height = dimensions['h'].to_i
|
56
64
|
label_width = bg_width
|
@@ -58,8 +66,7 @@ module Asciidoctor
|
|
58
66
|
|
59
67
|
if top_label
|
60
68
|
top_img = Tempfile.new(['meme', '.png'])
|
61
|
-
|
62
|
-
convert,
|
69
|
+
convert.call(
|
63
70
|
'-background', 'none',
|
64
71
|
'-fill', fill_color,
|
65
72
|
'-stroke', stroke_color,
|
@@ -76,8 +83,7 @@ module Asciidoctor
|
|
76
83
|
|
77
84
|
if bottom_label
|
78
85
|
bottom_img = Tempfile.new(['meme', '.png'])
|
79
|
-
|
80
|
-
convert,
|
86
|
+
convert.call(
|
81
87
|
'-background', 'none',
|
82
88
|
'-fill', fill_color,
|
83
89
|
'-stroke', stroke_color,
|
@@ -94,7 +100,7 @@ module Asciidoctor
|
|
94
100
|
|
95
101
|
final_img = Tempfile.new(['meme', ".#{format.to_s}"])
|
96
102
|
|
97
|
-
args = [
|
103
|
+
args = [bg_img]
|
98
104
|
if top_img
|
99
105
|
args << top_img.path << '-geometry' << '+0+0' << '-composite'
|
100
106
|
end
|
@@ -105,7 +111,7 @@ module Asciidoctor
|
|
105
111
|
|
106
112
|
args << final_img.path
|
107
113
|
|
108
|
-
|
114
|
+
convert.call(*args)
|
109
115
|
|
110
116
|
File.binread(final_img)
|
111
117
|
end
|
@@ -15,18 +15,26 @@ module Asciidoctor
|
|
15
15
|
[:png, :svg]
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
18
|
+
def native_scaling?
|
19
|
+
true
|
20
|
+
end
|
21
|
+
|
22
|
+
def collect_options(source)
|
19
23
|
options = {}
|
20
24
|
|
21
|
-
options[:css] = source.attr('css'
|
22
|
-
options[:gantt_config] = source.attr('ganttconfig',
|
23
|
-
options[:seq_config] = source.attr('sequenceconfig',
|
24
|
-
options[:width] = source.attr('width'
|
25
|
-
options[:height] = source.attr('height'
|
26
|
-
options[:
|
27
|
-
options[:
|
28
|
-
|
29
|
-
|
25
|
+
options[:css] = source.attr('css')
|
26
|
+
options[:gantt_config] = source.attr(['ganttconfig', 'gantt-config'])
|
27
|
+
options[:seq_config] = source.attr(['sequenceconfig', 'sequence-config'])
|
28
|
+
options[:width] = source.attr('width')
|
29
|
+
options[:height] = source.attr('height')
|
30
|
+
options[:scale] = source.attr('scale')
|
31
|
+
if options[:scale]
|
32
|
+
raise "Mermaid only supports integer scale factors: #{options[:scale]}" unless options[:scale] =~ /^[0-9]+$/
|
33
|
+
end
|
34
|
+
options[:theme] = source.attr('theme')
|
35
|
+
options[:background] = source.attr('background')
|
36
|
+
options[:config] = source.attr('config')
|
37
|
+
options[:puppeteer_config] = source.attr(['puppeteerconfig', 'puppeteer-config'])
|
30
38
|
|
31
39
|
options
|
32
40
|
end
|
@@ -56,9 +64,17 @@ module Asciidoctor
|
|
56
64
|
|
57
65
|
opts[:width] = options[:width]
|
58
66
|
|
59
|
-
mmdc =
|
67
|
+
mmdc = nil
|
68
|
+
mmdc_exception = nil
|
69
|
+
begin
|
70
|
+
mmdc = source.find_command('mmdc')
|
71
|
+
rescue => e
|
72
|
+
mmdc_exception = e
|
73
|
+
end
|
74
|
+
|
60
75
|
if mmdc
|
61
76
|
opts[:height] = options[:height]
|
77
|
+
opts[:scale] = options[:scale]
|
62
78
|
opts[:theme] = options[:theme]
|
63
79
|
opts[:background] = options[:background]
|
64
80
|
config = options[:config]
|
@@ -67,8 +83,16 @@ module Asciidoctor
|
|
67
83
|
end
|
68
84
|
run_mmdc(mmdc, source, format, opts)
|
69
85
|
else
|
70
|
-
|
71
|
-
|
86
|
+
begin
|
87
|
+
mermaid = source.find_command('mermaid')
|
88
|
+
run_mermaid(mermaid, source, format, opts)
|
89
|
+
rescue
|
90
|
+
if mmdc_exception
|
91
|
+
raise mmdc_exception
|
92
|
+
else
|
93
|
+
raise
|
94
|
+
end
|
95
|
+
end
|
72
96
|
end
|
73
97
|
end
|
74
98
|
|
@@ -93,6 +117,10 @@ module Asciidoctor
|
|
93
117
|
args << '--height' << options[:height]
|
94
118
|
end
|
95
119
|
|
120
|
+
if options[:scale]
|
121
|
+
args << '--scale' << options[:scale]
|
122
|
+
end
|
123
|
+
|
96
124
|
if options[:background]
|
97
125
|
bg = options[:background]
|
98
126
|
bg = "##{bg}" unless bg[0] == '#'
|
@@ -134,7 +162,10 @@ module Asciidoctor
|
|
134
162
|
args << '--puppeteerConfigFile' << Platform.native_path(options[:puppeteer])
|
135
163
|
end
|
136
164
|
|
137
|
-
|
165
|
+
{
|
166
|
+
:args => args,
|
167
|
+
:env => {'NODE_OPTIONS' => '--unhandled-rejections=strict'}
|
168
|
+
}
|
138
169
|
end
|
139
170
|
end
|
140
171
|
|
@@ -0,0 +1,33 @@
|
|
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 PikchrConverter
|
9
|
+
include DiagramConverter
|
10
|
+
include CliGenerator
|
11
|
+
|
12
|
+
|
13
|
+
def supported_formats
|
14
|
+
[:svg]
|
15
|
+
end
|
16
|
+
|
17
|
+
def convert(source, format, options)
|
18
|
+
pikchr_path = source.find_command('pikchr')
|
19
|
+
|
20
|
+
output = generate_file_stdout(pikchr_path, format.to_s, source.to_s) do |tool_path, input_path|
|
21
|
+
[tool_path, "--svg-only", input_path]
|
22
|
+
end
|
23
|
+
|
24
|
+
if output.start_with? '<svg'
|
25
|
+
output
|
26
|
+
else
|
27
|
+
error = output.gsub(/<\/?[a-z]+>\n?/i, '')
|
28
|
+
raise error
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require_relative 'converter'
|
2
|
+
require_relative '../diagram_processor'
|
3
|
+
|
4
|
+
module Asciidoctor
|
5
|
+
module Diagram
|
6
|
+
class PikchrBlockProcessor < DiagramBlockProcessor
|
7
|
+
use_converter PikchrConverter
|
8
|
+
end
|
9
|
+
|
10
|
+
class PikchrBlockMacroProcessor < DiagramBlockMacroProcessor
|
11
|
+
use_converter PikchrConverter
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -7,23 +7,29 @@ module Asciidoctor
|
|
7
7
|
class PlantUmlConverter
|
8
8
|
include DiagramConverter
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
CLASSPATH_ENV = 'DIAGRAM_PLANTUML_CLASSPATH'
|
11
|
+
LIB_DIR = File.expand_path('../..', File.dirname(__FILE__))
|
12
|
+
PLANTUML_JARS = if ENV.has_key?(CLASSPATH_ENV)
|
13
|
+
ENV[CLASSPATH_ENV].split(File::PATH_SEPARATOR)
|
14
|
+
else
|
15
|
+
begin
|
16
|
+
require 'asciidoctor-diagram/plantuml/classpath'
|
17
|
+
::Asciidoctor::Diagram::PlantUmlClasspath::JAR_FILES
|
18
|
+
rescue LoadError
|
19
|
+
raise "Could not load PlantUML. Eiter require 'asciidoctor-diagram-plantuml' or specify the location of the PlantUML JAR(s) using the 'DIAGRAM_PLANTUML_CLASSPATH' environment variable."
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Java.classpath.concat Dir[File.join(File.dirname(__FILE__), '*.jar')].freeze
|
24
|
+
Java.classpath.concat PLANTUML_JARS
|
19
25
|
|
20
26
|
def supported_formats
|
21
|
-
[:png, :svg, :txt]
|
27
|
+
[:png, :svg, :txt, :atxt, :utxt]
|
22
28
|
end
|
23
29
|
|
24
|
-
def collect_options(source
|
30
|
+
def collect_options(source)
|
25
31
|
{
|
26
|
-
:config => source.attr('plantumlconfig', nil, true) || source.attr('config'
|
32
|
+
:config => source.attr('plantumlconfig', nil, true) || source.attr('config')
|
27
33
|
}
|
28
34
|
end
|
29
35
|
|
@@ -37,8 +43,10 @@ module Asciidoctor
|
|
37
43
|
mime_type = 'image/png'
|
38
44
|
when :svg
|
39
45
|
mime_type = 'image/svg+xml'
|
40
|
-
when :txt
|
46
|
+
when :txt, :utxt
|
41
47
|
mime_type = 'text/plain;charset=utf-8'
|
48
|
+
when :atxt
|
49
|
+
mime_type = 'text/plain'
|
42
50
|
else
|
43
51
|
raise "Unsupported format: #{format}"
|
44
52
|
end
|
@@ -76,7 +84,7 @@ module Asciidoctor
|
|
76
84
|
code = "@start#{tag}\n#{code}\n@end#{tag}" unless code.index("@start") && code.index("@end")
|
77
85
|
|
78
86
|
code.gsub!(/(?<=<img:)[^>]+(?=>)/) do |match|
|
79
|
-
resolve_path(match, source, source.attr('imagesdir'))
|
87
|
+
resolve_path(match, source, source.attr('imagesdir', nil, false))
|
80
88
|
end
|
81
89
|
|
82
90
|
code.gsub!(/(?:(?<=!include\s)|(?<=!includesub\s))\s*[^<][^!\n\r]+/) do |match|
|
Binary file
|
@@ -14,10 +14,10 @@ module Asciidoctor
|
|
14
14
|
[:svg]
|
15
15
|
end
|
16
16
|
|
17
|
-
def collect_options(source
|
17
|
+
def collect_options(source)
|
18
18
|
{
|
19
|
-
:direction => source.attr('direction'
|
20
|
-
:engine => source.attr('engine'
|
19
|
+
:direction => source.attr('direction'),
|
20
|
+
:engine => source.attr('engine')
|
21
21
|
}
|
22
22
|
end
|
23
23
|
|
@@ -14,10 +14,38 @@ module Asciidoctor
|
|
14
14
|
[:svg]
|
15
15
|
end
|
16
16
|
|
17
|
+
def native_scaling?
|
18
|
+
true
|
19
|
+
end
|
20
|
+
|
21
|
+
OPTIONS = {
|
22
|
+
:font_family => lambda { |o, v| o << '--font-family' << v if v },
|
23
|
+
:font_size => lambda { |o, v| o << '--font-size' << v if v },
|
24
|
+
:stroke_width => lambda { |o, v| o << '--stroke-width' << v if v },
|
25
|
+
:scale => lambda { |o, v| o << '--scale' << v if v }
|
26
|
+
}
|
27
|
+
|
28
|
+
def collect_options(source)
|
29
|
+
options = {}
|
30
|
+
|
31
|
+
OPTIONS.keys.each do |option|
|
32
|
+
attr_name = option.to_s.tr('_', '-')
|
33
|
+
options[option] = source.attr(attr_name) || source.attr(attr_name, nil, 'svgbob-option')
|
34
|
+
end
|
35
|
+
|
36
|
+
options
|
37
|
+
end
|
38
|
+
|
17
39
|
|
18
40
|
def convert(source, format, options)
|
41
|
+
|
42
|
+
flags = []
|
43
|
+
options.each do |option, value|
|
44
|
+
OPTIONS[option].call(flags, value)
|
45
|
+
end
|
46
|
+
|
19
47
|
generate_stdin(source.find_command('svgbob'), format.to_s, source.to_s) do |tool_path, output_path|
|
20
|
-
[tool_path, '-o', Platform.native_path(output_path)]
|
48
|
+
([tool_path, '-o', Platform.native_path(output_path)] + flags)
|
21
49
|
end
|
22
50
|
end
|
23
51
|
end
|
@@ -0,0 +1,23 @@
|
|
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 SymbolatorConverter
|
9
|
+
include DiagramConverter
|
10
|
+
include CliGenerator
|
11
|
+
|
12
|
+
def supported_formats
|
13
|
+
[:png, :pdf, :svg]
|
14
|
+
end
|
15
|
+
|
16
|
+
def convert(source, format, options)
|
17
|
+
generate_stdin(source.find_command('symbolator'), format.to_s, source.to_s) do |tool_path, output_path|
|
18
|
+
[tool_path, "-i-", "-o#{Platform.native_path(output_path)}", "-f#{format.to_s}"]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require_relative '../diagram_processor'
|
2
|
+
require_relative 'converter'
|
3
|
+
|
4
|
+
module Asciidoctor
|
5
|
+
module Diagram
|
6
|
+
class SymbolatorBlockProcessor < DiagramBlockProcessor
|
7
|
+
use_converter SymbolatorConverter
|
8
|
+
end
|
9
|
+
|
10
|
+
class SymbolatorBlockMacroProcessor < DiagramBlockMacroProcessor
|
11
|
+
use_converter SymbolatorConverter
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -14,16 +14,15 @@ module Asciidoctor
|
|
14
14
|
[:png, :svg]
|
15
15
|
end
|
16
16
|
|
17
|
-
def collect_options(source
|
17
|
+
def collect_options(source)
|
18
18
|
{
|
19
|
-
:heading => source.attr('heading'
|
20
|
-
:scale => source.attr('scale'
|
21
|
-
:transparent => source.attr('transparent'
|
22
|
-
:style => source.attr('style'
|
19
|
+
:heading => source.attr('heading'),
|
20
|
+
:scale => source.attr('scale'),
|
21
|
+
:transparent => source.attr('transparent'),
|
22
|
+
:style => source.attr('style')
|
23
23
|
}
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
26
|
def convert(source, format, options)
|
28
27
|
generate_file(source.find_command('syntrax'), 'spec', format.to_s, source.to_s) do |tool_path, input_path, output_path|
|
29
28
|
args = [tool_path, '-i', Platform.native_path(input_path), '-o', Platform.native_path(output_path)]
|
@@ -50,6 +49,10 @@ module Asciidoctor
|
|
50
49
|
args
|
51
50
|
end
|
52
51
|
end
|
52
|
+
|
53
|
+
def native_scaling?
|
54
|
+
true
|
55
|
+
end
|
53
56
|
end
|
54
57
|
end
|
55
58
|
end
|