@redpanda-data/docs-extensions-and-macros 4.11.1 → 4.12.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.
Files changed (31) hide show
  1. package/bin/doc-tools.js +201 -10
  2. package/package.json +3 -1
  3. package/tools/property-extractor/COMPUTED_CONSTANTS.md +173 -0
  4. package/tools/property-extractor/Makefile +12 -1
  5. package/tools/property-extractor/README.adoc +828 -97
  6. package/tools/property-extractor/compare-properties.js +38 -13
  7. package/tools/property-extractor/constant_resolver.py +610 -0
  8. package/tools/property-extractor/file_pair.py +42 -0
  9. package/tools/property-extractor/generate-handlebars-docs.js +41 -8
  10. package/tools/property-extractor/helpers/gt.js +9 -0
  11. package/tools/property-extractor/helpers/includes.js +17 -0
  12. package/tools/property-extractor/helpers/index.js +3 -0
  13. package/tools/property-extractor/helpers/isEnterpriseEnum.js +24 -0
  14. package/tools/property-extractor/helpers/renderPropertyExample.js +6 -5
  15. package/tools/property-extractor/overrides.json +248 -0
  16. package/tools/property-extractor/parser.py +254 -32
  17. package/tools/property-extractor/property_bag.py +40 -0
  18. package/tools/property-extractor/property_extractor.py +1417 -430
  19. package/tools/property-extractor/requirements.txt +1 -0
  20. package/tools/property-extractor/templates/property-backup.hbs +161 -0
  21. package/tools/property-extractor/templates/property.hbs +104 -49
  22. package/tools/property-extractor/templates/topic-property-backup.hbs +148 -0
  23. package/tools/property-extractor/templates/topic-property.hbs +72 -34
  24. package/tools/property-extractor/tests/test_known_values.py +617 -0
  25. package/tools/property-extractor/tests/transformers_test.py +81 -6
  26. package/tools/property-extractor/topic_property_extractor.py +23 -10
  27. package/tools/property-extractor/transformers.py +2191 -369
  28. package/tools/property-extractor/type_definition_extractor.py +669 -0
  29. package/tools/redpanda-connect/helpers/renderConnectFields.js +33 -1
  30. package/tools/redpanda-connect/report-delta.js +132 -9
  31. package/tools/property-extractor/definitions.json +0 -245
@@ -2,3 +2,4 @@ tree_sitter==0.21.1
2
2
  setuptools>=42.0.0
3
3
  pyyaml>=6.0
4
4
  requests>=2.32.5
5
+ pytest>=7.0.0
@@ -0,0 +1,161 @@
1
+ {{#if category}}
2
+ // tag::category-{{category}}[]
3
+ {{/if}}
4
+ {{#if exclude_from_docs}}
5
+ // tag::exclude-from-docs[]
6
+ {{/if}}
7
+ {{#if is_deprecated}}
8
+ // tag::deprecated[]
9
+ {{/if}}
10
+ {{#if cloud_supported}}
11
+ // tag::redpanda-cloud[]
12
+ {{/if}}
13
+ === {{name}}
14
+ {{#if version}}
15
+
16
+ ifndef::env-cloud[]
17
+ *Introduced in {{version}}*
18
+ endif::[]
19
+ {{/if}}
20
+ {{#if description}}
21
+
22
+ {{{description}}}
23
+ {{else}}
24
+
25
+ No description available.
26
+
27
+ {{/if}}
28
+ {{#if is_enterprise}}
29
+
30
+ ifndef::env-cloud[]
31
+ *Enterprise license required*: `{{enterprise_value}}` (for license details, see xref:get-started:licensing/index.adoc[Redpanda Licensing])
32
+ endif::[]
33
+ {{/if}}
34
+ {{#if cloud_byoc_only}}
35
+
36
+ ifdef::env-cloud[]
37
+ NOTE: This property is available only in Redpanda Cloud BYOC deployments.
38
+ endif::[]
39
+
40
+ {{/if}}
41
+ {{#if units}}
42
+
43
+ *Unit:* {{units}}
44
+ {{else}}
45
+ {{#if (formatUnits name)}}
46
+
47
+ *Unit:* {{formatUnits name}}
48
+ {{/if}}
49
+ {{/if}}
50
+ {{#if (ne defined_in "src/v/config/node_config.cc")}}
51
+ {{#if (ne needs_restart undefined)}}
52
+
53
+ *Requires restart:* {{#if needs_restart}}Yes{{else}}No{{/if}}
54
+ {{/if}}
55
+ {{/if}}
56
+
57
+ ifndef::env-cloud[]
58
+ *Restored during xref:manage:whole-cluster-restore.adoc[Whole Cluster Restore]:* {{#if (ne gets_restored false)}}Yes{{else}}No{{/if}}
59
+ endif::[]
60
+ {{#if visibility}}
61
+
62
+ // tag::self-managed-only[]
63
+ *Visibility:* `{{visibility}}`
64
+ // end::self-managed-only[]
65
+ {{/if}}
66
+ {{#if type}}
67
+
68
+ *Type:* {{type}}
69
+ {{/if}}
70
+ {{#if (and minimum maximum)}}
71
+
72
+ *Accepted values:* [`{{minimum}}`, `{{maximum}}`]
73
+ {{else}}
74
+ {{#if minimum}}
75
+
76
+ *Minimum value:* `{{minimum}}`
77
+ {{/if}}
78
+ {{#if maximum}}
79
+
80
+ *Maximum value:* `{{maximum}}`
81
+ {{/if}}
82
+ {{/if}}
83
+ {{#if (ne default undefined)}}
84
+
85
+ ifdef::env-cloud[]
86
+ *Default:* Available in the Redpanda Cloud Console
87
+ endif::[]
88
+ ifndef::env-cloud[]
89
+ *Default:* `{{formatPropertyValue default type}}`
90
+ endif::[]
91
+ {{/if}}
92
+
93
+ *Nullable:* {{#if nullable}}Yes{{else}}No{{/if}}
94
+ {{#if example}}
95
+
96
+ {{{renderPropertyExample this}}}
97
+ {{/if}}
98
+ {{#if related_topics}}
99
+ {{#with (allTopicsConditional related_topics) as |sectionType|}}
100
+
101
+ {{#if (eq sectionType "cloud")}}
102
+ ifdef::env-cloud[]
103
+ *Related topics:*
104
+
105
+ {{#each ../related_topics}}
106
+ {{#with (parseRelatedTopic this)}}
107
+ * {{{value}}}
108
+ {{/with}}
109
+ {{/each}}
110
+ endif::[]
111
+ {{else if (eq sectionType "self-managed")}}
112
+ ifndef::env-cloud[]
113
+ *Related topics:*
114
+
115
+ {{#each ../related_topics}}
116
+ {{#with (parseRelatedTopic this)}}
117
+ * {{{value}}}
118
+ {{/with}}
119
+ {{/each}}
120
+ endif::[]
121
+ {{else}}
122
+ *Related topics:*
123
+
124
+ {{#each ../related_topics}}
125
+ {{#with (parseRelatedTopic this)}}
126
+ {{#if (eq type "cloud")}}
127
+ ifdef::env-cloud[]
128
+ * {{{value}}}
129
+ endif::[]
130
+ {{else if (eq type "self-managed")}}
131
+ ifndef::env-cloud[]
132
+ * {{{value}}}
133
+ endif::[]
134
+ {{else}}
135
+ * {{{value}}}
136
+ {{/if}}
137
+ {{/with}}
138
+ {{/each}}
139
+ {{/if}}
140
+ {{/with}}
141
+ {{/if}}
142
+ {{#if aliases}}
143
+
144
+ // tag::self-managed-only[]
145
+ *Aliases:* {{join aliases ", "}}
146
+ // end::self-managed-only[]
147
+ {{/if}}
148
+
149
+ ---
150
+ {{#if cloud_supported}}
151
+ // end::redpanda-cloud[]
152
+ {{/if}}
153
+ {{#if is_deprecated}}
154
+ // end::deprecated[]
155
+ {{/if}}
156
+ {{#if exclude_from_docs}}
157
+ // end::exclude-from-docs[]
158
+ {{/if}}
159
+ {{#if category}}
160
+ // end::category-{{category}}[]
161
+ {{/if}}
@@ -7,6 +7,9 @@
7
7
  {{#if is_deprecated}}
8
8
  // tag::deprecated[]
9
9
  {{/if}}
10
+ {{#if is_experimental_property}}
11
+ // tag::experimental[]
12
+ {{/if}}
10
13
  {{#if cloud_supported}}
11
14
  // tag::redpanda-cloud[]
12
15
  {{/if}}
@@ -28,7 +31,26 @@ No description available.
28
31
  {{#if is_enterprise}}
29
32
 
30
33
  ifndef::env-cloud[]
31
- *Enterprise license required*: `{{enterprise_value}}` (for license details, see xref:get-started:licensing/index.adoc[Redpanda Licensing])
34
+ .Enterprise license required
35
+ [NOTE]
36
+ ====
37
+ {{#if enterprise_constructor}}
38
+ {{#if (eq enterprise_constructor "simple")}}
39
+ This property requires an Enterprise license to use.
40
+ {{else if (eq enterprise_constructor "restricted_only")}}
41
+ The following values require an Enterprise license: {{#each enterprise_restricted_value}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}}
42
+ {{else if (eq enterprise_constructor "restricted_with_sanctioned")}}
43
+ *License-based defaults:*
44
+
45
+ * *Community:* {{#each enterprise_sanctioned_value}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}} (if no Enterprise license is present)
46
+ * *Enterprise:* {{#each enterprise_restricted_value}}`{{this}}`{{#unless @last}}, {{/unless}}{{/each}} (if an Enterprise license is present)
47
+ {{/if}}
48
+ {{else}}
49
+ Enterprise license required: `{{enterprise_value}}`
50
+ {{/if}}
51
+
52
+ For license details, see xref:get-started:licensing/index.adoc[Redpanda Licensing].
53
+ ====
32
54
  endif::[]
33
55
  {{/if}}
34
56
  {{#if cloud_byoc_only}}
@@ -38,115 +60,148 @@ NOTE: This property is available only in Redpanda Cloud BYOC deployments.
38
60
  endif::[]
39
61
 
40
62
  {{/if}}
41
- {{#if units}}
42
63
 
43
- *Unit:* {{units}}
64
+ [cols="1e,2a"]
65
+ |===
66
+ | Property | Value
67
+
68
+ | Type
69
+ | `{{type}}`{{#if (or enum items.enum)}} (enum){{/if}}
70
+
71
+ {{#if enum}}
72
+ | Accepted values
73
+ | {{#each enum}}`{{this}}`{{#if (isEnterpriseEnum this ../x-enum-metadata)}} (Enterprise){{else}}{{#if ../is_enterprise}}{{#if (includes ../enterprise_restricted_value this)}} (Enterprise){{/if}}{{/if}}{{/if}}{{#unless @last}}, {{/unless}}{{/each}}
74
+ {{else}}{{#if items.enum}}
75
+ | Accepted values
76
+ | {{#each items.enum}}`{{this}}`{{#if (isEnterpriseEnum this ../items.x-enum-metadata)}} (Enterprise){{/if}}{{#unless @last}}, {{/unless}}{{/each}}
77
+ {{/if}}{{/if}}
78
+ {{#if (and minimum maximum)}}
79
+
80
+ | Range
81
+ | [`{{minimum}}`, `{{maximum}}`]
44
82
  {{else}}
45
- {{#if (formatUnits name)}}
83
+ {{#if minimum}}
46
84
 
47
- *Unit:* {{formatUnits name}}
48
- {{/if}}
85
+ | Minimum
86
+ | `{{minimum}}`
49
87
  {{/if}}
50
- {{#if (ne defined_in "src/v/config/node_config.cc")}}
51
- {{#if (ne needs_restart undefined)}}
88
+ {{#if maximum}}
52
89
 
53
- *Requires restart:* {{#if needs_restart}}Yes{{else}}No{{/if}}
90
+ | Maximum
91
+ | `{{maximum}}`
54
92
  {{/if}}
55
93
  {{/if}}
56
94
 
95
+ | Default
96
+ |{{#if is_enterprise}}{{#if enterprise_default_description}}{{{enterprise_default_description}}}{{else}}
97
+ ifdef::env-cloud[]
98
+ Available in the Redpanda Cloud Console
99
+ endif::[]
57
100
  ifndef::env-cloud[]
58
- *Restored during xref:manage:whole-cluster-restore.adoc[Whole Cluster Restore]:* {{#if (ne gets_restored false)}}Yes{{else}}No{{/if}}
101
+ `{{formatPropertyValue default type}}`{{#if default_human_readable}} ({{default_human_readable}}){{/if}}
102
+ endif::[]{{/if}}{{else}}
103
+ ifdef::env-cloud[]
104
+ Available in the Redpanda Cloud Console
59
105
  endif::[]
60
- {{#if visibility}}
61
-
62
- // tag::self-managed-only[]
63
- *Visibility:* `{{visibility}}`
64
- // end::self-managed-only[]
65
- {{/if}}
66
- {{#if type}}
106
+ ifndef::env-cloud[]
107
+ `{{formatPropertyValue default type}}`{{#if default_human_readable}} ({{default_human_readable}}){{/if}}
108
+ endif::[]{{/if}}
67
109
 
68
- *Type:* {{type}}
69
- {{/if}}
70
- {{#if (and minimum maximum)}}
110
+ | Nullable
111
+ | {{#if nullable}}Yes{{else}}No{{/if}}
112
+ {{#if units}}
71
113
 
72
- *Accepted values:* [`{{minimum}}`, `{{maximum}}`]
114
+ | Unit
115
+ | {{units}}
73
116
  {{else}}
74
- {{#if minimum}}
117
+ {{#if (formatUnits name)}}
75
118
 
76
- *Minimum value:* `{{minimum}}`
119
+ | Unit
120
+ | {{formatUnits name}}
77
121
  {{/if}}
78
- {{#if maximum}}
122
+ {{/if}}
123
+ {{#if (ne defined_in "src/v/config/node_config.cc")}}
124
+ {{#if (ne needs_restart undefined)}}
79
125
 
80
- *Maximum value:* `{{maximum}}`
126
+ | Requires restart
127
+ | {{#if needs_restart}}Yes{{else}}No{{/if}}
81
128
  {{/if}}
82
129
  {{/if}}
83
- {{#if (ne default undefined)}}
84
130
 
85
- ifdef::env-cloud[]
86
- *Default:* Available in the Redpanda Cloud Console
87
- endif::[]
88
131
  ifndef::env-cloud[]
89
- *Default:* `{{formatPropertyValue default type}}`
132
+ | Restored on xref:manage:whole-cluster-restore.adoc[Whole Cluster Restore]
133
+ | {{#if (ne gets_restored false)}}Yes{{else}}No{{/if}}
90
134
  endif::[]
135
+ {{#if visibility}}
136
+
137
+ // tag::self-managed-only[]
138
+ | Visibility
139
+ | `{{visibility}}`
140
+ // end::self-managed-only[]
91
141
  {{/if}}
142
+ {{#if aliases}}
92
143
 
93
- *Nullable:* {{#if nullable}}Yes{{else}}No{{/if}}
144
+ // tag::self-managed-only[]
145
+ | Aliases
146
+ | {{join aliases ", "}}
147
+ // end::self-managed-only[]
148
+ {{/if}}
94
149
  {{#if example}}
95
150
 
96
- {{{renderPropertyExample this}}}
151
+ | Example
152
+ | {{{example}}}
97
153
  {{/if}}
98
154
  {{#if related_topics}}
99
155
  {{#with (allTopicsConditional related_topics) as |sectionType|}}
100
156
 
101
157
  {{#if (eq sectionType "cloud")}}
102
158
  ifdef::env-cloud[]
103
- *Related topics:*
104
-
159
+ | Related topics
160
+ |
105
161
  {{#each ../related_topics}}
106
162
  {{#with (parseRelatedTopic this)}}
107
- * {{{value}}}
163
+ {{#if (gt ../../related_topics.length 1)}}* {{/if}}{{{value}}}
108
164
  {{/with}}
109
165
  {{/each}}
110
166
  endif::[]
111
167
  {{else if (eq sectionType "self-managed")}}
112
168
  ifndef::env-cloud[]
113
- *Related topics:*
114
-
169
+ | Related topics
170
+ |
115
171
  {{#each ../related_topics}}
116
172
  {{#with (parseRelatedTopic this)}}
117
- * {{{value}}}
173
+ {{#if (gt ../../related_topics.length 1)}}* {{/if}}{{{value}}}
118
174
  {{/with}}
119
175
  {{/each}}
120
176
  endif::[]
121
177
  {{else}}
122
- *Related topics:*
123
-
178
+ | Related topics
179
+ |
124
180
  {{#each ../related_topics}}
125
181
  {{#with (parseRelatedTopic this)}}
126
182
  {{#if (eq type "cloud")}}
127
183
  ifdef::env-cloud[]
128
- * {{{value}}}
184
+ {{#if (gt ../../related_topics.length 1)}}* {{/if}}{{{value}}}
129
185
  endif::[]
130
186
  {{else if (eq type "self-managed")}}
131
187
  ifndef::env-cloud[]
132
- * {{{value}}}
188
+ {{#if (gt ../../related_topics.length 1)}}* {{/if}}{{{value}}}
133
189
  endif::[]
134
190
  {{else}}
135
- * {{{value}}}
191
+ {{#if (gt ../../related_topics.length 1)}}* {{/if}}{{{value}}}
136
192
  {{/if}}
137
193
  {{/with}}
138
194
  {{/each}}
139
195
  {{/if}}
140
196
  {{/with}}
141
197
  {{/if}}
142
- {{#if aliases}}
143
198
 
144
- // tag::self-managed-only[]
145
- *Aliases:* {{join aliases ", "}}
146
- // end::self-managed-only[]
147
- {{/if}}
199
+ |===
148
200
 
149
201
  ---
202
+ {{#if is_experimental_property}}
203
+ // end::experimental[]
204
+ {{/if}}
150
205
  {{#if cloud_supported}}
151
206
  // end::redpanda-cloud[]
152
207
  {{/if}}
@@ -158,4 +213,4 @@ endif::[]
158
213
  {{/if}}
159
214
  {{#if category}}
160
215
  // end::category-{{category}}[]
161
- {{/if}}
216
+ {{/if}}
@@ -0,0 +1,148 @@
1
+ {{#if category}}
2
+ // tag::category-{{category}}[]
3
+ {{/if}}
4
+ {{#if exclude_from_docs}}
5
+ // tag::exclude-from-docs[]
6
+ {{/if}}
7
+ {{#if is_deprecated}}
8
+ // tag::deprecated[]
9
+ {{/if}}
10
+ {{#if cloud_supported}}
11
+ // tag::redpanda-cloud[]
12
+ {{/if}}
13
+ === {{name}}
14
+ {{#if version}}
15
+
16
+ *Introduced in {{version}}*
17
+ {{/if}}
18
+ {{#if description}}
19
+
20
+ {{{description}}}
21
+ {{else}}
22
+
23
+ No description available.
24
+ {{/if}}
25
+ {{#if is_enterprise}}
26
+
27
+ ifndef::env-cloud[]
28
+ *Enterprise license required*: `{{enterprise_value}}` (for license details, see xref:get-started:licensing/index.adoc[Redpanda Licensing])
29
+ endif::[]
30
+ {{/if}}
31
+ {{#if cloud_byoc_only}}
32
+ ifdef::env-cloud[]
33
+ NOTE: This property is only available in Redpanda Cloud BYOC deployments.
34
+ endif::[]
35
+ {{/if}}
36
+ {{#if type}}
37
+
38
+ *Type:* {{type}}
39
+ {{/if}}
40
+ {{#if acceptable_values}}
41
+
42
+ *Accepted values:* {{{acceptable_values}}}
43
+ {{/if}}
44
+ {{#if corresponding_cluster_property}}
45
+
46
+ *Related cluster property:* xref:reference:cluster-properties.adoc#{{corresponding_cluster_property}}[{{corresponding_cluster_property}}]
47
+ {{/if}}
48
+ {{#if (and minimum maximum)}}
49
+
50
+ *Accepted values:* [`{{minimum}}`, `{{maximum}}`]
51
+ {{else}}
52
+ {{#if minimum}}
53
+
54
+ *Minimum value:* `{{minimum}}`
55
+ {{/if}}
56
+ {{#if maximum}}
57
+
58
+ *Maximum value:* `{{maximum}}`
59
+ {{/if}}
60
+ {{/if}}
61
+ {{#if (ne default undefined)}}
62
+ {{#if cloud_supported}}
63
+
64
+ ifdef::env-cloud[]
65
+ *Default:* Available in the Redpanda Cloud Console
66
+ endif::[]
67
+ ifndef::env-cloud[]
68
+ *Default:* `{{formatPropertyValue default type}}`
69
+ endif::[]
70
+ {{else}}
71
+
72
+ *Default:* `{{formatPropertyValue default type}}`
73
+ {{/if}}
74
+ {{/if}}
75
+
76
+ *Nullable:* {{#if nullable}}Yes{{else}}No{{/if}}
77
+
78
+ ifndef::env-cloud[]
79
+ *Restored during xref:manage:whole-cluster-restore.adoc[Whole Cluster Restore]:* {{#if (ne gets_restored false)}}Yes{{else}}No{{/if}}
80
+ endif::[]
81
+ {{#if example}}
82
+
83
+ {{{renderPropertyExample this}}}
84
+ {{/if}}
85
+ {{#if related_topics}}
86
+ {{#with (allTopicsConditional related_topics) as |sectionType|}}
87
+
88
+ {{#if (eq sectionType "cloud")}}
89
+ ifdef::env-cloud[]
90
+ *Related topics:*
91
+
92
+ {{#each ../related_topics}}
93
+ {{#with (parseRelatedTopic this)}}
94
+ * {{{value}}}
95
+ {{/with}}
96
+ {{/each}}
97
+ endif::[]
98
+ {{else if (eq sectionType "self-managed")}}
99
+ ifndef::env-cloud[]
100
+ *Related topics:*
101
+
102
+ {{#each ../related_topics}}
103
+ {{#with (parseRelatedTopic this)}}
104
+ * {{{value}}}
105
+ {{/with}}
106
+ {{/each}}
107
+ endif::[]
108
+ {{else}}
109
+ *Related topics:*
110
+
111
+ {{#each ../related_topics}}
112
+ {{#with (parseRelatedTopic this)}}
113
+ {{#if (eq type "cloud")}}
114
+ ifdef::env-cloud[]
115
+ * {{{value}}}
116
+ endif::[]
117
+ {{else if (eq type "self-managed")}}
118
+ ifndef::env-cloud[]
119
+ * {{{value}}}
120
+ endif::[]
121
+ {{else}}
122
+ * {{{value}}}
123
+ {{/if}}
124
+ {{/with}}
125
+ {{/each}}
126
+ {{/if}}
127
+ {{/with}}
128
+ {{/if}}
129
+ {{#if aliases}}
130
+
131
+ // tag::self-managed-only[]
132
+ *Aliases:* {{join aliases ", "}}
133
+ // end::self-managed-only[]
134
+ {{/if}}
135
+
136
+ ---
137
+ {{#if cloud_supported}}
138
+ // end::redpanda-cloud[]
139
+ {{/if}}
140
+ {{#if is_deprecated}}
141
+ // end::deprecated[]
142
+ {{/if}}
143
+ {{#if exclude_from_docs}}
144
+ // end::exclude-from-docs[]
145
+ {{/if}}
146
+ {{#if category}}
147
+ // end::category-{{category}}[]
148
+ {{/if}}