21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/asciidoctor-diagram/syntrax/extension.rb', line 21
def syntrax(parent, source, format)
inherit_prefix = name
generate_file(which(parent, 'syntrax'), 'spec', format.to_s, source.to_s) do |tool_path, input_path, output_path|
args = [tool_path, '-i', Platform.native_path(input_path), '-o', Platform.native_path(output_path)]
title = source.attr('heading', nil, inherit_prefix)
if title
args << '--title' << title
end
scale = source.attr('scale', nil, inherit_prefix)
if scale
args << '--scale' << scale
end
transparent = source.attr('transparent', nil, inherit_prefix)
if transparent == 'true'
args << '--transparent'
end
style = source.attr('style', nil, inherit_prefix)
if style
args << '--style' << style
end
args
end
end
|