Sha256: 838101115a8962785cdeee395cbd9d72a580984fadbe010a079da43d443d1e6d

Contents?: true

Size: 1.19 KB

Versions: 16

Compression:

Stored size: 1.19 KB

Contents

@preformatted_frame_color ||= "#55003dff0eff"
@preformatted_frame_width ||= 2
@preformatted_fill_color ||= "#fcfae2"
@preformatted_shadow_color ||= nil

@preformatted_padding_left ||= screen_x(5)
@preformatted_padding_right ||= screen_x(5)
@preformatted_padding_top ||= screen_y(2)
@preformatted_padding_bottom ||= screen_y(2)

if @preformatted_keep_in_size.nil?
  @preformatted_keep_in_size = true
end

if @preformatted_centering.nil?
  @preformatted_centering = true
end

match("**", PreformattedBlock) do |blocks|
  name = "preformatted-block"
  
  blocks.horizontal_centering = @preformatted_centering

  params = {
    :proc_name => name,
    :frame_color => @preformatted_frame_color,
    :frame_width =>  @preformatted_frame_width,
    :fill_color => @preformatted_fill_color,
    :shadow_color => @preformatted_shadow_color,
  }

  padding_set(:left => @preformatted_padding_left,
              :right => @preformatted_padding_right,
              :top => @preformatted_padding_top,
              :bottom => @preformatted_padding_bottom)

  blocks.wrap_mode = false

  blocks.margin_top = @space
  blocks.margin_bottom = @space

  blocks.keep_in_size if @preformatted_keep_in_size

  draw_frame(blocks, params)
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rabbit-2.1.2 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.1.1 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.1.0 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.9 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.8 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.7 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.6 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.5 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.4 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.3 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.2 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.1 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-2.0.0 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-1.0.9 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-1.0.8 lib/rabbit/theme/default-preformatted/default-preformatted.rb
rabbit-1.0.7 lib/rabbit/theme/default-preformatted/default-preformatted.rb