class Asciidoctor::Diagram::SvgbobConverter
@private
Constants
- OPTIONS
Public Instance Methods
collect_options(source)
click to toggle source
# File lib/asciidoctor-diagram/svgbob/converter.rb, line 28 def collect_options(source) options = {} OPTIONS.keys.each do |option| attr_name = option.to_s.tr('_', '-') options[option] = source.attr(attr_name) || source.attr(attr_name, nil, 'svgbob-option') end options end
convert(source, format, options)
click to toggle source
# File lib/asciidoctor-diagram/svgbob/converter.rb, line 40 def convert(source, format, options) return source.to_s if format == :txt flags = [] options.each do |option, value| OPTIONS[option].call(flags, value) end generate_stdin(source.find_command('svgbob', :alt_cmds => ['svgbob_cli']), format.to_s, source.to_s) do |tool_path, output_path| { :args => ([tool_path, '-o', Platform.native_path(output_path)] + flags), :chdir => source.base_dir } end end
native_scaling?()
click to toggle source
# File lib/asciidoctor-diagram/svgbob/converter.rb, line 17 def native_scaling? true end
supported_formats()
click to toggle source
# File lib/asciidoctor-diagram/svgbob/converter.rb, line 13 def supported_formats [:svg, :txt] end