Sha256: c3097edd649c2e6ff3994df3728d881e0ca52a66e2d557bbca27cd699cfb42f9

Contents?: true

Size: 840 Bytes

Versions: 7

Compression:

Stored size: 840 Bytes

Contents

# -*- coding: utf-8 -*-

@tag_uninstall ||= false

theme_exit if @tag_uninstall

match("**", CustomTag) do |tags|
  find_block_element = lambda do |tag|
    element = tag
    while element.inline_element?
      element = element.parent
    end
    element
  end

  find_markup_target = lambda do |tag|
    if tag.elements.empty?
      tag.parent
    else
      tag
    end
  end

  tags.each do |tag|
    case tag.name
    when "center"
      find_block_element.call(tag).horizontal_centering = true
    when "right"
      find_block_element.call(tag).align = "right"
    when "x-large"
      find_markup_target.call(tag).prop_set("size", @x_large_font_size)
    when "margin-top"
      find_block_element.call(tag).margin_top += @space
    when "margin-bottom"
      find_block_element.call(tag).margin_bottom += @space
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rabbit-1.0.4 lib/rabbit/theme/tag/tag.rb
rabbit-1.0.3 lib/rabbit/theme/tag/tag.rb
rabbit-1.0.2 lib/rabbit/theme/tag/tag.rb
rabbit-1.0.1 lib/rabbit/theme/tag/tag.rb
rabbit-1.0.0 lib/rabbit/theme/tag/tag.rb
rabbit-0.9.3 lib/rabbit/theme/tag/tag.rb
rabbit-0.9.2 lib/rabbit/theme/tag/tag.rb