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.0.8 app/components/lookbook/prose/component.rb
lookbook-1.0.7 app/components/lookbook/prose/component.rb
lookbook-1.0.6 app/components/lookbook/prose/component.rb
lookbook-1.0.5 app/components/lookbook/prose/component.rb
lookbook-1.0.4 app/components/lookbook/prose/component.rb
lookbook-1.0.3 app/components/lookbook/prose/component.rb
lookbook-1.0.2 app/components/lookbook/prose/component.rb
lookbook-1.0.1 app/components/lookbook/prose/component.rb
lookbook-1.0.0 app/components/lookbook/prose/component.rb
lookbook-1.0.0.rc.3 app/components/lookbook/prose/component.rb
lookbook-1.0.0.rc.2 app/components/lookbook/prose/component.rb
lookbook-1.0.0.rc.1 app/components/lookbook/prose/component.rb
lookbook-1.0.0.beta.8 app/components/lookbook/prose/component.rb
lookbook-1.0.0.beta.7 app/components/lookbook/prose/component.rb
lookbook-1.0.0.beta.6 app/components/lookbook/prose/component.rb
lookbook-1.0.0.beta.5 app/components/lookbook/prose/component.rb
lookbook-1.0.0.beta.4 app/components/lookbook/prose/component.rb
lookbook-1.0.0.beta.3 app/components/lookbook/prose/component.rb