class Asciidoctor::DocBook45::InlineAnchorTemplate

Public Instance Methods

anchor(target, text, type) click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 526
def anchor(target, text, type)
  case type
  when :ref
    %Q(<anchor id="#{target}" xreflabel="#{text}"/>)
  when :xref
    text.nil? ? %Q(<xref linkend="#{target}"/>) : %Q(<link linkend="#{target}">#{text}</link>)
  when :link
    %Q(<ulink url="#{target}">#{text}</ulink>)
  when :bibref
    %Q(<anchor id="#{target}" xreflabel="[#{target}]"/>[#{target}])
  end
end
template() click to toggle source
# File lib/asciidoctor/backends/docbook45.rb, line 539
  def template
    # hot piece of code, optimized for speed
    @template ||= @eruby.new "<%#encoding:UTF-8%><%= template.anchor(@target, @text, @type) %>
"
  end