lib/jekyll-diagrams/vega.rb in jekyll-diagrams-0.9.0 vs lib/jekyll-diagrams/vega.rb in jekyll-diagrams-0.9.1

- old
+ new

@@ -2,25 +2,23 @@ module Diagrams class VegaBlock < Block CONFIGURATIONS = %w( scale ) def render_svg(code, config) + code = render_with_stdin_stdout('vl2vg', code) if block_name == 'vegalite' command = build_command(config) render_with_stdin_stdout(command, code) end def build_command(config) - command = case block_name - when 'vega' - 'vg2svg' - when 'vegalite' - 'vl2svg' - end + command = 'vg2svg' CONFIGURATIONS.each do |conf| command << " --#{conf} #{config[conf]}" if config.has_key?(conf) end + + command end end end end \ No newline at end of file