summaryrefslogtreecommitdiffstats
path: root/docbook/asciidoctor-macros
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
commita86c5f7cae7ec9a3398300555a0b644689d946a1 (patch)
tree39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /docbook/asciidoctor-macros
parentReleasing progress-linux version 4.2.6-1~progress7.99u1. (diff)
downloadwireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz
wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docbook/asciidoctor-macros')
-rw-r--r--docbook/asciidoctor-macros/README.adoc5
-rw-r--r--docbook/asciidoctor-macros/commaize-block.rb6
-rw-r--r--docbook/asciidoctor-macros/commaize-block/extension.rb44
-rw-r--r--docbook/asciidoctor-macros/commaize-block/sample.adoc31
-rw-r--r--docbook/asciidoctor-macros/cveidlink-inline-macro.rb8
-rw-r--r--docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb24
-rw-r--r--docbook/asciidoctor-macros/manarg-block.rb8
-rw-r--r--docbook/asciidoctor-macros/manarg-block/extension.rb45
-rw-r--r--docbook/asciidoctor-macros/manarg-block/sample.adoc19
-rw-r--r--docbook/asciidoctor-macros/ws_utils.rb13
-rw-r--r--docbook/asciidoctor-macros/wsbuglink-inline-macro.rb8
-rw-r--r--docbook/asciidoctor-macros/wsbuglink-inline-macro/extension.rb26
-rw-r--r--docbook/asciidoctor-macros/wssalink-inline-macro.rb8
-rw-r--r--docbook/asciidoctor-macros/wssalink-inline-macro/extension.rb23
14 files changed, 0 insertions, 268 deletions
diff --git a/docbook/asciidoctor-macros/README.adoc b/docbook/asciidoctor-macros/README.adoc
deleted file mode 100644
index cc5d64e5..00000000
--- a/docbook/asciidoctor-macros/README.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-Asciidoctor macros.
-
-These files are available under the MIT license to match the
-https://github.com/asciidoctor/asciidoctor-extensions-lab[Asciidoctor Extensions Lab]
-and Asciidoctor itself.
diff --git a/docbook/asciidoctor-macros/commaize-block.rb b/docbook/asciidoctor-macros/commaize-block.rb
deleted file mode 100644
index aff6a3c1..00000000
--- a/docbook/asciidoctor-macros/commaize-block.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: MIT
-RUBY_ENGINE == 'opal' ? (require 'commaize-block/extension') : (require_relative 'commaize-block/extension')
-
-Extensions.register do
- block CommaizeBlock
-end
diff --git a/docbook/asciidoctor-macros/commaize-block/extension.rb b/docbook/asciidoctor-macros/commaize-block/extension.rb
deleted file mode 100644
index 710f1a7e..00000000
--- a/docbook/asciidoctor-macros/commaize-block/extension.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# SPDX-License-Identifier: MIT
-require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
-
-include Asciidoctor
-
-# An extension that converts a list of lines to an inline Oxford comma-separated list.
-#
-# Usage
-#
-# [commaize]
-# --
-# item1
-# item2
-# item3
-# --
-#
-class CommaizeBlock < Extensions::BlockProcessor
- include WsUtils
- use_dsl
-
- named :commaize
- on_contexts :paragraph, :open
- # XXX What's the difference between text, raw, simple, verbatim, etc?
- parse_content_as :simple
-
- def process(parent, reader, attrs)
- lines = reader.lines
- sort = attrs.fetch('sort', 'true') == 'true'
-
- lines = lines.reject(&:empty?)
- lines = lines.map(&:strip)
- lines = lines.sort_by(&:downcase) if sort
-
- if lines.length < 2
- create_paragraph parent, lines, attrs
- elsif lines.length == 2
- create_paragraph parent, lines.join(" and "), attrs
- else
- commaized = lines[0..-2].join(", ")
- commaized << ", and " + lines[-1]
- create_paragraph parent, commaized, attrs
- end
- end
-end
diff --git a/docbook/asciidoctor-macros/commaize-block/sample.adoc b/docbook/asciidoctor-macros/commaize-block/sample.adoc
deleted file mode 100644
index 9cb2e1ec..00000000
--- a/docbook/asciidoctor-macros/commaize-block/sample.adoc
+++ /dev/null
@@ -1,31 +0,0 @@
-= Sorted, delimited, empty lines
-
-[commaize]
---
-One
-two
-
-red
-
-blue
-Fish
---
-
-= Unsorted
-
-[commaize, sort=false]
-One
-two
-red
-blue
-Fish
-
-= Two elements
-
-[commaize]
-One
-Two
-
-= One element
-[commaize]
-Just the one
diff --git a/docbook/asciidoctor-macros/cveidlink-inline-macro.rb b/docbook/asciidoctor-macros/cveidlink-inline-macro.rb
deleted file mode 100644
index beb19a3b..00000000
--- a/docbook/asciidoctor-macros/cveidlink-inline-macro.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: MIT
-# Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/man-inline-macro.rb
-
-RUBY_ENGINE == 'opal' ? (require 'cveidlink-inline-macro/extension') : (require_relative 'cveidlink-inline-macro/extension')
-
-Extensions.register do
- inline_macro CVEIdLinkInlineMacro
-end
diff --git a/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb b/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb
deleted file mode 100644
index 2dec88da..00000000
--- a/docbook/asciidoctor-macros/cveidlink-inline-macro/extension.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# SPDX-License-Identifier: MIT
-require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
-
-include ::Asciidoctor
-
-# An inline macro that generates a link to a CVE Record identified by its CVE
-# Number.
-#
-# Usage
-#
-# cveidlink:<cve-number>[]
-#
-class CVEIdLinkInlineMacro < Extensions::InlineMacroProcessor
- include WsUtils
- use_dsl
-
- named :cveidlink
-
- def process(parent, cvenum, _attrs)
- cvename = "CVE-#{cvenum}"
- target = %(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cvenum})
- create_doc_links(parent, target, cvename)
- end
-end
diff --git a/docbook/asciidoctor-macros/manarg-block.rb b/docbook/asciidoctor-macros/manarg-block.rb
deleted file mode 100644
index 07a9bf26..00000000
--- a/docbook/asciidoctor-macros/manarg-block.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: MIT
-# Adapted from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/man-inline-macro.rb
-
-RUBY_ENGINE == 'opal' ? (require 'manarg-block/extension') : (require_relative 'manarg-block/extension')
-
-Extensions.register do
- block ManArgBlock
-end
diff --git a/docbook/asciidoctor-macros/manarg-block/extension.rb b/docbook/asciidoctor-macros/manarg-block/extension.rb
deleted file mode 100644
index 2461e723..00000000
--- a/docbook/asciidoctor-macros/manarg-block/extension.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# SPDX-License-Identifier: MIT
-require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
-
-include Asciidoctor
-
-# An inline macro that generates markup for man page arguments.
-# Adapted from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/man-inline-macro.rb
-#
-# Usage:
-#
-# [manarg]
-# *command*
-# [ *--help* ]
-# [ *--flash-lights* ]
-#
-class ManArgBlock < Extensions::BlockProcessor
- use_dsl
-
- named :manarg
- parse_content_as :simple
-
- def process parent, reader, attrs
- nowrap_lines = reader.readlines.map {|line|
- if parent.document.basebackend? 'html'
- # Apply the custom style "[.nowrap]## ... ##" to each line.
- # This generates "<span content="nowrap"> ... </span>". Pass
- # each '#' through for extra paranoia.
- %([.nowrap]###{line.gsub('#', '+++#+++')}##)
- elsif parent.document.backend == 'manpage'
- # Replace spaces with non-breaking spaces ('&#160;'), then make
- # bold markup unconstrained ('*' -> '**'). For now we naively
- # assume that bolds are always constrained (that is, we only
- # have single '*'s). We *should* be able to do this properly
- # with a regex, but for some reason
- # gsub(/([^*])\*([^*])/, '\1**\2')
- # doesn't match the first asterisk in "*--extcap-interface*=<interface>"
- %(#{line.gsub(' ', '&#160;').gsub('*', '**')})
- else
- line
- end
- }
- # STDERR.puts(nowrap_lines)
- create_paragraph parent, nowrap_lines, attrs
- end
-end
diff --git a/docbook/asciidoctor-macros/manarg-block/sample.adoc b/docbook/asciidoctor-macros/manarg-block/sample.adoc
deleted file mode 100644
index 5b4a4019..00000000
--- a/docbook/asciidoctor-macros/manarg-block/sample.adoc
+++ /dev/null
@@ -1,19 +0,0 @@
-= androiddump(1)
-:doctype: manpage
-
-== NAME
-
-sample - Sample man page
-
-== SYNOPSIS
-
-[manarg]
-*androiddump*
-*--mandatory-argument
-[ *--optional-argument* ]
-*--complex-mandatory*=<argument>
-[ *--complex-optional*=<argument> ]
-
-== DESCRIPTION
-
-Sample man page.
diff --git a/docbook/asciidoctor-macros/ws_utils.rb b/docbook/asciidoctor-macros/ws_utils.rb
deleted file mode 100644
index 9a4551a0..00000000
--- a/docbook/asciidoctor-macros/ws_utils.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# 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
diff --git a/docbook/asciidoctor-macros/wsbuglink-inline-macro.rb b/docbook/asciidoctor-macros/wsbuglink-inline-macro.rb
deleted file mode 100644
index 3f192aab..00000000
--- a/docbook/asciidoctor-macros/wsbuglink-inline-macro.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: MIT
-# Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/man-inline-macro.rb
-
-RUBY_ENGINE == 'opal' ? (require 'wsbuglink-inline-macro/extension') : (require_relative 'wsbuglink-inline-macro/extension')
-
-Extensions.register do
- inline_macro WSBugLinkInlineMacro
-end
diff --git a/docbook/asciidoctor-macros/wsbuglink-inline-macro/extension.rb b/docbook/asciidoctor-macros/wsbuglink-inline-macro/extension.rb
deleted file mode 100644
index 6cdb665b..00000000
--- a/docbook/asciidoctor-macros/wsbuglink-inline-macro/extension.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# SPDX-License-Identifier: MIT
-require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
-
-include ::Asciidoctor
-
-# An inline macro that generates a link to a Wireshark bug report.
-#
-# Usage
-#
-# wsbuglink:<number>[<issue text>]
-# Default bug text is "Issue <number>".
-#
-class WSBugLinkInlineMacro < Extensions::InlineMacroProcessor
- include WsUtils
- use_dsl
-
- named :wsbuglink
- parse_content_as :text
- name_positional_attributes 'bugtext'
-
- def process(parent, issueid, attrs)
- bugtext = attrs['bugtext'] || %(Issue #{issueid})
- target = %(https://gitlab.com/wireshark/wireshark/-/issues/#{issueid})
- create_doc_links(parent, target, bugtext)
- end
-end
diff --git a/docbook/asciidoctor-macros/wssalink-inline-macro.rb b/docbook/asciidoctor-macros/wssalink-inline-macro.rb
deleted file mode 100644
index 3172ea50..00000000
--- a/docbook/asciidoctor-macros/wssalink-inline-macro.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: MIT
-# Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/man-inline-macro.rb
-
-RUBY_ENGINE == 'opal' ? (require 'wssalink-inline-macro/extension') : (require_relative 'wssalink-inline-macro/extension')
-
-Extensions.register do
- inline_macro WSSALinkInlineMacro
-end
diff --git a/docbook/asciidoctor-macros/wssalink-inline-macro/extension.rb b/docbook/asciidoctor-macros/wssalink-inline-macro/extension.rb
deleted file mode 100644
index 3af9c8f3..00000000
--- a/docbook/asciidoctor-macros/wssalink-inline-macro/extension.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# SPDX-License-Identifier: MIT
-require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
-
-include ::Asciidoctor
-
-# An inline macro that generates a link to a Wireshark Security Advisory.
-#
-# Usage
-#
-# wssalink:<dddd>[]
-#
-class WSSALinkInlineMacro < Extensions::InlineMacroProcessor
- include WsUtils
- use_dsl
-
- named :'wssalink'
-
- def process(parent, sanum, attrs)
- satext = "wnpa-sec-#{sanum}"
- target = %(https://www.wireshark.org/security/wnpa-sec-#{sanum})
- create_doc_links(parent, target, satext)
- end
-end