summaryrefslogtreecommitdiffstats
path: root/doc/asciidoctor-macros/ws_utils.rb
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
commit9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch)
tree2784370cda9bbf2da9114d70f05399c0b229d28c /doc/asciidoctor-macros/ws_utils.rb
parentAdding debian version 4.2.6-1. (diff)
downloadwireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz
wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/asciidoctor-macros/ws_utils.rb')
-rw-r--r--doc/asciidoctor-macros/ws_utils.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/asciidoctor-macros/ws_utils.rb b/doc/asciidoctor-macros/ws_utils.rb
new file mode 100644
index 00000000..9a4551a0
--- /dev/null
+++ b/doc/asciidoctor-macros/ws_utils.rb
@@ -0,0 +1,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