Public: Methods for managing the a cell in an AsciiDoc table.
Public: An Integer of the number of columns this cell will span (default: nil)
Public: The internal Asciidoctor::Document for a cell that has the asciidoc style
Public: An Integer of the number of rows this cell will span (default: nil)
# File lib/asciidoctor/table.rb, line 192 def initialize(column, text, attributes = {}) super(column, :cell) @text = text @colspan = nil @rowspan = nil # TODO feels hacky if !column.nil? update_attributes(column.attributes) end if !attributes.nil? if attributes.has_key? 'colspan' @colspan = attributes['colspan'] attributes.delete('colspan') end if attributes.has_key? 'rowspan' @rowspan = attributes['rowspan'] attributes.delete('rowspan') end update_attributes(attributes) end if @attributes['style'] == :asciidoc @inner_document = Document.new(@text, :header_footer => false, :parent => @document) end end
Public: Handles the body data (tbody, tfoot), applying styles and partitioning into paragraphs
# File lib/asciidoctor/table.rb, line 223 def content style = attr('style') if style == :asciidoc @inner_document.render else text.split(Table::BLANK_LINE_PATTERN).map {|p| !style || style == :header ? p : Inline.new(parent, :quoted, p, :type => attr('style')).render } end end
Public: Get the text with normal substitutions applied for this cell. Used for cells in the head rows
# File lib/asciidoctor/table.rb, line 218 def text apply_normal_subs(@text) end
# File lib/asciidoctor/table.rb, line 234 def to_s "#{super.to_s} - [text: #@text, colspan: #{@colspan || 1}, rowspan: #{@rowspan || 1}, attributes: #@attributes]" end