Sha256: d10b265d23893b39ebf7769e0d3c94f9dee8769fa726d849d2faf60ee67337f9

Contents?: true

Size: 575 Bytes

Versions: 3

Compression:

Stored size: 575 Bytes

Contents

module Jekyll
  module Diagrams
    class SvgbobBlock < Block
      CONFIGURATIONS = %w( font-family font-size scale stroke-width ).freeze

      def render_svg(code, config)
        command = build_command(config)

        render_with_stdin_stdout(command, code)
      end

      def build_command(config)
        command = 'svgbob'

        CONFIGURATIONS.each do |conf|
          command << " --#{conf} #{config[conf]}" if config.has_key?(conf)
        end

        command
      end
    end
  end
end

Liquid::Template.register_tag(:svgbob, Jekyll::Diagrams::SvgbobBlock)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-diagrams-0.9.1 lib/jekyll-diagrams/svgbob.rb
jekyll-diagrams-0.9.0 lib/jekyll-diagrams/svgbob.rb
jekyll-diagrams-0.8.0 lib/jekyll-diagrams/svgbob.rb