From dita-tools
Transforms callout markers in AsciiDoc source blocks to bullet lists, definition lists, or inline comments via Ruby scripts for DITA compatibility.
npx claudepluginhub redhat-documentation/redhat-docs-agent-tools --plugin dita-toolsThis skill is limited to using the following tools:
Transform callout usage in AsciiDoc source blocks for DITA compatibility.
Fixes unsupported block titles in AsciiDoc files for DITA compatibility by remediating invalid contexts like source blocks, paragraphs, lists, and admonitions using a Ruby script. Use for BlockTitle warnings or DITA prep.
Reviews AsciiDoc (.adoc) files for Red Hat modular documentation compliance: module types (concept, procedure, reference), assembly structure, anchor IDs with _{context}, context variables, and include directives.
Extracts Jobs-To-Be-Done records from modular AsciiDoc documentation repos. Analyzes assemblies, includes, conditionals via reduction, source mapping, and chunked analysis for user goals.
Share bugs, ideas, or general feedback.
Transform callout usage in AsciiDoc source blocks for DITA compatibility.
This skill uses Ruby to transform AsciiDoc files with callout markers in source blocks, which are not supported in the AsciiDoc DITA conversion. The script offers three transformation modes:
--rewrite-bullets): Converts callouts to bullet lists after the code block (default behavior)--rewrite-deflists): Converts callouts to definition lists after the code block--add-inline-comments): Converts callouts to inline comments within the code blockWhen the user asks to transform callouts:
Identify the target folder or file containing AsciiDoc content
Find all .adoc files in the target location
Ask which mode they prefer (bullet lists, definition lists, or inline comments)
Run the Ruby extension against each file with the appropriate option:
For bullet lists (default):
ruby scripts/callouts.rb <file> --rewrite-bullets
For definition lists:
ruby scripts/callouts.rb <file> --rewrite-deflists
For inline comments:
ruby scripts/callouts.rb <file> --add-inline-comments
For bullet list and definition list modes: After running the script, review and rewrite each entry to follow the Red Hat style guide format:
Report the updated files and/or any errors found
ruby callouts.rb <file.adoc> [OPTIONS]
Options:
--rewrite-bullets Convert callouts to bullet lists after the code block (default)
--rewrite-deflists Convert callouts to definition lists after the code block
--add-inline-comments Convert callouts to inline comments in the code block
--dry-run Show what would be changed without modifying files
-o <file> Write output to specified file instead of modifying in place
Converts callouts to bullet lists after the code block. This is the default mode and follows the Red Hat supplementary style guide recommendations for explaining commands and variables in code blocks using bulleted lists.
The script:
+ continuation-- open block delimitersBefore:
[source,bash]
----
vllm serve \
--model meta-llama/Llama-2-7b \ # <1>
--port 8000 \ # <2>
--host 0.0.0.0 # <3>
----
<1> Specify the model to load from Hugging Face
<2> Set the port for the API server
<3> Bind to all network interfaces
After (script output):
[source,bash]
----
vllm serve \
--model meta-llama/Llama-2-7b \
--port 8000 \
--host 0.0.0.0
----
+
--
* `--model meta-llama/Llama-2-7b` Specify the model to load from Hugging Face
* `--port 8000` Set the port for the API server
* `--host 0.0.0.0` Bind to all network interfaces
--
After rewriting (recommended):
[source,bash]
----
vllm serve \
--model meta-llama/Llama-2-7b \
--port 8000 \
--host 0.0.0.0
----
+
--
* `--model` specifies the model to load from Hugging Face.
* `--port` specifies the port for the API server.
* `--host` specifies the network interface to bind to. Use `0.0.0.0` to bind to all interfaces.
--
Converts callouts to definition lists after the code block. This follows the Red Hat supplementary style guide recommendations for explaining commands and variables in code blocks using definition lists with a "Where:" introduction.
The script:
+ continuation-- open block delimiters attached to "where:" with +Before:
[source,bash]
----
vllm serve \
--model meta-llama/Llama-2-7b \ # <1>
--port 8000 \ # <2>
--host 0.0.0.0 # <3>
----
<1> Specify the model to load from Hugging Face
<2> Set the port for the API server
<3> Bind to all network interfaces
After (script output):
[source,bash]
----
vllm serve \
--model meta-llama/Llama-2-7b \
--port 8000 \
--host 0.0.0.0
----
+
where:
+
--
`--model meta-llama/Llama-2-7b`:: Specify the model to load from Hugging Face
`--port 8000`:: Set the port for the API server
`--host 0.0.0.0`:: Bind to all network interfaces
--
After rewriting (recommended):
[source,bash]
----
vllm serve \
--model meta-llama/Llama-2-7b \
--port 8000 \
--host 0.0.0.0
----
+
where:
+
--
`--model`:: Specifies the model to load from Hugging Face.
`--port`:: Specifies the port for the API server.
`--host`:: Specifies the network interface to bind to. Use `0.0.0.0` to bind to all interfaces.
--
Single-line commands: For one-line commands, only use the replacement value as the description list term — not the entire command line:
[source,terminal]
----
$ oc delete -f <file_name> -n <cluster_namespace>
----
+
where:
+
--
`<cluster_namespace>`:: Specifies the namespace of the cluster.
--
Do NOT echo the full command as the term (e.g., `$ oc delete -f <file_name> -n <cluster_namespace>`).
Converts callout markers to inline comments within the code block. This mode preserves the original content as comments in the code.
Before:
[source,bash]
----
vllm serve \
--model meta-llama/Llama-2-7b \ # <1>
--port 8000 \ # <2>
--host 0.0.0.0 # <3>
----
<1> Specify the model to load from Hugging Face
<2> Set the port for the API server
<3> Bind to all network interfaces
After:
[source,bash]
----
vllm serve \
# Specify the model to load from Hugging Face
--model meta-llama/Llama-2-7b \
# Set the port for the API server
--port 8000 \
# Bind to all network interfaces
--host 0.0.0.0
----
The bullet list and definition list modes follow the Red Hat supplementary style guide section "Explanation of commands and variables used in code blocks":
Issues are reported in a parseable format:
<file>:<line>: <TYPE>: <message>
Where TYPE is one of:
ERROR: Critical issue that must be fixedWARNING: Issue that should be reviewedThe Ruby extension is located at: scripts/callouts.rb