Sha256: d9a0ebb6495a8992eb75694eaa2764be4b19661275992e8899520b77beb566e8

Contents?: true

Size: 501 Bytes

Versions: 3

Compression:

Stored size: 501 Bytes

Contents

module Lookbook
  class Prose::Component < Lookbook::Component
    include Lookbook::OutputHelper

    def initialize(size: :md, markdown: true, **html_attrs)
      @size = size
      @markdown = markdown
      super(**html_attrs)
    end

    def rendered_content
      @markdown ? markdown(content.strip_heredoc) : helpers.raw(content)
    end

    def size_class
      case @size
      when :sm
        "prose-sm"
      when :lg
        "prose-lg"
      else
        ""
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lookbook-1.0.0.beta.2 app/components/lookbook/prose/component.rb
lookbook-1.0.0.beta.1 app/components/lookbook/prose/component.rb
lookbook-1.0.0.beta.0 app/components/lookbook/prose/component.rb