class Asciidoctor::DocBook5::DocumentTemplate

Public Instance Methods

author(indexed = false) click to toggle source
# File lib/asciidoctor/backends/docbook5.rb, line 8
  def author indexed = false
    <<-EOF
<author>
<personname>
#{tag 'firstname', indexed ? :"firstname_\#{idx}" : :firstname, indexed}
#{tag 'othername', indexed ? :"middlename_\#{idx}" : :middlename, indexed}
#{tag 'surname', indexed ? :"lastname_\#{idx}" : :lastname, indexed}
</personname>
#{tag 'email', indexed ? :"email_\#{idx}" : :email, indexed}
</author>
    EOF
  end
template() click to toggle source
# File lib/asciidoctor/backends/docbook5.rb, line 21
  def template
    @template ||= @eruby.new <<-EOF
<%#encoding:UTF-8%><?xml version="1.0" encoding="UTF-8"?><%
if attr? :toc %>
<?asciidoc-toc?><%
end
if attr? :numbered %>
<?asciidoc-numbered?><%
end
if doctype == 'book' %>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"<% unless attr? :nolang %> xml:lang="<%= attr :lang, 'en' %>"<% end %>>
<info>
#{docinfo}
</info>
<%= content.chomp %>
</book><%
else %>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"<% unless attr? :nolang %> xml:lang="<%= attr :lang, 'en' %>"<% end %>>
<info>
#{docinfo}
</info>
<%= content.chomp %>
</article><%
end %>
    EOF
  end