Files

Class/Module Index [+]

Quicksearch

Asciidoctor::DocBook45::DocumentTemplate

Public Instance Methods

author(indexed = false) click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 90
def author indexed = false
  <author>#{tag 'firstname', indexed ? :"firstname_\#{idx}" : :firstname, indexed}#{tag 'othername', indexed ? :"middlename_\#{idx}" : :middlename, indexed}#{tag 'surname', indexed ? :"lastname_\#{idx}" : :lastname, indexed}#{tag 'email', indexed ? :"email_\#{idx}" : :email, indexed}</author>
end
docinfo() click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 53
def docinfo
  <% unless notitle %><%= has_header? ? template.title_tags(@header.title) : %(<title>\#{attr 'untitled-label'}</title>) %><% endif attr? :revdate %><date><%= attr :revdate %></date><%else %><date><%= attr :docdate %></date><%endif has_header?  if attr? :author    if (attr :authorcount).to_i < 2 %>#{author}#{tag 'authorinitials', :authorinitials}<%    else %><authorgroup><%      (1..((attr :authorcount).to_i)).each do |idx| %>#{author true}<%      end %></authorgroup><%    end  end  if (attr? :revnumber) || (attr? :revremark) %><revhistory><revision>#{tag 'revnumber', :revnumber}#{tag 'date', :revdate}#{tag 'authorinitials', :authorinitials}#{tag 'revremark', :revremark}</revision></revhistory><%  end %><%= docinfo %>#{tag 'orgname', :orgname}<%end %>
end
template() click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 101
def template
  @template ||= @eruby.new <%#encoding:UTF-8%><?xml version="1.0" encoding="UTF-8"?><!DOCTYPE <%= doctype %> PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"><%if attr? :toc %><?asciidoc-toc?><%endif attr? :numbered %><?asciidoc-numbered?><%endif doctype == 'book' %><book<% unless attr? :noxmlns %> xmlns="http://docbook.org/ns/docbook"<% end %><% unless attr? :nolang %> lang="<%= attr :lang, 'en' %>"<% end %>><bookinfo>#{docinfo}</bookinfo><%= content %><%= (docinfo_content = docinfo :footer).empty? ? nil : %(\#{docinfo_content}) %></book><%else %><article<% unless attr? :noxmlns %> xmlns="http://docbook.org/ns/docbook"<% end %><% unless attr? :nolang %> lang="<%= attr :lang, 'en' %>"<% end %>><articleinfo>#{docinfo}</articleinfo><%= content %><%= (docinfo_content = docinfo :footer).empty? ? nil : %(\#{docinfo_content}) %></article><%end %>
end
title_tags(str) click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 43
  def title_tags(str)
    if str.include?(': ')
      title, _, subtitle = str.rpartition(': ')
      %(<title>#{title}</title>
<subtitle>#{subtitle}</subtitle>)
    else
      %(<title>#{str}</title>)
    end
  end

[Validate]

Generated with the Darkfish Rdoc Generator 2.