summaryrefslogtreecommitdiffstats
path: root/doc/asciidoctor-macros/ws_utils.rb
blob: 9a4551a0fa9c5188deb44c5b5c7c7771e7405274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# SPDX-License-Identifier: MIT
module WsUtils
  def create_doc_links(parent, target, text)
    if (parent.document.basebackend? 'docbook') || (parent.document.basebackend? 'html')
      parent.document.register :links, target
      create_anchor(parent, text, type: :link, target: target).render.to_s
    elsif parent.document.backend == 'manpage'
      "\\fB#{text}"
    else
      text
    end
  end
end