Public: Methods for managing the a cell in an AsciiDoc table.
# File lib/asciidoctor/table.rb, line 193 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 # only allow AsciiDoc cells in non-header rows if @attributes['style'] == :asciidoc && !column.table.header_row? # FIXME hide doctitle from nested document; temporary workaround to fix # nested document seeing doctitle and assuming it has its own document title parent_doctitle = @document.attributes.delete('doctitle') @inner_document = Document.new(@text, :header_footer => false, :parent => @document) @document.attributes['doctitle'] = parent_doctitle unless parent_doctitle.nil? end end
Public: Handles the body data (tbody, tfoot), applying styles and partitioning into paragraphs
# File lib/asciidoctor/table.rb, line 229 def content style = attr('style') if style == :asciidoc @inner_document.render else text.split(BLANK_LINE_PATTERN).map {|p| !style || style == :header ? p : Inline.new(parent, :quoted, p, :type => attr('style')).render } end end
Generated with the Darkfish Rdoc Generator 2.