2 require 'asciidoctor/extensions'
6 class LinkPerfProcessor < Asciidoctor::Extensions::InlineMacroProcessor
11 def process(parent, target, attrs)
12 if parent.document.basebackend? 'html'
13 %(<a href="#{target}.html">#{target}(#{attrs[1]})</a>\n)
14 elsif parent.document.basebackend? 'manpage'
15 "#{target}(#{attrs[1]})"
16 elsif parent.document.basebackend? 'docbook'
18 "<refentrytitle>#{target}</refentrytitle>" \
19 "<manvolnum>#{attrs[1]}</manvolnum>\n" \
27 Asciidoctor::Extensions.register do
28 inline_macro Perf::Documentation::LinkPerfProcessor, :linkperf