Class/Module Index [+]

Quicksearch

Asciidoctor::DocBook45::BlockOpenTemplate

Public Instance Methods

open_block(node, id, style, role, reftext, title) click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 399
  def open_block(node, id, style, role, reftext, title)
    case style
    when 'abstract'
      if node.parent == node.document && node.document.attr?('doctype', 'book')
        puts 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.'
        ''
      else
        %(<abstract>#{title && "\n<title>#{title}</title>"}
#{content node}
</abstract>\n)
      end
    when 'partintro'
      unless node.document.attr?('doctype', 'book') && node.parent.is_a?(Asciidoctor::Section) && node.level == 0
        puts 'asciidoctor: ERROR: partintro block can only be used when doctype is book and it\s a child of a part section. Excluding block content.'
        ''
      else
        %(<partintro#{common_attrs id, role, reftext}>#{title && "\n<title>#{title}</title>"}
#{content node}
</partintro>\n)
      end
    else
      node.content
    end
  end
result(node) click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 394
def result(node)
  open_block(node, node.id, (node.attr 'style', nil, false),
      (node.attr 'role'), (node.attr 'reftext'), node.title? ? node.title : nil)
end
template() click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 424
def template
  :invoke_result
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.