Sha256: 2cd0417d3581080dbfbc29ba2d639e42585b30f1710d018ca8e042bf0dd97eca

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

module LiquidDiagrams
  module Renderers
    class SyntraxRenderer < BasicRenderer
      OPTIONS = %w[
        scale
        style
      ].freeze

      def render
        Rendering.render_with_tempfile(build_command, @content) do |input, output|
          "--input #{input} --output #{output}"
        end
      end

      def build_command
        command = +'syntrax'

        @config.slice(*OPTIONS).each do |opt, value|
          command << " --#{opt} #{value}"
        end

        command
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
liquid-diagrams-0.3.0 lib/liquid_diagrams/renderers/syntrax_renderer.rb
liquid-diagrams-0.2.0 lib/liquid_diagrams/renderers/syntrax_renderer.rb
liquid-diagrams-0.1.0 lib/liquid_diagrams/renderers/syntrax_renderer.rb