@redpanda-data/docs-extensions-and-macros 4.10.2 → 4.10.4

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 CHANGED
@@ -502,11 +502,11 @@ function generatePropertyComparisonReport(oldTag, newTag, outputDir) {
502
502
  try {
503
503
  console.log(`\nšŸ“Š Generating detailed property comparison report...`);
504
504
 
505
- // Look for the property JSON files in modules/reference/examples
506
- const repoRoot = findRepoRoot();
507
- const examplesDir = path.join(repoRoot, 'modules', 'reference', 'examples');
508
- const oldJsonPath = path.join(examplesDir, `${oldTag}-properties.json`);
509
- const newJsonPath = path.join(examplesDir, `${newTag}-properties.json`);
505
+ // Look for the property JSON files in outputDir/examples
506
+ const repoRoot = findRepoRoot();
507
+ const examplesDir = path.join(repoRoot, outputDir, 'examples');
508
+ const oldJsonPath = path.join(examplesDir, `${oldTag}-properties.json`);
509
+ const newJsonPath = path.join(examplesDir, `${newTag}-properties.json`);
510
510
 
511
511
  // Check if JSON files exist
512
512
  if (!fs.existsSync(oldJsonPath)) {
@@ -1031,28 +1031,31 @@ automation
1031
1031
  });
1032
1032
 
1033
1033
  automation
1034
- .command('property-docs')
1035
- .description('Generate JSON and AsciiDoc documentation for Redpanda configuration properties. By default, only extracts properties to JSON. Use --generate-partials to create consolidated AsciiDoc partials (including deprecated properties). Use --generate-pages to create complete property pages that include the partials using AsciiDoc includes.')
1034
+ .command('property-docs')
1035
+ .description(
1036
+ 'Generate JSON and consolidated AsciiDoc partials for Redpanda configuration properties. ' +
1037
+ 'By default, only extracts properties to JSON. Use --generate-partials to create consolidated ' +
1038
+ 'AsciiDoc partials (including deprecated properties).'
1039
+ )
1036
1040
  .option('--tag <tag>', 'Git tag or branch to extract from', 'dev')
1037
1041
  .option('--diff <oldTag>', 'Also diff autogenerated properties from <oldTag> to <tag>')
1038
1042
  .option('--overrides <path>', 'Optional JSON file with property description overrides')
1039
1043
  .option('--output-dir <dir>', 'Where to write all generated files', 'modules/reference')
1040
1044
  .option('--cloud-support', 'Add AsciiDoc tags to generated property docs to indicate which ones are supported in Redpanda Cloud. This data is fetched from the cloudv2 repository so requires a GitHub token with repo permissions. Set the token as an environment variable using GITHUB_TOKEN, GH_TOKEN, or REDPANDA_GITHUB_TOKEN')
1041
- .option('--template-property-page <path>', 'Custom Handlebars template for property page layout')
1042
1045
  .option('--template-property <path>', 'Custom Handlebars template for individual property sections')
1043
1046
  .option('--template-topic-property <path>', 'Custom Handlebars template for individual topic property sections')
1047
+ .option('--template-topic-property-mappings <path>', 'Custom Handlebars template for topic property mappings table')
1044
1048
  .option('--template-deprecated <path>', 'Custom Handlebars template for deprecated properties page')
1045
1049
  .option('--template-deprecated-property <path>', 'Custom Handlebars template for individual deprecated property sections')
1046
1050
  .option('--generate-partials', 'Generate consolidated property partials (cluster-properties.adoc, topic-properties.adoc, etc.) in the partials directory')
1047
1051
  .option('--partials-dir <path>', 'Directory for property partials (relative to output-dir)', 'partials')
1048
- .option('--generate-pages', 'Generate complete property pages that include the partials using AsciiDoc includes')
1049
- .action((options) => {
1050
- verifyPropertyDependencies();
1052
+ .action((options) => {
1053
+ verifyPropertyDependencies();
1051
1054
 
1052
1055
  // Validate cloud support dependencies if requested
1053
1056
  if (options.cloudSupport) {
1054
1057
  console.log('šŸ” Validating cloud support dependencies...');
1055
-
1058
+
1056
1059
  // Check for GITHUB_TOKEN, GH_TOKEN, or REDPANDA_GITHUB_TOKEN
1057
1060
  const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN || process.env.REDPANDA_GITHUB_TOKEN;
1058
1061
  if (!token) {
@@ -1065,7 +1068,7 @@ automation
1065
1068
  console.error(' Or: export REDPANDA_GITHUB_TOKEN=your_token_here');
1066
1069
  process.exit(1);
1067
1070
  }
1068
-
1071
+
1069
1072
  console.log('šŸ“¦ Cloud support enabled - Python dependencies will be validated during execution');
1070
1073
  if (process.env.VIRTUAL_ENV) {
1071
1074
  console.log(` Using virtual environment: ${process.env.VIRTUAL_ENV}`);
@@ -1074,97 +1077,87 @@ automation
1074
1077
  console.log('āœ… GitHub token validated');
1075
1078
  }
1076
1079
 
1077
- const newTag = options.tag;
1078
- const oldTag = options.diff;
1079
- const overridesPath = options.overrides;
1080
- const outputDir = options.outputDir;
1081
- const cwd = path.resolve(__dirname, '../tools/property-extractor');
1082
-
1083
- const make = (tag, overrides, templates = {}, outputDir = 'modules/reference/', tempDir = null, cloudSupport = false) => {
1084
- console.log(`ā³ Building property docs for ${tag}${tempDir ? ' (for diff)' : ''}…`);
1085
- const args = ['build', `TAG=${tag}`];
1086
-
1087
- // Pass all paths as environment variables for consistency
1088
- const env = { ...process.env };
1089
- if (overrides) {
1090
- env.OVERRIDES = path.resolve(overrides);
1091
- }
1092
- if (cloudSupport) {
1093
- env.CLOUD_SUPPORT = '1';
1094
- }
1095
- if (templates.propertyPage) {
1096
- env.TEMPLATE_PROPERTY_PAGE = path.resolve(templates.propertyPage);
1097
- env.TEMPLATE_PROPERTY_PAGE_WITH_INCLUDES = env.TEMPLATE_PROPERTY_PAGE;
1098
- }
1099
- if (templates.property) {
1100
- env.TEMPLATE_PROPERTY = path.resolve(templates.property);
1101
- }
1102
- if (templates.topicProperty) {
1103
- env.TEMPLATE_TOPIC_PROPERTY = path.resolve(templates.topicProperty);
1104
- }
1105
- if (templates.deprecated) {
1106
- env.TEMPLATE_DEPRECATED = path.resolve(templates.deprecated);
1107
- }
1108
- if (templates.deprecatedProperty) {
1109
- env.TEMPLATE_DEPRECATED_PROPERTY = path.resolve(templates.deprecatedProperty);
1110
- }
1111
-
1112
- if (tempDir) {
1113
- env.OUTPUT_JSON_DIR = path.resolve(tempDir, 'examples');
1114
- env.OUTPUT_AUTOGENERATED_DIR = path.resolve(tempDir);
1115
- } else {
1116
- env.OUTPUT_JSON_DIR = path.resolve(outputDir, 'examples');
1117
- env.OUTPUT_AUTOGENERATED_DIR = path.resolve(outputDir);
1118
- // Set property files to go to properties subdirectory
1119
- env.OUTPUT_ASCIIDOC_DIR = path.resolve(outputDir, 'pages', 'properties');
1120
- }
1121
-
1122
- // Set partials generation options
1123
- if (options.generatePartials) {
1124
- env.GENERATE_PARTIALS = '1';
1125
- env.OUTPUT_PARTIALS_DIR = path.resolve(outputDir, options.partialsDir || 'partials');
1126
- }
1127
-
1128
- // Set page generation options
1129
- if (options.generatePages) {
1130
- env.GENERATE_PAGES = '1';
1131
- if (templates.propertyPage) {
1132
- env.TEMPLATE_PROPERTY_PAGE_WITH_INCLUDES = env.TEMPLATE_PROPERTY_PAGE;
1080
+ const newTag = options.tag;
1081
+ const oldTag = options.diff;
1082
+ const overridesPath = options.overrides;
1083
+ const outputDir = options.outputDir;
1084
+ const cwd = path.resolve(__dirname, '../tools/property-extractor');
1085
+
1086
+ const make = (tag, overrides, templates = {}, outDir = 'modules/reference/', tempDir = null) => {
1087
+ console.log(`ā³ Building property docs for ${tag}${tempDir ? ' (for diff)' : ''}…`);
1088
+ const args = ['build', `TAG=${tag}`];
1089
+
1090
+ // Pass all paths as environment variables for consistency
1091
+ const env = { ...process.env };
1092
+
1093
+ if (overrides) {
1094
+ env.OVERRIDES = path.resolve(overrides);
1095
+ }
1096
+ if (options.cloudSupport) {
1097
+ env.CLOUD_SUPPORT = '1';
1098
+ }
1099
+ if (templates.property) {
1100
+ env.TEMPLATE_PROPERTY = path.resolve(templates.property);
1101
+ }
1102
+ if (templates.topicProperty) {
1103
+ env.TEMPLATE_TOPIC_PROPERTY = path.resolve(templates.topicProperty);
1104
+ }
1105
+ if (templates.topicPropertyMappings) {
1106
+ env.TEMPLATE_TOPIC_PROPERTY_MAPPINGS = path.resolve(templates.topicPropertyMappings);
1107
+ }
1108
+ if (templates.deprecated) {
1109
+ env.TEMPLATE_DEPRECATED = path.resolve(templates.deprecated);
1110
+ }
1111
+ if (templates.deprecatedProperty) {
1112
+ env.TEMPLATE_DEPRECATED_PROPERTY = path.resolve(templates.deprecatedProperty);
1113
+ }
1114
+
1115
+ if (tempDir) {
1116
+ env.OUTPUT_JSON_DIR = path.resolve(tempDir, 'examples');
1117
+ env.OUTPUT_AUTOGENERATED_DIR = path.resolve(tempDir);
1118
+ } else {
1119
+ env.OUTPUT_JSON_DIR = path.resolve(outDir, 'examples');
1120
+ env.OUTPUT_AUTOGENERATED_DIR = path.resolve(outDir);
1133
1121
  }
1134
- }
1135
-
1136
- const r = spawnSync('make', args, { cwd, stdio: 'inherit', env });
1137
- if (r.error) {
1138
- console.error(`āŒ ${r.error.message}`);
1139
- process.exit(1);
1140
- }
1141
- if (r.status !== 0) process.exit(r.status);
1142
- };
1143
1122
 
1144
- // Collect template options
1145
- const templates = {
1146
- propertyPage: options.templatePropertyPage,
1147
- property: options.templateProperty,
1148
- topicProperty: options.templateTopicProperty,
1149
- deprecated: options.templateDeprecated,
1150
- deprecatedProperty: options.templateDeprecatedProperty
1151
- };
1123
+ // Partials generation options
1124
+ if (options.generatePartials) {
1125
+ env.GENERATE_PARTIALS = '1';
1126
+ env.OUTPUT_PARTIALS_DIR = path.resolve(outDir, options.partialsDir || 'partials');
1127
+ }
1152
1128
 
1153
- if (oldTag) {
1154
- // Generate old version directly to final destination so its JSON is available for comparison
1155
- make(oldTag, overridesPath, templates, outputDir, null, options.cloudSupport);
1156
- }
1129
+ const r = spawnSync('make', args, { cwd, stdio: 'inherit', env });
1130
+ if (r.error) {
1131
+ console.error(`āŒ ${r.error.message}`);
1132
+ process.exit(1);
1133
+ }
1134
+ if (r.status !== 0) process.exit(r.status);
1135
+ };
1136
+
1137
+ // Collect template options
1138
+ const templates = {
1139
+ property: options.templateProperty,
1140
+ topicProperty: options.templateTopicProperty,
1141
+ topicPropertyMappings: options.templateTopicPropertyMappings,
1142
+ deprecated: options.templateDeprecated,
1143
+ deprecatedProperty: options.templateDeprecatedProperty,
1144
+ };
1145
+
1146
+ if (oldTag) {
1147
+ // Build old version first so its JSON exists for the diff step
1148
+ make(oldTag, overridesPath, templates, outputDir, null);
1149
+ }
1157
1150
 
1158
- // Generate new version to final destination
1159
- make(newTag, overridesPath, templates, outputDir, null, options.cloudSupport);
1151
+ // Build new version
1152
+ make(newTag, overridesPath, templates, outputDir, null);
1160
1153
 
1161
- if (oldTag) {
1162
- // Generate property comparison report using the JSON files now in modules/reference/examples
1163
- generatePropertyComparisonReport(oldTag, newTag, 'modules/reference');
1164
- }
1154
+ if (oldTag) {
1155
+ // Generate property comparison report using the JSON now in outputDir/examples
1156
+ generatePropertyComparisonReport(oldTag, newTag, outputDir);
1157
+ }
1165
1158
 
1166
- process.exit(0);
1167
- });
1159
+ process.exit(0);
1160
+ });
1168
1161
 
1169
1162
  automation
1170
1163
  .command('rpk-docs')
@@ -1563,7 +1556,7 @@ automation
1563
1556
  automation
1564
1557
  .command('bundle-openapi')
1565
1558
  .description('Bundle Redpanda OpenAPI fragments for admin and connect APIs into complete OpenAPI 3.1 documents')
1566
- .requiredOption('-t, --tag <tag>', 'Git tag to check out (e.g., v24.3.2 or 24.3.2 or dev)')
1559
+ .requiredOption('-t, --tag <tag>', 'Branch or tag to clone from the repository (for example v24.3.2 or 24.3.2 or dev)')
1567
1560
  .option('--repo <url>', 'Repository URL', 'https://github.com/redpanda-data/redpanda.git')
1568
1561
  .addOption(new Option('-s, --surface <surface>', 'Which API surface(s) to bundle').choices(['admin', 'connect', 'both']).makeOptionMandatory())
1569
1562
  .option('--out-admin <path>', 'Output path for admin API', 'admin/redpanda-admin-api.yaml')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redpanda-data/docs-extensions-and-macros",
3
- "version": "4.10.2",
3
+ "version": "4.10.4",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",
@@ -148,7 +148,7 @@ function compareProperties(oldData, newData, oldVersion, newVersion) {
148
148
  name,
149
149
  type: prop.type,
150
150
  default: prop.default,
151
- description: prop.description ? prop.description.substring(0, 100) + '...' : 'No description'
151
+ description: prop.description || 'No description'
152
152
  });
153
153
  }
154
154
  }
@@ -185,8 +185,8 @@ function compareProperties(oldData, newData, oldVersion, newVersion) {
185
185
  if (oldProp.description !== newProp.description) {
186
186
  report.changedDescriptions.push({
187
187
  name,
188
- oldDescription: oldProp.description ? oldProp.description.substring(0, 50) + '...' : 'No description',
189
- newDescription: newProp.description ? newProp.description.substring(0, 50) + '...' : 'No description'
188
+ oldDescription: oldProp.description || 'No description',
189
+ newDescription: newProp.description || 'No description'
190
190
  });
191
191
  }
192
192
 
@@ -203,7 +203,7 @@ function compareProperties(oldData, newData, oldVersion, newVersion) {
203
203
  report.removedProperties.push({
204
204
  name,
205
205
  type: oldProp.type,
206
- description: oldProp.description ? oldProp.description.substring(0, 100) + '...' : 'No description'
206
+ description: oldProp.description || 'No description'
207
207
  });
208
208
  }
209
209
  }