@redpanda-data/docs-extensions-and-macros 4.12.5 → 4.13.0

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.
Files changed (62) hide show
  1. package/README.adoc +33 -1064
  2. package/bin/doc-tools-mcp.js +720 -0
  3. package/bin/doc-tools.js +1050 -50
  4. package/bin/mcp-tools/antora.js +153 -0
  5. package/bin/mcp-tools/cache.js +89 -0
  6. package/bin/mcp-tools/cloud-regions.js +127 -0
  7. package/bin/mcp-tools/content-review.js +196 -0
  8. package/bin/mcp-tools/crd-docs.js +153 -0
  9. package/bin/mcp-tools/frontmatter.js +138 -0
  10. package/bin/mcp-tools/generated-docs-review.js +887 -0
  11. package/bin/mcp-tools/helm-docs.js +152 -0
  12. package/bin/mcp-tools/index.js +245 -0
  13. package/bin/mcp-tools/job-queue.js +468 -0
  14. package/bin/mcp-tools/mcp-validation.js +266 -0
  15. package/bin/mcp-tools/metrics-docs.js +146 -0
  16. package/bin/mcp-tools/openapi.js +174 -0
  17. package/bin/mcp-tools/prompt-discovery.js +283 -0
  18. package/bin/mcp-tools/property-docs.js +157 -0
  19. package/bin/mcp-tools/rpcn-docs.js +113 -0
  20. package/bin/mcp-tools/rpk-docs.js +141 -0
  21. package/bin/mcp-tools/telemetry.js +211 -0
  22. package/bin/mcp-tools/utils.js +131 -0
  23. package/bin/mcp-tools/versions.js +168 -0
  24. package/cli-utils/convert-doc-links.js +1 -1
  25. package/cli-utils/github-token.js +58 -0
  26. package/cli-utils/self-managed-docs-branch.js +2 -2
  27. package/cli-utils/setup-mcp.js +313 -0
  28. package/docker-compose/25.1/transactions.md +1 -1
  29. package/docker-compose/transactions.md +1 -1
  30. package/extensions/DEVELOPMENT.adoc +464 -0
  31. package/extensions/README.adoc +124 -0
  32. package/extensions/REFERENCE.adoc +768 -0
  33. package/extensions/USER_GUIDE.adoc +339 -0
  34. package/extensions/generate-rp-connect-info.js +3 -4
  35. package/extensions/version-fetcher/get-latest-console-version.js +38 -27
  36. package/extensions/version-fetcher/get-latest-redpanda-helm-version-from-operator.js +1 -1
  37. package/extensions/version-fetcher/get-latest-redpanda-version.js +65 -54
  38. package/extensions/version-fetcher/retry-util.js +88 -0
  39. package/extensions/version-fetcher/set-latest-version.js +6 -3
  40. package/macros/DEVELOPMENT.adoc +377 -0
  41. package/macros/README.adoc +105 -0
  42. package/macros/REFERENCE.adoc +222 -0
  43. package/macros/USER_GUIDE.adoc +220 -0
  44. package/macros/rp-connect-components.js +6 -6
  45. package/package.json +12 -3
  46. package/tools/bundle-openapi.js +20 -10
  47. package/tools/cloud-regions/generate-cloud-regions.js +1 -1
  48. package/tools/fetch-from-github.js +18 -4
  49. package/tools/gen-rpk-ascii.py +3 -1
  50. package/tools/generate-cli-docs.js +325 -0
  51. package/tools/get-console-version.js +4 -2
  52. package/tools/get-redpanda-version.js +4 -2
  53. package/tools/metrics/metrics.py +19 -7
  54. package/tools/property-extractor/Makefile +7 -1
  55. package/tools/property-extractor/cloud_config.py +4 -4
  56. package/tools/property-extractor/constant_resolver.py +11 -11
  57. package/tools/property-extractor/property_extractor.py +18 -16
  58. package/tools/property-extractor/topic_property_extractor.py +2 -2
  59. package/tools/property-extractor/transformers.py +7 -7
  60. package/tools/property-extractor/type_definition_extractor.py +4 -4
  61. package/tools/redpanda-connect/README.adoc +1 -1
  62. package/tools/redpanda-connect/generate-rpcn-connector-docs.js +5 -3
@@ -23,7 +23,7 @@ INPUT FORMAT (from parser):
23
23
  - info["declaration"]: Full C++ type declaration
24
24
  - info["params"]: List of parsed constructor parameters
25
25
  - info["name_in_file"]: C++ variable name
26
- - info["type"]: Property template type (e.g., "property", "enterprise_property")
26
+ - info["type"]: Property template type (for example, "property", "enterprise_property")
27
27
 
28
28
  OUTPUT FORMAT (PropertyBag):
29
29
  - Complete JSON schema-compatible property definition
@@ -511,7 +511,7 @@ def get_meta_value(info, key, default=None):
511
511
 
512
512
  Args:
513
513
  info (dict): Property info dictionary to search for metadata
514
- key (str): Metadata key to extract (e.g., "needs_restart", "visibility")
514
+ key (str): Metadata key to extract (for example, "needs_restart", "visibility")
515
515
  default (any): Default value if key not found or metadata missing
516
516
 
517
517
  Returns:
@@ -1254,7 +1254,7 @@ class TypeTransformer:
1254
1254
 
1255
1255
  Parameters:
1256
1256
  text (str): The string to search for the template.
1257
- template_name (str): The template name (e.g., "std::vector" or "property").
1257
+ template_name (str): The template name (for example, "std::vector" or "property").
1258
1258
 
1259
1259
  Returns:
1260
1260
  str or None: The substring inside the outermost angle brackets for the matched template (excluding the brackets),
@@ -2068,7 +2068,7 @@ class EnterpriseTransformer:
2068
2068
  if len(val) >= 2 and val[0] == '"' and val[-1] == '"':
2069
2069
  val = val[1:-1]
2070
2070
  # Strip C++ namespace qualifiers from enum values
2071
- # e.g., model::partition_autobalancing_mode::continuous → continuous
2071
+ # for example, model::partition_autobalancing_mode::continuous → continuous
2072
2072
  if '::' in val:
2073
2073
  val = val.split('::')[-1]
2074
2074
  return val
@@ -2286,7 +2286,7 @@ class ValidatorEnumExtractor:
2286
2286
  Analyzes validator functions to extract enum constraints for array-typed properties.
2287
2287
  For example, if sasl_mechanisms uses validate_sasl_mechanisms, this transformer:
2288
2288
  1. Finds the validator function in validators.cc
2289
- 2. Identifies the constraint array (e.g., supported_sasl_mechanisms)
2289
+ 2. Identifies the constraint array (for example, supported_sasl_mechanisms)
2290
2290
  3. Resolves that array to get the actual enum values
2291
2291
  4. Adds them to property['items']['enum']
2292
2292
 
@@ -2294,7 +2294,7 @@ class ValidatorEnumExtractor:
2294
2294
  1. Detects array properties (type="array") with validator parameters
2295
2295
  2. Extracts validator function name from params
2296
2296
  3. Parses validator to find constraint array
2297
- 4. Resolves array to get enum values (e.g., ["SCRAM", "GSSAPI", "OAUTHBEARER", "PLAIN"])
2297
+ 4. Resolves array to get enum values (for example, ["SCRAM", "GSSAPI", "OAUTHBEARER", "PLAIN"])
2298
2298
  5. Sets property['items']['enum'] with the discovered values
2299
2299
 
2300
2300
  DOWNSTREAM USAGE:
@@ -2408,7 +2408,7 @@ class RuntimeValidationEnumExtractor:
2408
2408
  PROCESSING:
2409
2409
  1. Detects string properties (not arrays) without validator parameters
2410
2410
  2. Searches the source file for validation functions that reference the property
2411
- 3. Parses comparison patterns (e.g., property != constant1 && property != constant2)
2411
+ 3. Parses comparison patterns (for example, property != constant1 && property != constant2)
2412
2412
  4. Resolves constants to actual string values
2413
2413
  5. Sets property['enum'] with discovered values
2414
2414
 
@@ -281,7 +281,7 @@ class TypeDefinitionExtractor:
281
281
  if cc_path.exists():
282
282
  files_to_search.append(cc_path)
283
283
 
284
- # Also look for parent directory's main .cc file (e.g., model/model.cc)
284
+ # Also look for parent directory's main .cc file (for example, model/model.cc)
285
285
  parent_dir = file_path.parent
286
286
  parent_cc = parent_dir / f"{parent_dir.name}.cc"
287
287
  if parent_cc.exists() and parent_cc != cc_path:
@@ -364,7 +364,7 @@ class TypeDefinitionExtractor:
364
364
  Resolve a C++ type alias to a JSON schema type.
365
365
 
366
366
  Args:
367
- alias_type (str): The C++ type expression (e.g., "named_type<int32_t, ...>")
367
+ alias_type (str): The C++ type expression (for example, "named_type<int32_t, ...>")
368
368
 
369
369
  Returns:
370
370
  str: JSON schema type (integer, string, etc.) or None if unknown
@@ -525,7 +525,7 @@ class TypeDefinitionExtractor:
525
525
  # Convert C++ type to JSON schema type
526
526
  json_type = self._cpp_type_to_json_type(return_type)
527
527
 
528
- # Use method name as field name (e.g., host() becomes "host")
528
+ # Use method name as field name (for example, host() becomes "host")
529
529
  properties[method_name] = {"type": json_type}
530
530
  continue
531
531
 
@@ -555,7 +555,7 @@ class TypeDefinitionExtractor:
555
555
  position (int): Position in the file
556
556
 
557
557
  Returns:
558
- str: Namespace (e.g., "model" or "config::tls")
558
+ str: Namespace (for example, "model" or "config::tls")
559
559
  """
560
560
  # Look backwards from position to find namespace declaration
561
561
  preceding = content[:position]
@@ -525,7 +525,7 @@ Overrides support:
525
525
 
526
526
  * *Manual override maintenance*: Custom descriptions must be maintained in overrides.json
527
527
  * *Example quality*: Auto-generated examples may not represent best practices
528
- * *Duplicate YAML keys*: Some examples contain multiple configurations in one block, creating invalid YAML with duplicate top-level keys (e.g., multiple `processors:` keys)
528
+ * *Duplicate YAML keys*: Some examples contain multiple configurations in one block, creating invalid YAML with duplicate top-level keys (for example, multiple `processors:` keys)
529
529
  * *CSV catalog dependency*: Relies on manually maintained CSV in Connect repository
530
530
  * *Version detection timing*: Must be called during Antora build to access component attributes
531
531
 
@@ -195,7 +195,7 @@ function resolveReferences(obj, root) {
195
195
  *
196
196
  * @param {Object} options - Configuration options for documentation generation.
197
197
  * @param {string} options.data - Path to the connector data file (JSON or YAML).
198
- * @param {string} [options.overrides] - Optional path to a JSON file with override data. Supports $ref references in JSON Pointer format (e.g., "#/definitions/client_certs").
198
+ * @param {string} [options.overrides] - Optional path to a JSON file with override data. Supports $ref references in JSON Pointer format (for example, "#/definitions/client_certs").
199
199
  * @param {string} options.template - Path to the main Handlebars template.
200
200
  * @param {string} [options.templateIntro] - Path to the intro partial template (used in full draft mode).
201
201
  * @param {string} [options.templateFields] - Path to the fields partial template.
@@ -253,7 +253,7 @@ async function generateRpcnConnectorDocs(options) {
253
253
  markBeta(dataObj);
254
254
 
255
255
  // Apply overrides if provided
256
- if (overrides) {
256
+ if (overrides && fs.existsSync(overrides)) {
257
257
  const ovRaw = fs.readFileSync(overrides, 'utf8');
258
258
  const ovObj = JSON.parse(ovRaw);
259
259
  // Resolve any $ref references in the overrides
@@ -281,9 +281,11 @@ async function generateRpcnConnectorDocs(options) {
281
281
  }
282
282
  }
283
283
  }
284
+ } else if (overrides) {
285
+ console.log(`Overrides file not found: ${overrides} (skipping)`);
284
286
  }
285
287
 
286
- // Compile the main template (used when writeFullDrafts = true)
288
+ // Compile the "main" template (used when writeFullDrafts = true)
287
289
  const compiledTemplate = handlebars.compile(fs.readFileSync(template, 'utf8'));
288
290
 
289
291
  // Determine which templates to use for “fields” and “examples”