Sha256: 207d105d4a163a6169d96e0bbea022d0400dfa387aec26ca208b602469c3d3d8

Contents?: true

Size: 526 Bytes

Versions: 3

Compression:

Stored size: 526 Bytes

Contents

module Jekyll
  module Diagrams
    class Block < Liquid::Block
      include Renderer
      include Util

      def render(context)
        svg = render_svg(super.to_s, read_config(context))
        wrap_class(svg)
      end

      def render_svg(content, config)
        raise 'Not Implemented'
      end

      def read_config(context)
        config_for(context, block_name)
      end

      def wrap_class(content)
        "<div class='jekyll-diagrams diagrams #{block_name}'>#{content}</div>"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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