summaryrefslogtreecommitdiffstats
path: root/docbook/asciidoctor-macros/ws_utils.rb
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /docbook/asciidoctor-macros/ws_utils.rb
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docbook/asciidoctor-macros/ws_utils.rb')
-rw-r--r--docbook/asciidoctor-macros/ws_utils.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/docbook/asciidoctor-macros/ws_utils.rb b/docbook/asciidoctor-macros/ws_utils.rb
new file mode 100644
index 00000000..9a4551a0
--- /dev/null
+++ b/docbook/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