Sha256: 2f9c1cf4df3abc952942661bed2d28cacbe2cbf9b19ddbad5f1d9bd2dec70ca1

Contents?: true

Size: 505 Bytes

Versions: 38

Compression:

Stored size: 505 Bytes

Contents

module Lookbook
  class Prose::Component < Lookbook::BaseComponent
    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

38 entries across 38 versions & 1 rubygems

Version Path
lookbook-1.5.5 app/components/lookbook/prose/component.rb
lookbook-1.5.4 app/components/lookbook/prose/component.rb
lookbook-1.5.3 app/components/lookbook/prose/component.rb
lookbook-1.5.2 app/components/lookbook/prose/component.rb
lookbook-1.5.1 app/components/lookbook/prose/component.rb
lookbook-1.5.0 app/components/lookbook/prose/component.rb
lookbook-1.4.5 app/components/lookbook/prose/component.rb
lookbook-1.4.4 app/components/lookbook/prose/component.rb
lookbook-1.4.3 app/components/lookbook/prose/component.rb
lookbook-1.4.2 app/components/lookbook/prose/component.rb
lookbook-1.4.1 app/components/lookbook/prose/component.rb
lookbook-1.4.0 app/components/lookbook/prose/component.rb
lookbook-1.3.4 app/components/lookbook/prose/component.rb
lookbook-1.3.3 app/components/lookbook/prose/component.rb
lookbook-1.3.1 app/components/lookbook/prose/component.rb
lookbook-1.3.0 app/components/lookbook/prose/component.rb
lookbook-1.2.1 app/components/lookbook/prose/component.rb
lookbook-1.2.0 app/components/lookbook/prose/component.rb
lookbook-1.1.1 app/components/lookbook/prose/component.rb
lookbook-1.1.0 app/components/lookbook/prose/component.rb