Sha256: 71a213a0093d88e9a6b3bb3b269fbc2ef108ccfe52905ac159b9aeaeef848828
Contents?: true
Size: 1.03 KB
Versions: 40
Compression:
Stored size: 1.03 KB
Contents
require 'rabbit/element/container-element' require 'rabbit/element/text-block-element' module Rabbit module Element class DescriptionList include ContainerElement include BlockElement def to_html(generator) "<dl>\n#{super}\n</dl>" end end class DescriptionListItem include ContainerElement include BlockElement attr_reader :term, :content def initialize(term, content) super() @term = term @content = content add_element(@term) add_element(@content) end end class DescriptionTerm include TextBlockElement def to_rd ": #{text}" end def to_html(generator) "<dt>\n#{super}\n</dt>" end end class DescriptionContent include ContainerElement include BlockElement def text super.gsub(/^/, " ") end def to_rd text.gsub(/^/, " ") end def to_html(generator) "<dd>\n#{super}\n</dd>" end end end end
Version data entries
40 entries across 40 versions & 1 rubygems