class Asciidoctor::HTML5::BlockOpenTemplate

Public Instance Methods

open_block(node, id, style, role, title, content) click to toggle source
# File lib/asciidoctor/backends/html5.rb, line 575
  def open_block(node, id, style, role, title, content)
    if style == 'abstract'
      if node.parent == node.document && node.document.doctype == 'book'
        warn 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.'
        ''
      else
        %Q(<div#{id && " id=\"#{id}\""} class="quoteblock abstract#{role && " #{role}"}">#{title &&
"<div class=\"title\">#{title}</div>"}
<blockquote>
#{content}
</blockquote>
</div>)
      end
    elsif style == 'partintro' && (node.level != 0 || node.parent.context != :section || node.document.doctype != 'book')
      warn 'asciidoctor: ERROR: partintro block can only be used when doctype is book and it\s a child of a book part. Excluding block content.'
      ''
    else
      %Q(<div#{id && " id=\"#{id}\""} class="openblock#{style != 'open' ? " #{style}" : ''}#{role && " #{role}"}">#{title &&
"<div class=\"title\">#{title}</div>"}
<div class="content">
#{content}
</div>
</div>)
    end
  end
result(node) click to toggle source
# File lib/asciidoctor/backends/html5.rb, line 571
def result(node)
  open_block(node, node.id, node.style, node.role, node.title? ? node.title : nil, node.content)
end
template() click to toggle source
# File lib/asciidoctor/backends/html5.rb, line 601
def template
  :invoke_result
end