class Asciidoctor::Diagram::SyntraxConverter

@private

Public Instance Methods

collect_options(source, name) click to toggle source
# File lib/asciidoctor-diagram/syntrax/converter.rb, line 17
def collect_options(source, name)
  {
      :heading => source.attr('heading', nil, name),
      :scale => source.attr('scale', nil, name),
      :transparent => source.attr('transparent', nil, name),
      :style => source.attr('style', nil, name)
  }
end
convert(source, format, options) click to toggle source
# File lib/asciidoctor-diagram/syntrax/converter.rb, line 27
def convert(source, format, options)
  generate_file(source.find_command('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 = options[:heading]
    if title
      args << '--title' << title
    end

    scale = options[:scale]
    if scale
      args << '--scale' << scale
    end

    transparent = options[:transparent]
    if transparent == 'true'
      args << '--transparent'
    end
    style = options[:style]
    if style
      args << '--style' << style
    end

    args
  end
end
supported_formats() click to toggle source
# File lib/asciidoctor-diagram/syntrax/converter.rb, line 13
def supported_formats
  [:png, :svg]
end