class Asciidoctor::Diagram::LilypondConverter
@private
Public Instance Methods
collect_options(source)
click to toggle source
# File lib/asciidoctor-diagram/lilypond/converter.rb, line 17 def collect_options(source) { :resolution => source.attr('resolution') } end
convert(source, format, options)
click to toggle source
# File lib/asciidoctor-diagram/lilypond/converter.rb, line 23 def convert(source, format, options) code = <<-EOF \\paper{ oddFooterMarkup=##f oddHeaderMarkup=##f bookTitleMarkup=##f scoreTitleMarkup=##f } EOF code << source.to_s resolution = options[:resolution] generate_stdin(source.find_command('lilypond'), format.to_s, code) do |tool_path, output_path| args = [tool_path, '-daux-files=#f', '-dbackend=eps', '-dno-gs-load-fonts', '-dinclude-eps-fonts', '-o', Platform.native_path(output_path), '-f', format.to_s] args << '-dsafe' args << "-dresolution=#{resolution}" if resolution args << "-dpixmap-format=pngalpha" if format == :png args << '-' { :args => args, :out_file => "#{output_path}.#{format.to_s}" } end end
supported_formats()
click to toggle source
# File lib/asciidoctor-diagram/lilypond/converter.rb, line 13 def supported_formats [:png, :pdf] end