class Asciidoctor::DocBook45::SectionTemplate

Public Instance Methods

section(sec) click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 113
  def section(sec)
    if sec.special
      tag = sec.level <= 1 ? sec.sectname : 'section'
    else
      tag = sec.document.doctype == 'book' && sec.level <= 1 ? 'chapter' : 'section'
    end
    %Q(<#{tag}#{common_attrs(sec.id, (sec.attr 'role'), (sec.attr 'reftext'))}>
  #{sec.title? ? "<title>#{sec.title}</title>" : nil}
  #{sec.content}
</#{tag}>)
  end
template() click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 125
  def template
    # hot piece of code, optimized for speed
    @template ||= @eruby.new "<%#encoding:UTF-8%><%= template.section(self) %>
"
  end