@redpanda-data/docs-extensions-and-macros 5.2.5 → 5.3.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/bin/doc-tools.js +159 -0
- package/package.json +1 -1
- package/tools/property-extractor/property_extractor.py +39 -2
- package/tools/property-extractor/transformers.py +29 -13
- package/tools/rpk-docs/detect-platform-commands.js +566 -0
- package/tools/rpk-docs/generate-plugin-stubs.js +291 -0
- package/tools/rpk-docs/generate-rpk-docs.js +466 -30
- package/tools/rpk-docs/helpers/index.js +13 -3
- package/tools/rpk-docs/report-delta.js +314 -32
- package/tools/rpk-docs/rpk-docs-handler.js +1329 -208
- package/tools/rpk-docs/templates/command.hbs +17 -0
- package/tools/rpk-docs/templates/content-item.hbs +2 -2
- package/tools/rpk-docs/validate-overrides.js +16 -0
|
@@ -24,6 +24,11 @@ ifndef::env-cloud[]
|
|
|
24
24
|
{{/each}}
|
|
25
25
|
|
|
26
26
|
// tag::single-source[]
|
|
27
|
+
:description: {{{wrapDescriptionPassthrough shortDesc}}}
|
|
28
|
+
{{!-- The description attribute is repeated inside the tagged region so
|
|
29
|
+
single-sourcing consumers (stub pages that include this tag) inherit
|
|
30
|
+
the meta description. page-aliases and page-platforms deliberately stay
|
|
31
|
+
outside the tag: consumers must not inherit alias registrations. --}}
|
|
27
32
|
{{!-- Deprecation notice --}}
|
|
28
33
|
{{#if deprecated}}
|
|
29
34
|
[CAUTION]
|
|
@@ -384,8 +389,20 @@ This section provides examples of how to use `{{commandPath}}`.
|
|
|
384
389
|
|Command |Description
|
|
385
390
|
|
|
386
391
|
{{#each subcommands}}
|
|
392
|
+
{{#if cloudOnly}}
|
|
393
|
+
ifdef::env-cloud[]
|
|
394
|
+
{{/if}}
|
|
395
|
+
{{#if selfHostedOnly}}
|
|
396
|
+
ifndef::env-cloud[]
|
|
397
|
+
{{/if}}
|
|
387
398
|
|xref:{{xrefPath}}[`{{fullPath}}`]
|
|
388
399
|
|{{{shortDesc}}}
|
|
400
|
+
{{#if cloudOnly}}
|
|
401
|
+
endif::[]
|
|
402
|
+
{{/if}}
|
|
403
|
+
{{#if selfHostedOnly}}
|
|
404
|
+
endif::[]
|
|
405
|
+
{{/if}}
|
|
389
406
|
|
|
390
407
|
{{/each}}
|
|
391
408
|
|===
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
{{~#if (eq type "example")~}}
|
|
3
3
|
{{!-- Single structured example --}}
|
|
4
4
|
{{#if description}}
|
|
5
|
-
{{{description}}}
|
|
5
|
+
{{{ensurePeriod description}}}
|
|
6
6
|
|
|
7
7
|
{{/if}}
|
|
8
8
|
[,{{#if language}}{{language}}{{else}}bash{{/if}}{{#if attributes}}{{#each attributes}}{{#if @first}},{{/if}}{{@key}}="{{this}}"{{/each}}{{/if}}]
|
|
@@ -27,7 +27,7 @@ This section provides examples of how to use `{{commandPath}}`.
|
|
|
27
27
|
|
|
28
28
|
{{#each items}}
|
|
29
29
|
{{#if description}}
|
|
30
|
-
{{{description}}}
|
|
30
|
+
{{{ensurePeriod description}}}
|
|
31
31
|
|
|
32
32
|
{{/if}}
|
|
33
33
|
[,{{#if language}}{{language}}{{else}}bash{{/if}}{{#if attributes}}{{#each attributes}}{{#if @first}},{{/if}}{{@key}}="{{this}}"{{/each}}{{/if}}]
|
|
@@ -465,8 +465,24 @@ function validatePlatforms(commandOverride, context) {
|
|
|
465
465
|
function validateFlags(commandOverride, context) {
|
|
466
466
|
const result = new ValidationResult()
|
|
467
467
|
|
|
468
|
+
// cloudOnly and selfHostedOnly are mutually exclusive: setting both wraps
|
|
469
|
+
// the row in an ifdef::env-cloud + ifndef::env-cloud pair that no build
|
|
470
|
+
// can satisfy, so the row silently vanishes from BOTH sites.
|
|
471
|
+
if (commandOverride.cloudOnly && commandOverride.selfHostedOnly) {
|
|
472
|
+
result.addError(
|
|
473
|
+
'cloudOnly and selfHostedOnly are both set: the command row is unsatisfiable and disappears from every build. Set at most one.',
|
|
474
|
+
context
|
|
475
|
+
)
|
|
476
|
+
}
|
|
477
|
+
|
|
468
478
|
if (commandOverride.flags) {
|
|
469
479
|
for (const [flagName, flagOverride] of Object.entries(commandOverride.flags)) {
|
|
480
|
+
if (flagOverride.cloudOnly && flagOverride.selfHostedOnly) {
|
|
481
|
+
result.addError(
|
|
482
|
+
`cloudOnly and selfHostedOnly are both set on flag "${flagName}": the flag row is unsatisfiable and disappears from every build. Set at most one.`,
|
|
483
|
+
`${context}.flags.${flagName}`
|
|
484
|
+
)
|
|
485
|
+
}
|
|
470
486
|
// Validate flag name format
|
|
471
487
|
if (!flagName.match(/^[a-zA-Z][-a-zA-Z0-9]*$/)) {
|
|
472
488
|
result.addWarning(
|