Skip to content

Commit 8ec097b

Browse files
committed
Add support for saving properties to partials
1 parent d03185d commit 8ec097b

File tree

8 files changed

+285
-79
lines changed

8 files changed

+285
-79
lines changed

bin/doc-tools.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,17 +1032,20 @@ automation
10321032

10331033
automation
10341034
.command('property-docs')
1035-
.description('Generate JSON and AsciiDoc documentation for Redpanda configuration properties')
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.')
10361036
.option('--tag <tag>', 'Git tag or branch to extract from', 'dev')
1037-
.option('--diff <oldTag>', 'Also diff autogenerated properties from <oldTag> <tag>')
1037+
.option('--diff <oldTag>', 'Also diff autogenerated properties from <oldTag> to <tag>')
10381038
.option('--overrides <path>', 'Optional JSON file with property description overrides')
10391039
.option('--output-dir <dir>', 'Where to write all generated files', 'modules/reference')
1040-
.option('--cloud-support', 'Enable cloud support metadata by fetching configuration from the cloudv2 repository (requires GITHUB_TOKEN, GH_TOKEN, or REDPANDA_GITHUB_TOKEN)')
1040+
.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')
10411041
.option('--template-property-page <path>', 'Custom Handlebars template for property page layout')
10421042
.option('--template-property <path>', 'Custom Handlebars template for individual property sections')
10431043
.option('--template-topic-property <path>', 'Custom Handlebars template for individual topic property sections')
10441044
.option('--template-deprecated <path>', 'Custom Handlebars template for deprecated properties page')
10451045
.option('--template-deprecated-property <path>', 'Custom Handlebars template for individual deprecated property sections')
1046+
.option('--generate-partials', 'Generate consolidated property partials (cluster-properties.adoc, topic-properties.adoc, etc.) in the partials directory')
1047+
.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')
10461049
.action((options) => {
10471050
verifyPropertyDependencies();
10481051

@@ -1115,6 +1118,17 @@ automation
11151118
env.OUTPUT_ASCIIDOC_DIR = path.resolve(outputDir, 'pages', 'properties');
11161119
}
11171120

1121+
// Set partials generation options
1122+
if (options.generatePartials) {
1123+
env.GENERATE_PARTIALS = '1';
1124+
env.OUTPUT_PARTIALS_DIR = path.resolve(outputDir, options.partialsDir || 'partials');
1125+
}
1126+
1127+
// Set page generation options
1128+
if (options.generatePages) {
1129+
env.GENERATE_PAGES = '1';
1130+
}
1131+
11181132
const r = spawnSync('make', args, { cwd, stdio: 'inherit', env });
11191133
if (r.error) {
11201134
console.error(`❌ ${r.error.message}`);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redpanda-data/docs-extensions-and-macros",
3-
"version": "4.10.1",
3+
"version": "4.10.2",
44
"description": "Antora extensions and macros developed for Redpanda documentation.",
55
"keywords": [
66
"antora",

tools/property-extractor/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ TREE_SITTER := npx tree-sitter
2828
OUTPUT_AUTOGENERATED_DIR ?= $(REPO_ROOT)/modules/reference
2929
OUTPUT_ASCIIDOC_DIR ?= $(OUTPUT_AUTOGENERATED_DIR)/pages
3030
OUTPUT_JSON_DIR ?= $(OUTPUT_AUTOGENERATED_DIR)/examples
31+
OUTPUT_PARTIALS_DIR ?= $(OUTPUT_AUTOGENERATED_DIR)/partials
3132

3233
# --- Main build: venv, fetch code, build parser, extract & docgen ---
3334
build: venv redpanda-git treesitter

0 commit comments

Comments
 (0)