@redpanda-data/docs-extensions-and-macros 4.12.6 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.adoc +33 -1064
- package/bin/doc-tools-mcp.js +720 -0
- package/bin/doc-tools.js +1050 -50
- package/bin/mcp-tools/antora.js +153 -0
- package/bin/mcp-tools/cache.js +89 -0
- package/bin/mcp-tools/cloud-regions.js +127 -0
- package/bin/mcp-tools/content-review.js +196 -0
- package/bin/mcp-tools/crd-docs.js +153 -0
- package/bin/mcp-tools/frontmatter.js +138 -0
- package/bin/mcp-tools/generated-docs-review.js +887 -0
- package/bin/mcp-tools/helm-docs.js +152 -0
- package/bin/mcp-tools/index.js +245 -0
- package/bin/mcp-tools/job-queue.js +468 -0
- package/bin/mcp-tools/mcp-validation.js +266 -0
- package/bin/mcp-tools/metrics-docs.js +146 -0
- package/bin/mcp-tools/openapi.js +174 -0
- package/bin/mcp-tools/prompt-discovery.js +283 -0
- package/bin/mcp-tools/property-docs.js +157 -0
- package/bin/mcp-tools/rpcn-docs.js +113 -0
- package/bin/mcp-tools/rpk-docs.js +141 -0
- package/bin/mcp-tools/telemetry.js +211 -0
- package/bin/mcp-tools/utils.js +131 -0
- package/bin/mcp-tools/versions.js +168 -0
- package/cli-utils/convert-doc-links.js +1 -1
- package/cli-utils/github-token.js +58 -0
- package/cli-utils/self-managed-docs-branch.js +2 -2
- package/cli-utils/setup-mcp.js +313 -0
- package/docker-compose/25.1/transactions.md +1 -1
- package/docker-compose/transactions.md +1 -1
- package/extensions/DEVELOPMENT.adoc +464 -0
- package/extensions/README.adoc +124 -0
- package/extensions/REFERENCE.adoc +768 -0
- package/extensions/USER_GUIDE.adoc +339 -0
- package/extensions/generate-rp-connect-info.js +3 -4
- package/extensions/version-fetcher/get-latest-console-version.js +38 -27
- package/extensions/version-fetcher/get-latest-redpanda-version.js +65 -54
- package/extensions/version-fetcher/retry-util.js +88 -0
- package/extensions/version-fetcher/set-latest-version.js +6 -3
- package/macros/DEVELOPMENT.adoc +377 -0
- package/macros/README.adoc +105 -0
- package/macros/REFERENCE.adoc +222 -0
- package/macros/USER_GUIDE.adoc +220 -0
- package/macros/rp-connect-components.js +6 -6
- package/mcp/CLI_INTERFACE.adoc +384 -0
- package/mcp/COSTS.adoc +167 -0
- package/mcp/DEVELOPMENT.adoc +726 -0
- package/mcp/README.adoc +172 -0
- package/mcp/USER_GUIDE.adoc +1392 -0
- package/mcp/WRITER_EXTENSION_GUIDE.adoc +814 -0
- package/mcp/prompts/README.adoc +183 -0
- package/mcp/prompts/property-docs-guide.md +283 -0
- package/mcp/prompts/review-for-style.md +128 -0
- package/mcp/prompts/rpcn-connector-docs-guide.md +126 -0
- package/mcp/prompts/write-new-guide.md +222 -0
- package/mcp/team-standards/style-guide.md +321 -0
- package/mcp/templates/README.adoc +212 -0
- package/mcp/templates/prompt-review-template.md +80 -0
- package/mcp/templates/prompt-write-template.md +110 -0
- package/mcp/templates/resource-template.md +76 -0
- package/package.json +16 -5
- package/tools/bundle-openapi.js +20 -10
- package/tools/cloud-regions/generate-cloud-regions.js +1 -1
- package/tools/fetch-from-github.js +18 -4
- package/tools/gen-rpk-ascii.py +3 -1
- package/tools/generate-cli-docs.js +325 -0
- package/tools/get-console-version.js +4 -2
- package/tools/get-redpanda-version.js +4 -2
- package/tools/metrics/metrics.py +19 -7
- package/tools/property-extractor/Makefile +7 -1
- package/tools/property-extractor/cloud_config.py +4 -4
- package/tools/property-extractor/constant_resolver.py +11 -11
- package/tools/property-extractor/property_extractor.py +18 -16
- package/tools/property-extractor/topic_property_extractor.py +2 -2
- package/tools/property-extractor/transformers.py +7 -7
- package/tools/property-extractor/type_definition_extractor.py +4 -4
- package/tools/redpanda-connect/README.adoc +1 -1
- package/tools/redpanda-connect/generate-rpcn-connector-docs.js +5 -3
package/README.adoc
CHANGED
|
@@ -1,1106 +1,75 @@
|
|
|
1
1
|
= Antora Extensions and Macros for Redpanda Docs
|
|
2
2
|
:url-org: https://github.com/redpanda-data
|
|
3
3
|
:url-project: {url-org}/docs-extensions-and-macros
|
|
4
|
-
:url-playbook: {url-org}/docs-site
|
|
5
|
-
:url-git: https://git-scm.com
|
|
6
|
-
:url-git-dl: {url-git}/downloads
|
|
7
|
-
:url-nodejs: https://nodejs.org
|
|
8
|
-
:url-nodejs-releases: https://github.com/nodejs/Release#release-schedule
|
|
9
|
-
:url-nvm-install: {url-nvm}#installation
|
|
10
|
-
:idprefix:
|
|
11
|
-
:idseparator: -
|
|
12
4
|
ifdef::env-github[]
|
|
13
5
|
:important-caption: :exclamation:
|
|
14
6
|
:note-caption: :paperclip:
|
|
15
7
|
endif::[]
|
|
16
|
-
:toc:
|
|
17
|
-
:toc-title: Contents
|
|
18
8
|
|
|
19
|
-
|
|
9
|
+
This library provides https://docs.antora.org/antora/latest/extend/extensions/[Antora extensions], https://docs.asciidoctor.org/asciidoctor.js/latest/extend/extensions/register/[AsciiDoc macros], and automation tools for Redpanda documentation.
|
|
20
10
|
|
|
21
|
-
|
|
11
|
+
== Quickstart
|
|
22
12
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
To use this library, you must have {url-nodejs}[Node.js] 16 or higher installed on your machine.
|
|
26
|
-
|
|
27
|
-
[,bash]
|
|
28
|
-
----
|
|
29
|
-
node --version
|
|
30
|
-
----
|
|
31
|
-
|
|
32
|
-
If this command fails with an error, you don't have Node.js installed.
|
|
33
|
-
|
|
34
|
-
When you have Node.js installed, use the following command to install the `antora-extensions-and-macros` package in your project:
|
|
13
|
+
Install the package:
|
|
35
14
|
|
|
36
15
|
[,bash]
|
|
37
16
|
----
|
|
38
17
|
npm i @redpanda-data/docs-extensions-and-macros
|
|
39
18
|
----
|
|
40
19
|
|
|
41
|
-
To use the development version, refer to the <<development-quickstart,Development Quickstart>>.
|
|
42
|
-
|
|
43
|
-
== Antora Extensions
|
|
44
|
-
|
|
45
|
-
This section documents the Antora extensions provided by this library and how to configure them.
|
|
46
|
-
|
|
47
|
-
IMPORTANT: Ensure you register each extension under the `antora.extensions` key in the playbook, not the `asciidoc.extensions` key.
|
|
48
|
-
|
|
49
|
-
=== Add Bloblang samples to pages
|
|
50
|
-
|
|
51
|
-
The `collect-bloblang-samples` extension processes Bloblang examples from YAML files in the `examples` directory of the `redpanda-connect` component. This extension ensures that these examples are accessible as structured data for use in UI components or documentation, such as sample dropdowns in a Bloblang playground.
|
|
52
|
-
|
|
53
|
-
It validates, sorts, and attaches the processed examples as a JSON object to the Antora page attributes. The extension ensures examples have unique titles, mandatory fields (`input` and `mapping`), and are sorted in alphabetical order.
|
|
54
|
-
|
|
55
|
-
The processed examples are added as JSON to the `page-bloblang-samples` attribute. For example:
|
|
56
|
-
|
|
57
|
-
[,json]
|
|
58
|
-
----
|
|
59
|
-
{
|
|
60
|
-
"hello-world.yaml": {
|
|
61
|
-
"title": "Hello world",
|
|
62
|
-
"input": "{\n \"message\": \"hello world\"\n}\n",
|
|
63
|
-
"mapping": "root.message = this.message.uppercase()\n"
|
|
64
|
-
},
|
|
65
|
-
"array-processing.yaml": {
|
|
66
|
-
"title": "Array processing",
|
|
67
|
-
"input": "{\n \"numbers\": [1, 2, 3, 4, 5]\n}\n",
|
|
68
|
-
"mapping": "root.even_numbers = this.numbers.filter(n -> n % 2 == 0)"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
----
|
|
72
|
-
|
|
73
|
-
==== Environment variables
|
|
74
|
-
|
|
75
|
-
This extension does not require any environment variables.
|
|
76
|
-
|
|
77
|
-
==== Configuration options
|
|
78
|
-
|
|
79
|
-
To enable the extension, add it to your Antora playbook under the `antora.extensions` key. No additional configuration is required.
|
|
80
|
-
|
|
81
|
-
[,yaml]
|
|
82
|
-
----
|
|
83
|
-
antora:
|
|
84
|
-
extensions:
|
|
85
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/collect-bloblang-samples'
|
|
86
|
-
----
|
|
87
|
-
|
|
88
|
-
==== Example Bloblang YAML file
|
|
89
|
-
|
|
90
|
-
The following YAML file is an example of how to define a Bloblang sample:
|
|
91
|
-
|
|
92
|
-
[,yaml]
|
|
93
|
-
----
|
|
94
|
-
title: Hello world
|
|
95
|
-
input: |
|
|
96
|
-
{
|
|
97
|
-
"message": "hello world"
|
|
98
|
-
}
|
|
99
|
-
mapping: |
|
|
100
|
-
root.message = this.message.uppercase()
|
|
101
|
-
----
|
|
102
|
-
|
|
103
|
-
=== Add pages to root
|
|
104
|
-
|
|
105
|
-
The `add-pages-to-root` extension allows you to copy files from your Antora content catalog to the root of the site during the build process. This is particularly useful for files like `llms.txt` or any custom files that need to be directly accessible at the site's root level.
|
|
106
|
-
|
|
107
|
-
This extension processes a list of file paths provided in the playbook configuration, locates those files in the Antora content catalog, and adds them to the site's root directory during the publishing phase. Each file's content and basename are preserved in the process.
|
|
108
|
-
|
|
109
|
-
==== Environment variables
|
|
110
|
-
|
|
111
|
-
This extension does not require any environment variables.
|
|
112
|
-
|
|
113
|
-
==== Configuration options
|
|
114
|
-
|
|
115
|
-
Add the `add-pages-to-root` extension to your Antora playbook under the `antora.extensions` key, and specify the list of files to process in the `files` configuration.
|
|
116
|
-
|
|
117
|
-
[source,yaml]
|
|
118
|
-
----
|
|
119
|
-
antora:
|
|
120
|
-
extensions:
|
|
121
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/add-pages-to-root'
|
|
122
|
-
files:
|
|
123
|
-
- home:ROOT:attachment$custom-file.txt
|
|
124
|
-
----
|
|
125
|
-
|
|
126
|
-
==== Registration
|
|
127
|
-
|
|
128
|
-
[source,yaml]
|
|
129
|
-
----
|
|
130
|
-
antora:
|
|
131
|
-
extensions:
|
|
132
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/add-pages-to-root'
|
|
133
|
-
files:
|
|
134
|
-
- home:ROOT:attachment$custom-file.txt
|
|
135
|
-
----
|
|
136
|
-
|
|
137
|
-
=== Algolia indexer
|
|
138
|
-
|
|
139
|
-
This extension generates an Algolia index for each version of each component. The index entries are then saved to Algolia using the `saveObjects()` method, and also saved as JSON files in the site catalog. JSON files are published to the site root using the template `algolia-<component>-<version>.json`.
|
|
140
|
-
|
|
141
|
-
NOTE: Only pages that include an `<article>` element with the `doc` class are indexed.
|
|
142
|
-
|
|
143
|
-
==== Environment variables
|
|
144
|
-
|
|
145
|
-
- `ALGOLIA_ADMIN_API_KEY` (required)
|
|
146
|
-
- `ALGOLIA_APP_ID` (required)
|
|
147
|
-
- `ALGOLIA_INDEX_NAME` (required)
|
|
148
|
-
|
|
149
|
-
==== Configuration options
|
|
150
|
-
|
|
151
|
-
The extension accepts the following configuration options:
|
|
152
|
-
|
|
153
|
-
excludes (optional)::
|
|
154
|
-
Any elements, classes, or IDs that you want to exclude from the index.
|
|
155
|
-
index-latest-only (optional)::
|
|
156
|
-
Whether to index all versions or just the latest version of a component.
|
|
157
|
-
|
|
158
|
-
==== Registration
|
|
159
|
-
|
|
160
|
-
```yaml
|
|
161
|
-
antora:
|
|
162
|
-
extensions:
|
|
163
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/algolia-indexer/index'
|
|
164
|
-
excludes: ['.thumbs','script', '.page-versions','.feedback-section','.banner-container']
|
|
165
|
-
index-latest-only: true
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
=== Archive attachments
|
|
169
|
-
|
|
170
|
-
The `archive-attachments` extension automates the packaging of specific attachment files into a compressed archive (`.tar.gz`) based on configurable patterns. This archive is then made available to the generated site, allowing users to easily download grouped resources such as Docker Compose configurations.
|
|
171
|
-
|
|
172
|
-
This extension enables you to define which files and directories to include in the archive, ensuring that only relevant content is packaged and accessible.
|
|
173
|
-
|
|
174
|
-
==== Environment variables
|
|
175
|
-
|
|
176
|
-
This extension does not require any environment variables.
|
|
177
|
-
|
|
178
|
-
==== Configuration options
|
|
179
|
-
|
|
180
|
-
The extension accepts the following options in the Antora playbook.
|
|
181
|
-
|
|
182
|
-
Configure the extension in your Antora playbook by defining an array of archive configurations under `data.archives`. Each archive configuration includes:
|
|
183
|
-
|
|
184
|
-
output_archive (string, required):: The name of the generated archive file.
|
|
185
|
-
|
|
186
|
-
component (string, required):: The name of the Antora component whose attachments should be archived.
|
|
187
|
-
|
|
188
|
-
file_patterns (array of strings, required):: Glob patterns specifying which attachment paths to include in the archive.
|
|
189
|
-
|
|
190
|
-
NOTE: Ensure that `file_patterns` accurately reflect the paths of the attachments you want to archive. Overly broad patterns may include unintended files, while overly restrictive patterns might exclude necessary resources.
|
|
191
|
-
|
|
192
|
-
==== Example configuration
|
|
193
|
-
|
|
194
|
-
Here's an example configuration to enable the extension:
|
|
195
|
-
|
|
196
|
-
```yaml
|
|
197
|
-
antora:
|
|
198
|
-
extensions:
|
|
199
|
-
- require: '../docs-extensions-and-macros/extensions/archive-creation-extension.js'
|
|
200
|
-
data:
|
|
201
|
-
archives:
|
|
202
|
-
- output_archive: 'redpanda-quickstart.tar.gz' <1>
|
|
203
|
-
component: 'ROOT' <2>
|
|
204
|
-
file_patterns:
|
|
205
|
-
- '**/test-resources/**/docker-compose/**' <3>
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
<1> Defines the name of the generated archive placed at the site root.
|
|
209
|
-
<2> Defines the name of the component in which to search for attachments.
|
|
210
|
-
<3> Lists the glob patterns to match attachment paths for inclusion in the archive.
|
|
211
|
-
+
|
|
212
|
-
- `**`: Matches any number of directories.
|
|
213
|
-
- `/test-resources/`: Specifies that the matching should occur within the `test-resources/` directory.
|
|
214
|
-
- `/docker-compose/`: Targets the `docker-compose/` directory and all its subdirectories.
|
|
215
|
-
- `**:` Ensures that all files and nested directories within `docker-compose/` are included.
|
|
216
|
-
|
|
217
|
-
=== Behavior with multiple components/versions
|
|
218
|
-
|
|
219
|
-
*Scenario*: Multiple components and/or multiple versions of the same component contain attachments that match the defined file_patterns.
|
|
220
|
-
|
|
221
|
-
*Outcome*: Separate archives for each component version.
|
|
222
|
-
|
|
223
|
-
For each matching (component, version) pair, the extension creates a distinct archive named `<version>-<output_archive>`. For example:
|
|
224
|
-
`24.3-redpanda-quickstart.tar.gz`.
|
|
225
|
-
|
|
226
|
-
These archives are placed at the site root, ensuring they are easily accessible and do not overwrite each other.
|
|
227
|
-
|
|
228
|
-
For the latest version of each component, the extension also adds the archive using the base `output_archive` name. As a result, the latest archives are accessible through a consistent filename, facilitating easy downloads without needing to reference version numbers.
|
|
229
|
-
|
|
230
|
-
Because each archive has a unique filename based on the component version, there is no risk of archives overwriting each other.
|
|
231
|
-
The only exception is the archive for the latest version, which consistently uses the `output_archive` name.
|
|
232
|
-
|
|
233
|
-
=== Component category aggregator
|
|
234
|
-
|
|
235
|
-
This extension maps Redpanda Connect component data into a structured format:
|
|
236
|
-
|
|
237
|
-
- Maps original component names to common names.
|
|
238
|
-
- Populates `connectCategoriesData` and `flatComponentsData` attributes.
|
|
239
|
-
- Skips deprecated components.
|
|
240
|
-
|
|
241
|
-
==== Environment variables
|
|
242
|
-
|
|
243
|
-
This extension does not require any environment variables.
|
|
244
|
-
|
|
245
|
-
==== Configuration options
|
|
246
|
-
|
|
247
|
-
There are no configurable options for this extension.
|
|
248
|
-
|
|
249
|
-
==== Registration
|
|
250
|
-
|
|
251
|
-
```yaml
|
|
252
|
-
antora:
|
|
253
|
-
extensions:
|
|
254
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/generate-rp-connect-categories'
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
=== Compute end-of-life extension
|
|
258
|
-
|
|
259
|
-
This extension calculates and attaches metadata related to the end-of-life (EoL) status of docs pages, such as nearing EoL, past EoL, and associated EoL dates. This metadata can be used to display relevant banners or messages in docs to inform users about the lifecycle of each version.
|
|
260
|
-
|
|
261
|
-
The extension leverages configuration settings provided in the Antora playbook to apply EoL calculations, specify the warning period, and include links to upgrade documentation and EoL policies.
|
|
262
|
-
|
|
263
|
-
The extension computes whether a page is nearing EoL or past EoL based on the `page-release-date` attribute and configured settings.
|
|
264
|
-
It injects the following attributes into each page, making them available for use in UI templates:
|
|
265
|
-
|
|
266
|
-
- `page-is-nearing-eol`: Indicates if the page is within the warning period before EoL. Calculated using `(page-release-date + supported_months) - warning_weeks`.
|
|
267
|
-
- `page-is-past-eol`: Indicates if the page has passed its EoL. Calculated using `today > (page-release-date + supported_months)`.
|
|
268
|
-
- `page-eol-date`: The calculated EoL date in a human-readable format. Calculated using `page-release-date + supported_months`.
|
|
269
|
-
- `page-eol-doc`: The URL to the supported versions policy or EoL documentation.
|
|
270
|
-
- `page-upgrade-doc`: The Antora resource ID to a document containing upgrade instructions.
|
|
271
|
-
|
|
272
|
-
==== Environment variables
|
|
273
|
-
|
|
274
|
-
This extension does not require any environment variables.
|
|
275
|
-
|
|
276
|
-
==== Configuration options
|
|
277
|
-
|
|
278
|
-
To enable and configure the extension, add it to the `antora.extensions` section of your Antora playbook. Define the EoL settings under the `data.eol_settings` key with the following options:
|
|
279
|
-
|
|
280
|
-
`component` (required):: The component name to which the configuration applies.
|
|
281
|
-
`eol_doc` (required):: A link to the supported versions policy or EoL documentation.
|
|
282
|
-
`upgrade_doc` (required):: A link to the upgrade instructions.
|
|
283
|
-
`supported_months` (optional, default: 12):: The number of months after the publish date when the documentation reaches its EoL.
|
|
284
|
-
`warning_weeks` (optional, default: 6):: The number of weeks before EoL when the documentation is considered to be nearing EoL. Can be used to decide when to notify users of the upcoming EoL status.
|
|
285
|
-
|
|
286
20
|
[,yaml]
|
|
287
21
|
----
|
|
288
22
|
antora:
|
|
289
23
|
extensions:
|
|
290
|
-
-
|
|
291
|
-
data:
|
|
292
|
-
eol_settings:
|
|
293
|
-
- component: 'ROOT'
|
|
294
|
-
supported_months: 18
|
|
295
|
-
warning_weeks: 8
|
|
296
|
-
eol_doc: https://support.redpanda.com/hc/en-us/articles/20617574366743-Redpanda-Supported-Versions
|
|
297
|
-
upgrade_doc: ROOT:upgrade:index.adoc
|
|
298
|
-
----
|
|
299
|
-
|
|
300
|
-
==== Registration
|
|
301
|
-
|
|
302
|
-
You can register the extension with a customized configuration for different components in your playbook:
|
|
303
|
-
|
|
304
|
-
[,yaml]
|
|
305
|
-
----
|
|
306
|
-
antora:
|
|
307
|
-
extensions:
|
|
308
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/compute-end-of-life'
|
|
309
|
-
data:
|
|
310
|
-
eol_settings:
|
|
311
|
-
- component: 'ROOT'
|
|
312
|
-
supported_months: 12
|
|
313
|
-
warning_weeks: 6
|
|
314
|
-
eol_doc: https://example.com/supported-versions
|
|
315
|
-
upgrade_doc: ROOT:upgrade:index.adoc
|
|
316
|
-
- component: 'example-docs'
|
|
317
|
-
supported_months: 24
|
|
318
|
-
warning_weeks: 12
|
|
319
|
-
eol_doc: https://example.com/example-supported-versions
|
|
320
|
-
upgrade_doc: example-docs:upgrade:index.adoc
|
|
321
|
-
----
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
==== Example Handlebars template:
|
|
325
|
-
|
|
326
|
-
[,handlebars]
|
|
327
|
-
----
|
|
328
|
-
{{#if page.attributes.is-nearing-eol}}
|
|
329
|
-
<div class="banner-container nearing-eol">
|
|
330
|
-
This documentation will reach its end of life on {{page.attributes.eol-date}}.
|
|
331
|
-
Please <a href="{{resolve-resource page.attributes.upgrade-doc}}">upgrade to a supported version</a>.
|
|
332
|
-
</div>
|
|
333
|
-
{{else if page.attributes.is-past-eol}}
|
|
334
|
-
<div class="banner-container past-eol">
|
|
335
|
-
This documentation reached its end of life on {{page.attributes.eol-date}}.
|
|
336
|
-
See our <a href="{{page.attributes.eol-doc}}" target="_blank">supported versions policy</a>.
|
|
337
|
-
</div>
|
|
338
|
-
{{/if}}
|
|
339
|
-
----
|
|
340
|
-
|
|
341
|
-
=== Generate index data
|
|
342
|
-
|
|
343
|
-
The `generate-index-data` extension creates structured index data about doc pages based on configurable filters. The indexed data is saved to a specified attribute in all component versions, enabling the dynamic generation of categorized links and descriptions within your docs using UI templates.
|
|
344
|
-
|
|
345
|
-
This extension allows you to define multiple indexing criteria, such as component, URL filter, and environment type.
|
|
346
|
-
|
|
347
|
-
The generated data is an array of objects, where each object represents a component version. Each object contains the following properties:
|
|
348
|
-
|
|
349
|
-
- `component` (string):
|
|
350
|
-
The name of the Antora component.
|
|
351
|
-
|
|
352
|
-
- `version` (string):
|
|
353
|
-
The version of the component.
|
|
354
|
-
|
|
355
|
-
- `pages` (array):
|
|
356
|
-
A list of pages that match the indexing criteria. Each page contains:
|
|
357
|
-
** `title` (string): The title of the doc page.
|
|
358
|
-
** `url` (string): The URL of the doc page relative to the site root.
|
|
359
|
-
** `description` (string): A brief description sourced from the `:description:` attribute in the AsciiDoc file. Defaults to an empty string if not provided.
|
|
360
|
-
|
|
361
|
-
Example:
|
|
362
|
-
|
|
363
|
-
```json
|
|
364
|
-
[
|
|
365
|
-
{
|
|
366
|
-
"component": "ROOT",
|
|
367
|
-
"version": "24.3",
|
|
368
|
-
"pages": [
|
|
369
|
-
{
|
|
370
|
-
"title": "Manage Debug Bundles in Redpanda Console",
|
|
371
|
-
"url": "/current/console/ui/generate-bundle/",
|
|
372
|
-
"description": "Learn how to generate, download, and delete debug bundles in Redpanda Console for comprehensive cluster diagnostics."
|
|
373
|
-
},
|
|
374
|
-
]
|
|
375
|
-
}
|
|
376
|
-
]
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
==== Environment variables
|
|
380
|
-
|
|
381
|
-
This extension does not require any environment variables.
|
|
382
|
-
|
|
383
|
-
==== Configuration options
|
|
384
|
-
|
|
385
|
-
The extension accepts the following options in the Antora playbook.
|
|
386
|
-
|
|
387
|
-
NOTE: Ensure filters are well-defined to minimize unnecessary processing. Avoid overly broad configurations in `data.sets`.
|
|
388
|
-
|
|
389
|
-
- `data.sets` (required): An object defining one or more indexing configurations. Each configuration (or set) accepts the following options:
|
|
390
|
-
|
|
391
|
-
** `component` (string, required): The Antora component to search for pages.
|
|
392
|
-
|
|
393
|
-
** `attribute_name` (string, required): The attribute name to assign the generated index data. This allows pages and templates to reference the index.
|
|
394
|
-
|
|
395
|
-
** `filter` (string, optional): A substring to match within page URLs.
|
|
396
|
-
|
|
397
|
-
** `env_type` (string, optional): Matches pages with environment-specific attributes (e.g., Docker, Kubernetes).
|
|
398
|
-
|
|
399
|
-
** `output_file` (string, optional): Save the generated index data as a JSON file at the specified path. If not provided, no file is created.
|
|
400
|
-
|
|
401
|
-
==== Example configuration
|
|
402
|
-
|
|
403
|
-
Here's an example configuration to enable the generate-index-data-extension:
|
|
404
|
-
|
|
405
|
-
```yaml
|
|
406
|
-
antora:
|
|
407
|
-
extensions:
|
|
408
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/generate-index-data-extension'
|
|
409
|
-
data:
|
|
410
|
-
sets:
|
|
411
|
-
console_ui:
|
|
412
|
-
component: ROOT # Search the ROOT component
|
|
413
|
-
filter: console/ui # Filter pages containing this substring in their URL
|
|
414
|
-
attribute_name: console-ui-index # Save the result in this attribute
|
|
415
|
-
output_file: redpanda-labs/console-ui-index.json # Save data to this file
|
|
416
|
-
docker_labs:
|
|
417
|
-
component: redpanda-labs
|
|
418
|
-
filter: docker-compose
|
|
419
|
-
env_type: Docker
|
|
420
|
-
attribute_name: docker-labs-index
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
==== Use the generated data
|
|
424
|
-
|
|
425
|
-
The index data can be referenced in AsciiDoc pages by specifying the following required attributes:
|
|
426
|
-
|
|
427
|
-
```asciidoc
|
|
428
|
-
= CONSOLE UI
|
|
429
|
-
:page-index-data: console-ui-index <1>
|
|
430
|
-
:page-role: index-list <2>
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
<1> The attribute whose data you want to display on the page. This must match an attribute configured in the extension.
|
|
434
|
-
<2> The page role. This role specfies the UI template that renders the data in the `page-index-data` on the page.
|
|
435
|
-
|
|
436
|
-
You can optionally display pages only if they match the component and version of the current Asciidoc page by adding the `:page-match-component-version:` attribute.
|
|
437
|
-
|
|
438
|
-
```asciidoc
|
|
439
|
-
= CONSOLE UI
|
|
440
|
-
:page-index-data: console-ui-index
|
|
441
|
-
:page-role: index-list
|
|
442
|
-
:page-match-component-version: ''
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
=== Redpanda Connect tag modifier
|
|
446
|
-
|
|
447
|
-
This extension updates the playbook to use the latest release tag for the Redpanda Connect documentation. It ensures that the Redpanda Connect documentation is always pulled from the latest release tag available on GitHub.
|
|
448
|
-
|
|
449
|
-
==== Environment variables
|
|
450
|
-
|
|
451
|
-
- `REDPANDA_GITHUB_TOKEN` (optional): A Personal access token (PAT) that has `repo` permissions for the `redpanda-data` GitHub organization.
|
|
452
|
-
|
|
453
|
-
NOTE: If you don't set the environment variable, the latest version of Redpanda Connect may not be fetched. When the environment variable is not set, the extension sends unauthenticated requests to GitHub. Unauthenticated requests may result in hitting the API rate limit and cause GitHub to reject the request. In this case the fallback version is used. This version is defined in the playbook where the extension is registered.
|
|
454
|
-
|
|
455
|
-
==== Configuration options
|
|
456
|
-
|
|
457
|
-
There are no configurable options for this extension.
|
|
458
|
-
|
|
459
|
-
==== Registration
|
|
460
|
-
|
|
461
|
-
```yaml
|
|
462
|
-
antora:
|
|
463
|
-
extensions:
|
|
464
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/modify-connect-tag-playbook'
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
=== Version fetcher
|
|
468
|
-
|
|
469
|
-
This extension fetches the latest release versions from GitHub.
|
|
470
|
-
|
|
471
|
-
The following attributes are available to all versions of all Antora components:
|
|
472
|
-
|
|
473
|
-
`latest-console-version`: The latest release version of Redpanda Console.
|
|
474
|
-
`latest-connect-version`: The latest release version of Redpanda Connect.
|
|
475
|
-
`redpanda-beta-version`: The latest RC version of Redpanda.
|
|
476
|
-
`redpanda-beta-commit`: The commit hash for the latest RC version of Redpanda.
|
|
477
|
-
|
|
478
|
-
The following attributes are available to the latest version of the `ROOT` component (Redpanda docs):
|
|
479
|
-
|
|
480
|
-
`full-version`: The latest release version of Redpanda.
|
|
481
|
-
`latest-release-commit`: The commit hash for the latest release version of Redpanda.
|
|
482
|
-
`latest-operator-version`: The latest release version of the Redpanda Operator.
|
|
483
|
-
`latest-redpanda-helm-chart-version`: The latest release version of the Redpanda Helm chart.
|
|
484
|
-
|
|
485
|
-
==== Environment variables
|
|
486
|
-
|
|
487
|
-
- `REDPANDA_GITHUB_TOKEN` (optional): A Personal access token (PAT) that has `repo` permissions for the `redpanda-data` GitHub organization.
|
|
488
|
-
|
|
489
|
-
NOTE: If you don't set the environment variable, the latest versions may not be fetched. When the environment variable is not set, the extension sends unauthenticated requests to GitHub. Unauthenticated requests may result in hitting the API rate limit and cause GitHub to reject the request.
|
|
490
|
-
|
|
491
|
-
==== Registration
|
|
492
|
-
|
|
493
|
-
```yaml
|
|
494
|
-
antora:
|
|
495
|
-
extensions:
|
|
496
|
-
- '@redpanda-data/docs-extensions-and-macros/extensions/version-fetcher/set-latest-version'
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
=== Validate attributes
|
|
500
|
-
|
|
501
|
-
This extension ensures the consistency and validity of page attributes, focusing on validating page categories against a predefined list of valid categories and subcategories. It automatically adds missing parent categories for any specified subcategories and removes any specified categories that are invalid. Additionally, it processes specific environment attributes, setting corresponding page-level attributes when environment conditions are met.
|
|
502
|
-
|
|
503
|
-
==== Environment variables
|
|
504
|
-
|
|
505
|
-
This extension does not require any environment variables.
|
|
506
|
-
|
|
507
|
-
==== Configuration options
|
|
508
|
-
|
|
509
|
-
There are no configurable options for this extension. It operates based on site attributes defined in `add-global-attributes.js` to determine valid categories and subcategories.
|
|
510
|
-
|
|
511
|
-
==== Registration
|
|
512
|
-
|
|
513
|
-
Register the `validate-attributes` extension in the Antora playbook under the `antora.extensions` key like so:
|
|
514
|
-
|
|
515
|
-
[source,yaml]
|
|
516
|
-
----
|
|
517
|
-
antora:
|
|
518
|
-
extensions:
|
|
519
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/validate-attributes.js'
|
|
520
|
-
----
|
|
521
|
-
|
|
522
|
-
=== Related docs
|
|
523
|
-
|
|
524
|
-
This extension enhances the connectivity between lab exercises and relevant documentation by dynamically identifying and linking related documentation pages and other lab exercises based on shared categories and deployment types.
|
|
525
|
-
|
|
526
|
-
==== Environment variables
|
|
527
|
-
|
|
528
|
-
This extension operates without requiring any specific environment variables.
|
|
529
|
-
|
|
530
|
-
==== Configuration options
|
|
531
|
-
|
|
532
|
-
This extension does not offer configurable options. It uses the inherent attributes of pages to determine relationships based on `page-categories` and deployment types (`env-kubernetes`, `env-linux`, `env-docker`, `page-cloud`).
|
|
533
|
-
|
|
534
|
-
==== Registration
|
|
535
|
-
|
|
536
|
-
To integrate the `related-docs-extension` into your Antora playbook, add it under the `antora.extensions` key as demonstrated below:
|
|
537
|
-
|
|
538
|
-
[source,yaml]
|
|
539
|
-
----
|
|
540
|
-
antora:
|
|
541
|
-
extensions:
|
|
542
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/related-docs-extension.js'
|
|
543
|
-
----
|
|
544
|
-
|
|
545
|
-
=== Related labs
|
|
546
|
-
|
|
547
|
-
This extension enriches documentation pages with links to related lab exercises, facilitating a deeper understanding of the content through practical application. It dynamically assigns related labs to each documentation page based on shared categories and deployment types.
|
|
548
|
-
|
|
549
|
-
==== Environment variables
|
|
550
|
-
|
|
551
|
-
This extension does not require any environment variables.
|
|
552
|
-
|
|
553
|
-
==== Configuration options
|
|
554
|
-
|
|
555
|
-
The extension operates without explicit configuration options. It automatically processes documentation pages to identify and link related labs based on shared `page-categories` attributes and deployment types (`env-kubernetes`, `env-linux`, `env-docker`, `page-cloud`).
|
|
556
|
-
|
|
557
|
-
==== Registration
|
|
558
|
-
|
|
559
|
-
Include the `related-labs-extension` in the Antora playbook under the `antora.extensions` key as follows:
|
|
560
|
-
|
|
561
|
-
[source,yaml]
|
|
562
|
-
----
|
|
563
|
-
antora:
|
|
564
|
-
extensions:
|
|
565
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/related-labs-extension.js'
|
|
566
|
-
----
|
|
567
|
-
|
|
568
|
-
=== Global attributes
|
|
569
|
-
|
|
570
|
-
This extension collects Asciidoc attributes from the {url-playbook}[`shared` component] or a local YAML file and makes them available to all component versions. Having global attributes is useful for consistent configuration of local and production builds.
|
|
571
|
-
|
|
572
|
-
==== Environment variables
|
|
573
|
-
|
|
574
|
-
This extension does not require any environment variables.
|
|
575
|
-
|
|
576
|
-
==== Configuration options
|
|
577
|
-
|
|
578
|
-
The extension accepts the following configuration options:
|
|
579
|
-
|
|
580
|
-
attributespath (optional):: Specifies the path to a local YAML file that contains global attributes. If this is provided, the extension will load attributes from this file first. If this path is not provided or no valid attributes are found in the file, the extension will fall back to loading attributes from the `shared` component.
|
|
581
|
-
|
|
582
|
-
==== Registration
|
|
583
|
-
|
|
584
|
-
```yml
|
|
585
|
-
antora:
|
|
586
|
-
extensions:
|
|
587
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/add-global-attributes'
|
|
588
|
-
attributespath: './local-attributes.yml'
|
|
589
|
-
```
|
|
590
|
-
|
|
591
|
-
In this example, the `attributespath` option points to a local YAML file (`./local-attributes.yml`), which contains the global attributes. The extension will load attributes from this file first before falling back to the `shared` component.
|
|
592
|
-
|
|
593
|
-
=== Produce redirects (customization of core Antora)
|
|
594
|
-
|
|
595
|
-
This extension replaces the default https://gitlab.com/antora/antora/-/tree/v3.1.x/packages/redirect-producer[`produceRedirects()` function] in Antora to handle redirect loops caused by https://docs.antora.org/antora/latest/page/page-aliases/[page aliases]. Normally, page aliases in Antora are used to resolve outdated links without causing issues. However, with https://docs.antora.org/antora/latest/playbook/urls-html-extension-style/#html-extension-style-key[`indexify`], the same URL may inadvertently be used for both the source and target of a redirect, leading to loops. This problem is https://antora.zulipchat.com/#narrow/stream/282400-users/topic/Redirect.20Loop.20Issue.20with.20Page.20Renaming.20and.20Indexify/near/433691700[recognized as a bug] in core Antora. For example, creating a page alias for `modules/manage/security/authorization.adoc` to point to `modules/manage/security/authorization/index.adoc' can lead to a redirect loop where `manage/security/authorization/` points to `manage/security/authorization/`. Furthermore, omitting the alias would lead to `xref not found` errors because Antora relies on the alias to resolve the old xrefs. This extension is necessary until such behaviors are natively supported or fixed in Antora core.
|
|
596
|
-
|
|
597
|
-
==== Environment variables
|
|
598
|
-
|
|
599
|
-
This extension does not require any environment variables.
|
|
600
|
-
|
|
601
|
-
==== Configuration options
|
|
602
|
-
|
|
603
|
-
There are no configurable options for this extension.
|
|
604
|
-
|
|
605
|
-
==== Registration
|
|
606
|
-
|
|
607
|
-
```yaml
|
|
608
|
-
antora:
|
|
609
|
-
extensions:
|
|
610
|
-
- '@redpanda-data/docs-extensions-and-macros/extensions/modify-redirects'
|
|
611
|
-
```
|
|
612
|
-
|
|
613
|
-
=== Replace attributes in attachments
|
|
614
|
-
|
|
615
|
-
This extension automates the replacement of AsciiDoc attribute placeholders with their respective values within attachment files, such as CSS, HTML, and YAML.
|
|
616
|
-
|
|
617
|
-
[NOTE]
|
|
618
|
-
====
|
|
619
|
-
- The `@` character is removed from attribute values to prevent potential issues with CSS or HTML syntax.
|
|
620
|
-
- If the same attribute placeholder is used multiple times within a file, all instances will be replaced with the attribute's value.
|
|
621
|
-
====
|
|
622
|
-
|
|
623
|
-
==== Environment variables
|
|
624
|
-
|
|
625
|
-
This extension does not require any environment variables.
|
|
626
|
-
|
|
627
|
-
==== Configuration options
|
|
628
|
-
|
|
629
|
-
The extension accepts the following configuration options in the Antora playbook:
|
|
630
|
-
|
|
631
|
-
data.replacements (required):: An array of replacement configurations. Each configuration can target multiple components and define specific file patterns and custom replacement rules.
|
|
632
|
-
|
|
633
|
-
* `components` (array of strings, required): Lists the names of the Antora components whose attachments should undergo attribute replacement.
|
|
634
|
-
|
|
635
|
-
* `file_patterns` (array of strings, required): Glob patterns specifying which attachment files to process. These patterns determine the files that will undergo attribute replacement based on their paths within the content catalog.
|
|
636
|
-
|
|
637
|
-
* `custom_replacements` (array of objects, optional): Defines custom search-and-replace rules to be applied to the matched files. Each rule consists of:
|
|
638
|
-
** `search` (string, required): A regular expression pattern to search for within the file content.
|
|
639
|
-
** `replace` (string, required): The string to replace each match found by the `search` pattern.
|
|
640
|
-
|
|
641
|
-
NOTE: Ensure that `file_patterns` accurately reflect the paths of the attachments you want to process. Overly broad patterns may include unintended files, while overly restrictive patterns might exclude necessary resources.
|
|
642
|
-
|
|
643
|
-
==== Registration
|
|
644
|
-
|
|
645
|
-
This is an example of how to register and configure the `replace-attributes-in-attachments` extension in your Antora playbook. This example demonstrates defining multiple replacement configurations, each targeting different components and specifying their own file patterns and custom replacements.
|
|
646
|
-
|
|
647
|
-
```yaml
|
|
648
|
-
antora:
|
|
649
|
-
extensions:
|
|
650
|
-
- require: './extensions/replace-attributes-in-attachments'
|
|
651
|
-
data:
|
|
652
|
-
replacements:
|
|
653
|
-
- components:
|
|
654
|
-
- 'ROOT'
|
|
655
|
-
- 'redpanda-labs'
|
|
656
|
-
file_patterns:
|
|
657
|
-
- '**/docker-compose.yaml'
|
|
658
|
-
- '**/docker-compose.yml'
|
|
659
|
-
custom_replacements:
|
|
660
|
-
- search: ''\\$\\{CONFIG_FILE:[^}]*\\}''
|
|
661
|
-
replace: 'console.yaml'
|
|
662
|
-
- components:
|
|
663
|
-
- 'API'
|
|
664
|
-
file_patterns:
|
|
665
|
-
- '**/api-docs/**/resources/**'
|
|
666
|
-
custom_replacements:
|
|
667
|
-
- search: '\\$\\{API_ENDPOINT:[^}]*\\}'
|
|
668
|
-
replace: 'https://api.example.com'
|
|
669
|
-
```
|
|
670
|
-
|
|
671
|
-
=== Aggregate terms
|
|
672
|
-
|
|
673
|
-
This extension aggregates all term pages from the {url-playbook}[`shared` component] and does the following:
|
|
674
|
-
|
|
675
|
-
- Makes all `term-name`, `hover-text`, and `link` attributes available to the <<glossterm-macro,`glossterm` macro>>.
|
|
676
|
-
- Looks for glossary pages named `reference:glossary.adoc` in all versions of all components and appends the contents of each term file to the glossary in alphabetical order.
|
|
677
|
-
- If a glossary page is found, sets the `glossary-page` attribute of the <<glossterm, `glossterm` macro>> to `reference:glossary.adoc` so that terms can be linked to the glossary page.
|
|
678
|
-
|
|
679
|
-
==== Environment variables
|
|
680
|
-
|
|
681
|
-
This extension does not require any environment variables.
|
|
682
|
-
|
|
683
|
-
==== Configuration options
|
|
684
|
-
|
|
685
|
-
The extension accepts the following configuration options:
|
|
686
|
-
|
|
687
|
-
termspath (optional):: Specifies the path to a local directory containing term files (in `.adoc` format). If this path is provided, the extension will attempt to load terms from this directory first. If this path is not provided or no valid terms are found in the specified directory, the extension will fall back to loading terms from the `shared` component.
|
|
688
|
-
|
|
689
|
-
Term files should follow the following structure:
|
|
690
|
-
|
|
691
|
-
```asciidoc
|
|
692
|
-
:category: Documentation
|
|
693
|
-
:hover-text: This is a description of the term.
|
|
694
|
-
:link: https://example.com
|
|
695
|
-
|
|
696
|
-
== Term Title
|
|
697
|
-
|
|
698
|
-
This is the detailed description of the term.
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
==== Registration
|
|
702
|
-
|
|
703
|
-
```yml
|
|
704
|
-
antora:
|
|
705
|
-
extensions:
|
|
706
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/aggregate-terms'
|
|
707
|
-
termspath: './local-terms/'
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
In this example, the `termspath` option points to a local directory (./local-terms/), where the term files are stored. The extension will load terms from this directory first before falling back to the `shared` component.
|
|
711
|
-
|
|
712
|
-
=== Unlisted pages
|
|
713
|
-
|
|
714
|
-
This extension identifies and logs any pages that aren't listed in the navigation (nav) file of each version of each component. It then optionally adds these unlisted pages to the end of the navigation tree under a configurable heading.
|
|
715
|
-
|
|
716
|
-
IMPORTANT: By default, this extension excludes components named 'api'. This behavior is hardcoded and cannot be changed in the configuration.
|
|
717
|
-
|
|
718
|
-
==== Environment variables
|
|
719
|
-
|
|
720
|
-
This extension does not require any environment variables.
|
|
721
|
-
|
|
722
|
-
==== Configuration options
|
|
723
|
-
|
|
724
|
-
This extension accepts the following configuration options:
|
|
725
|
-
|
|
726
|
-
addToNavigation (optional)::
|
|
727
|
-
Whether to add unlisted pages to the navigation. The default is `false` (unlisted pages are not added).
|
|
728
|
-
|
|
729
|
-
unlistedPagesHeading (optional)::
|
|
730
|
-
The heading under which to list the unlisted pages in the navigation. The default is 'Unlisted Pages'.
|
|
731
|
-
|
|
732
|
-
==== Registration
|
|
733
|
-
|
|
734
|
-
```yaml
|
|
735
|
-
antora:
|
|
736
|
-
extensions:
|
|
737
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/unlisted-pages'
|
|
738
|
-
addToNavigation: true
|
|
739
|
-
unlistedPagesHeading: 'Additional Resources'
|
|
740
|
-
```
|
|
741
|
-
|
|
742
|
-
=== Process context switcher
|
|
743
|
-
|
|
744
|
-
This extension processes the `page-context-switcher` attribute to enable cross-version navigation widgets in documentation pages. It automatically replaces "current" references with full resource IDs and injects the context switcher configuration to all referenced target pages, ensuring bidirectional navigation works correctly.
|
|
745
|
-
|
|
746
|
-
The extension finds pages with the `page-context-switcher` attribute, parses the JSON configuration, and:
|
|
747
|
-
|
|
748
|
-
1. Replaces any "current" values with the full resource ID of the current page
|
|
749
|
-
2. Finds all target pages referenced in the switcher configuration
|
|
750
|
-
3. Injects the same context switcher attribute to target pages (with appropriate resource ID mappings)
|
|
751
|
-
4. Builds resource IDs in the format: `version@component:module:relative-path`
|
|
752
|
-
|
|
753
|
-
This enables UI components to render version switchers that work across different versions of the same content.
|
|
754
|
-
|
|
755
|
-
==== Environment variables
|
|
756
|
-
|
|
757
|
-
This extension does not require any environment variables.
|
|
758
|
-
|
|
759
|
-
==== Configuration options
|
|
760
|
-
|
|
761
|
-
This extension does not require any configuration options.
|
|
762
|
-
|
|
763
|
-
==== Registration
|
|
764
|
-
|
|
765
|
-
```yaml
|
|
766
|
-
antora:
|
|
767
|
-
extensions:
|
|
768
|
-
- require: '@redpanda-data/docs-extensions-and-macros/extensions/process-context-switcher'
|
|
769
|
-
```
|
|
770
|
-
|
|
771
|
-
==== Usage
|
|
772
|
-
|
|
773
|
-
Add the `page-context-switcher` attribute to any page where you want cross-version navigation:
|
|
774
|
-
|
|
775
|
-
```asciidoc
|
|
776
|
-
:page-context-switcher: [{"name": "Version 2.x", "to": "24.3@ROOT:console:config/security/authentication.adoc" },{"name": "Version 3.x", "to": "current" }]
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
==== Processed output
|
|
780
|
-
|
|
781
|
-
After processing, the "current" reference is replaced with the full resource ID:
|
|
782
|
-
|
|
783
|
-
```json
|
|
784
|
-
[
|
|
785
|
-
{"name": "Version 2.x", "to": "24.3@ROOT:console:config/security/authentication.adoc"},
|
|
786
|
-
{"name": "Version 3.x", "to": "current@ROOT:console:config/security/authentication.adoc"}
|
|
787
|
-
]
|
|
788
|
-
```
|
|
789
|
-
|
|
790
|
-
The target page (`24.3@ROOT:console:config/security/authentication.adoc`) will also receive the same context switcher configuration with appropriate resource ID mappings.
|
|
791
|
-
|
|
792
|
-
==== UI integration
|
|
793
|
-
|
|
794
|
-
The processed attribute can be used in Handlebars templates:
|
|
795
|
-
|
|
796
|
-
```html
|
|
797
|
-
<div class="context-switcher">
|
|
798
|
-
{{#each (obj page.attributes.page-context-switcher)}}
|
|
799
|
-
<a
|
|
800
|
-
id="{{{this.name}}}"
|
|
801
|
-
href="{{{relativize (resolve-resource this.to)}}}"
|
|
802
|
-
class="context-link {{#if (eq @root.page.url (resolve-resource this.to))}}active{{/if}}"
|
|
803
|
-
>
|
|
804
|
-
<button type="button">{{{this.name}}}</button>
|
|
805
|
-
</a>
|
|
806
|
-
{{/each}}
|
|
807
|
-
</div>
|
|
808
|
-
```
|
|
809
|
-
|
|
810
|
-
== Asciidoc Extensions
|
|
811
|
-
|
|
812
|
-
This section documents the Asciidoc extensions that are provided by this library and how to configure them.
|
|
813
|
-
|
|
814
|
-
IMPORTANT: Be sure to register each extension under the `asciidoc.extensions` key in the playbook, not the `antora.extensions` key.
|
|
815
|
-
|
|
816
|
-
=== Add line numbers and highlights
|
|
817
|
-
|
|
818
|
-
This extension adds the necessary classes to make line numbers and line highlighting work with Prism.js.
|
|
819
|
-
|
|
820
|
-
==== Registration
|
|
821
|
-
|
|
822
|
-
```yaml
|
|
823
|
-
antora:
|
|
824
|
-
extensions:
|
|
825
|
-
- '@redpanda-data/docs-extensions-and-macros/asciidoc-extensions/add-line-numbers-highlights'
|
|
826
|
-
```
|
|
827
|
-
|
|
828
|
-
== Macros
|
|
829
|
-
|
|
830
|
-
This section documents the Asciidoc macros that are provided by this library and how to configure them.
|
|
831
|
-
|
|
832
|
-
IMPORTANT: Be sure to register each extension under the `asciidoc.extensions` key in the playbook, not the `antora.extensions` key.
|
|
833
|
-
|
|
834
|
-
=== config_ref
|
|
835
|
-
|
|
836
|
-
This inline macro is used to generate a reference to a configuration value in the Redpanda documentation. The macro's parameters allow for control over the generated reference's format and the type of output produced.
|
|
837
|
-
|
|
838
|
-
==== Usage
|
|
839
|
-
|
|
840
|
-
The `config_ref` macro is used in an AsciiDoc document as follows:
|
|
841
|
-
|
|
842
|
-
[,asciidoc]
|
|
843
|
-
----
|
|
844
|
-
config_ref:configRef,isLink,path[]
|
|
845
|
-
----
|
|
846
|
-
|
|
847
|
-
The `config_ref` macro takes three parameters:
|
|
848
|
-
|
|
849
|
-
configRef::
|
|
850
|
-
This is the configuration reference, which is also used to generate the anchor link if `isLink` is `true`.
|
|
851
|
-
|
|
852
|
-
isLink::
|
|
853
|
-
Whether the output should be a link. If `isLink` is set to `true`, the output will be a cross-reference (xref) to the relevant configuration value.
|
|
854
|
-
|
|
855
|
-
path::
|
|
856
|
-
This is the path to the document where the configuration value is defined. This parameter is used to to generate the link if `isLink` is `true`.
|
|
857
|
-
|
|
858
|
-
IMPORTANT: The path must be the name of a document at the root of the `reference` module.
|
|
859
|
-
|
|
860
|
-
NOTE: The `config_ref` macro is environment-aware. It checks if the document it is being used in is part of a Kubernetes environment by checking if the `env-kubernetes` attribute is set in the document's attributes. Depending on this check, it either prepends `storage.tieredConfig.` to the `configRef` or just uses the `configRef` as is.
|
|
861
|
-
|
|
862
|
-
For example:
|
|
863
|
-
|
|
864
|
-
[,asciidoc]
|
|
865
|
-
----
|
|
866
|
-
config_ref:example_config,true,tunable-properties[]
|
|
867
|
-
----
|
|
868
|
-
|
|
869
|
-
==== Registration
|
|
870
|
-
|
|
871
|
-
[,yaml]
|
|
872
|
-
----
|
|
873
|
-
asciidoc:
|
|
874
|
-
extensions:
|
|
875
|
-
- '@redpanda-data/docs-extensions-and-macros/macros/config-ref'
|
|
876
|
-
----
|
|
877
|
-
|
|
878
|
-
=== glossterm
|
|
879
|
-
|
|
880
|
-
The `glossterm` inline macro provides a way to define and reference glossary terms in your AsciiDoc documents.
|
|
881
|
-
|
|
882
|
-
NOTE: This macro is a customized version of https://gitlab.com/djencks/asciidoctor-glossary[`asciidoctor-glossary`].
|
|
883
|
-
|
|
884
|
-
==== Usage
|
|
885
|
-
|
|
886
|
-
Use the `glossterm` inline macro to reference a term within the text of the document:
|
|
887
|
-
|
|
888
|
-
[,asciidoc]
|
|
889
|
-
----
|
|
890
|
-
glossterm:my term[myDefinition]
|
|
891
|
-
----
|
|
892
|
-
|
|
893
|
-
It takes two parameters:
|
|
894
|
-
|
|
895
|
-
term::
|
|
896
|
-
The term to be defined.
|
|
897
|
-
|
|
898
|
-
definition (optional)::
|
|
899
|
-
The definition of the term. If the term is defined in the {url-playbook}[`shared` component] or the `local-terms` object of the `antora.yml` file, you can omit the definition as it will always be replaced by those definitions.
|
|
900
|
-
|
|
901
|
-
==== Configuration options
|
|
902
|
-
|
|
903
|
-
glossary-log-terms (optional)::
|
|
904
|
-
Whether to log a textual representation of a definition list item to the console.
|
|
905
|
-
|
|
906
|
-
glossary-term-role (optional)::
|
|
907
|
-
Role to assign each term. By default, glossary terms are assigned the `glossary-term` role, which gives them the class `glossary-term` in generated html.
|
|
908
|
-
|
|
909
|
-
glossary-links (optional)::
|
|
910
|
-
Whether to generate links to glossary entries.
|
|
911
|
-
By default, links to the glossary entries are generated from the glossary terms. To avoid this, set the attribute to `false` as either asciidoctor configuration or a header attribute.
|
|
912
|
-
|
|
913
|
-
glossary-page (optional)::
|
|
914
|
-
Target page for glossary links. By default, links are generated to the same page as the glossary term. To specify the target page, set this attribute to the resource ID of a page where the `glossary` block macro is used.
|
|
915
|
-
|
|
916
|
-
glossary-tooltip (optional)::
|
|
917
|
-
Whether to enable tooltips for the defined terms. Valid values are:
|
|
918
|
-
- title: This uses the browser built-in `title` attribute to display the definition.
|
|
919
|
-
|
|
920
|
-
- true: This inserts the definition as the value of the attribute `data-glossary-tooltip`.
|
|
921
|
-
|
|
922
|
-
- data-<attribute-name>: This inserts the definition as the value of the supplied attribute name, which must start with `data`.
|
|
923
|
-
|
|
924
|
-
The last two options are intended to support js/css tooltip solutions such as tippy.js.
|
|
925
|
-
|
|
926
|
-
==== Registration
|
|
927
|
-
|
|
928
|
-
[,yaml]
|
|
929
|
-
----
|
|
24
|
+
- '@redpanda-data/docs-extensions-and-macros/extensions/version-fetcher/set-latest-version'
|
|
930
25
|
asciidoc:
|
|
931
26
|
extensions:
|
|
932
27
|
- '@redpanda-data/docs-extensions-and-macros/macros/glossary'
|
|
933
28
|
----
|
|
934
29
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
This is an inline macro to create links to a Helm `values.yaml` file on ArtifactHub.
|
|
938
|
-
|
|
939
|
-
==== Usage
|
|
940
|
-
|
|
941
|
-
In an AsciiDoc document, use the `helm_ref` macro as follows:
|
|
942
|
-
|
|
943
|
-
[,asciidoc]
|
|
944
|
-
----
|
|
945
|
-
helm_ref:<helmRef>[]
|
|
946
|
-
----
|
|
947
|
-
|
|
948
|
-
Where `<helmRef>` is the Helm configuration value you want to reference in the `values.yaml` file.
|
|
949
|
-
|
|
950
|
-
For example:
|
|
30
|
+
== Documentation
|
|
951
31
|
|
|
952
|
-
|
|
32
|
+
link:extensions/README.adoc[**Antora extensions**]:: Extensions that enhance the Antora build process
|
|
953
33
|
|
|
954
|
-
[
|
|
955
|
-
----
|
|
956
|
-
helm_ref:myConfigValue[]
|
|
957
|
-
----
|
|
34
|
+
link:macros/README.adoc[**AsciiDoc macros**]:: Custom inline and block macros for documentation
|
|
958
35
|
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
[,asciidoc]
|
|
962
|
-
----
|
|
963
|
-
For default values and documentation for configuration options, see the https://artifacthub.io/packages/helm/redpanda-data/redpanda?modal=values&path=myConfigValue[values.yaml] file.
|
|
964
|
-
----
|
|
36
|
+
link:mcp/README.adoc[**MCP server**]:: Model Context Protocol server for automating documentation tasks with Claude Code
|
|
965
37
|
|
|
966
|
-
|
|
38
|
+
link:CLI_REFERENCE.adoc[**CLI reference**]:: Complete command reference for `doc-tools`
|
|
967
39
|
|
|
968
|
-
|
|
40
|
+
link:CONTRIBUTING.adoc[**Contributing**]:: Development setup and guidelines
|
|
969
41
|
|
|
970
|
-
|
|
971
|
-
----
|
|
972
|
-
asciidoc:
|
|
973
|
-
extensions:
|
|
974
|
-
- '@redpanda-data/docs-extensions-and-macros/macros/helm-ref'
|
|
975
|
-
----
|
|
42
|
+
== What's included
|
|
976
43
|
|
|
977
|
-
===
|
|
44
|
+
=== Antora extensions
|
|
978
45
|
|
|
979
|
-
|
|
46
|
+
Extensions that enhance Antora's build process:
|
|
980
47
|
|
|
981
|
-
|
|
48
|
+
* **Version management** - Automatically fetch latest versions from GitHub
|
|
49
|
+
* **Content generation** - Generate indexes, categories, and structured data
|
|
50
|
+
* **Navigation** - Manage unlisted pages, redirects, and cross-version links
|
|
51
|
+
* **Integrations** - Algolia indexing, EOL banners, related content
|
|
52
|
+
* **File processing** - Archive attachments, replace attributes, collect samples
|
|
982
53
|
|
|
983
|
-
|
|
54
|
+
=== AsciiDoc macros
|
|
984
55
|
|
|
985
|
-
|
|
986
|
-
components_by_category::[<type>]
|
|
987
|
-
```
|
|
56
|
+
Inline and block macros for documentation:
|
|
988
57
|
|
|
989
|
-
|
|
58
|
+
* `glossterm` - Reference glossary terms with tooltips
|
|
59
|
+
* `config_ref` - Link to configuration properties
|
|
60
|
+
* `helm_ref` - Link to Helm values
|
|
61
|
+
* `components_by_category` - Display Redpanda Connect components
|
|
62
|
+
* `component_table` - Searchable component table
|
|
990
63
|
|
|
991
|
-
|
|
992
|
-
asciidoc:
|
|
993
|
-
extensions:
|
|
994
|
-
- '@redpanda-data/docs-extensions-and-macros/macros/rp-connect-components'
|
|
995
|
-
```
|
|
64
|
+
=== Documentation automation (MCP server)
|
|
996
65
|
|
|
997
|
-
|
|
66
|
+
A Model Context Protocol server that exposes doc-tools to Claude Code:
|
|
998
67
|
|
|
999
|
-
|
|
68
|
+
* Generate property, metrics, and RPK documentation
|
|
69
|
+
* Update connector reference documentation
|
|
70
|
+
* Get version information
|
|
71
|
+
* Review generated content for quality
|
|
1000
72
|
|
|
1001
|
-
|
|
73
|
+
== Support
|
|
1002
74
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
```asciidoc
|
|
1006
|
-
component_table::[]
|
|
1007
|
-
```
|
|
1008
|
-
|
|
1009
|
-
==== Registration
|
|
1010
|
-
|
|
1011
|
-
```yaml
|
|
1012
|
-
asciidoc:
|
|
1013
|
-
extensions:
|
|
1014
|
-
- '@redpanda-data/docs-extensions-and-macros/macros/rp-connect-components'
|
|
1015
|
-
```
|
|
1016
|
-
|
|
1017
|
-
=== component_type_dropdown
|
|
1018
|
-
|
|
1019
|
-
This macro generates a dropdown of other supported types for a particular component, allowing users to switch between different types.
|
|
1020
|
-
|
|
1021
|
-
The types are fetched from the `flatComponentsData` that's generated in the <<Component category aggregator>> extension.
|
|
1022
|
-
|
|
1023
|
-
==== Usage
|
|
1024
|
-
|
|
1025
|
-
```asciidoc
|
|
1026
|
-
component_type_dropdown::[]
|
|
1027
|
-
```
|
|
1028
|
-
|
|
1029
|
-
==== Registration
|
|
1030
|
-
|
|
1031
|
-
```yaml
|
|
1032
|
-
asciidoc:
|
|
1033
|
-
extensions:
|
|
1034
|
-
- '@redpanda-data/docs-extensions-and-macros/macros/rp-connect-components'
|
|
1035
|
-
```
|
|
1036
|
-
|
|
1037
|
-
== Development quickstart
|
|
1038
|
-
|
|
1039
|
-
This section provides information on how to develop this project.
|
|
1040
|
-
|
|
1041
|
-
=== Prerequisites
|
|
1042
|
-
|
|
1043
|
-
To build this project, you need the following software installed on your computer:
|
|
1044
|
-
|
|
1045
|
-
* {url-git}[git] (command: `git`)
|
|
1046
|
-
* {url-nodejs}[Node.js] (commands: `node`, `npm`, and `npx`)
|
|
1047
|
-
|
|
1048
|
-
==== git
|
|
1049
|
-
|
|
1050
|
-
Make sure you have git installed.
|
|
1051
|
-
|
|
1052
|
-
[,bash]
|
|
1053
|
-
----
|
|
1054
|
-
git --version
|
|
1055
|
-
----
|
|
1056
|
-
|
|
1057
|
-
If not, {url-git-dl}[download and install] the git package for your system.
|
|
1058
|
-
|
|
1059
|
-
==== Node.js
|
|
1060
|
-
|
|
1061
|
-
Make sure that you have Node.js installed (which also provides npm and npx).
|
|
1062
|
-
|
|
1063
|
-
[,bash]
|
|
1064
|
-
----
|
|
1065
|
-
node --version
|
|
1066
|
-
----
|
|
1067
|
-
|
|
1068
|
-
If this command fails with an error, you don't have Node.js installed.
|
|
1069
|
-
|
|
1070
|
-
Now that you have git and Node.js installed, you're ready to start developing on this project.
|
|
1071
|
-
|
|
1072
|
-
=== Clone the project
|
|
1073
|
-
|
|
1074
|
-
Clone the project using git:
|
|
1075
|
-
|
|
1076
|
-
[,bash,subs=attributes+]
|
|
1077
|
-
----
|
|
1078
|
-
git clone {url-project}
|
|
1079
|
-
----
|
|
1080
|
-
|
|
1081
|
-
Change into the project directory and stay in this directory when running all subsequent commands.
|
|
1082
|
-
|
|
1083
|
-
=== Install dependencies
|
|
1084
|
-
|
|
1085
|
-
Use npm to install the project's dependencies inside the project.
|
|
1086
|
-
In your terminal, run the following command:
|
|
1087
|
-
|
|
1088
|
-
[,bash]
|
|
1089
|
-
----
|
|
1090
|
-
npm ci
|
|
1091
|
-
----
|
|
1092
|
-
|
|
1093
|
-
This command installs the dependencies listed in `package-lock.json` into the `node_modules/` directory inside the project.
|
|
1094
|
-
This directory should _not_ be committed to the source control repository.
|
|
1095
|
-
|
|
1096
|
-
=== Use your local project
|
|
1097
|
-
|
|
1098
|
-
If you want to use the project locally before it is published, you can specify the path to the extensions in the `local-antora-playbook.yml` file.
|
|
1099
|
-
|
|
1100
|
-
[,yaml]
|
|
1101
|
-
----
|
|
1102
|
-
asciidoc:
|
|
1103
|
-
attributes:
|
|
1104
|
-
extensions:
|
|
1105
|
-
- '<path-to-local-project>/docs-extensions-and-macros/extensions/<extension-name>'
|
|
1106
|
-
----
|
|
75
|
+
Report issues at {url-project}/issues
|