Class: Asciidoctor::Diagram::MscgenConverter
Instance Method Summary
collapse
#generate_file, #generate_file_stdout, #generate_stdin, #generate_stdin_file, #generate_stdin_stdout
#native_scaling?, #wrap_source
Instance Method Details
#collect_options(source) ⇒ Object
17
18
19
|
# File 'lib/asciidoctor-diagram/msc/converter.rb', line 17
def collect_options(source)
{:font => source.attr('font')}
end
|
#convert(source, format, options) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/asciidoctor-diagram/msc/converter.rb', line 21
def convert(source, format, options)
font = options[:font]
generate_stdin(source.find_command('mscgen', :alt_cmds => ['mscgen_js']), format.to_s, source.to_s) do |tool_path, output_path|
args = [tool_path, '-o', Platform.native_path(output_path), '-T', format.to_s]
if font
args << '-F' << font
end
args << '-'
{
:args => args,
:chdir => source.base_dir
}
end
end
|
13
14
15
|
# File 'lib/asciidoctor-diagram/msc/converter.rb', line 13
def supported_formats
[:png, :svg]
end
|