@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.
@@ -0,0 +1,7 @@
1
+ module.exports = function anchorName(name) {
2
+ const anchor = String(name).replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
3
+ if (!anchor) {
4
+ throw new Error(`Invalid property name for anchor generation: "${name}"`);
5
+ }
6
+ return anchor;
7
+ };
@@ -10,4 +10,5 @@ module.exports = {
10
10
  formatPropertyValue: require('./formatPropertyValue.js'),
11
11
  renderPropertyExample: require('./renderPropertyExample.js'),
12
12
  formatUnits: require('./formatUnits.js'),
13
+ anchorName: require('./anchorName.js'),
13
14
  };
@@ -719,6 +719,14 @@ def _apply_override_to_existing_property(property_dict, override, overrides_file
719
719
  else:
720
720
  logger.warning(f"related_topics for property must be an array")
721
721
 
722
+ # Apply exclude_from_docs override
723
+ if "exclude_from_docs" in override:
724
+ property_dict["exclude_from_docs"] = override["exclude_from_docs"]
725
+
726
+ # Apply category override for topic properties
727
+ if "category" in override:
728
+ property_dict["category"] = override["category"]
729
+
722
730
 
723
731
  def _create_property_from_override(prop_name, override, overrides_file_path):
724
732
  """Create a new property from override specification."""
@@ -757,6 +765,14 @@ def _create_property_from_override(prop_name, override, overrides_file_path):
757
765
  "example", "example_file", "example_yaml", "related_topics",
758
766
  "is_deprecated", "visibility"]:
759
767
  new_property[key] = value
768
+
769
+ # Add exclude_from_docs if specified
770
+ if "exclude_from_docs" in override:
771
+ new_property["exclude_from_docs"] = override["exclude_from_docs"]
772
+
773
+ # Add category if specified
774
+ if "category" in override:
775
+ new_property["category"] = override["category"]
760
776
 
761
777
  return new_property
762
778
 
@@ -877,15 +893,18 @@ def add_config_scope(properties):
877
893
  if prop.get("is_topic_property", False):
878
894
  prop["config_scope"] = "topic"
879
895
  else:
880
- # For override-created properties, preserve existing config_scope if set
881
- if prop.get("defined_in") == "override" and prop.get("config_scope") is not None:
882
- # Keep the existing config_scope from override
896
+ # Skip config_scope assignment if it's already been set by an override
897
+ if prop.get("config_scope") is not None:
898
+ # Keep the existing config_scope from override or previous assignment
883
899
  pass
884
900
  else:
885
901
  defined_in = prop.get("defined_in", "")
886
902
  if defined_in == "src/v/config/configuration.cc":
887
903
  prop["config_scope"] = "cluster"
888
- elif defined_in == "src/v/config/node_config.cc":
904
+ elif defined_in in ["src/v/config/node_config.cc",
905
+ "src/v/pandaproxy/rest/configuration.cc",
906
+ "src/v/kafka/client/configuration.cc",
907
+ "src/v/pandaproxy/schema_registry/configuration.cc"]:
889
908
  prop["config_scope"] = "broker"
890
909
  else:
891
910
  prop["config_scope"] = None
@@ -1644,7 +1663,50 @@ def extract_topic_properties(source_path):
1644
1663
  # Skip no-op properties
1645
1664
  if prop_data.get("is_noop", False):
1646
1665
  continue
1647
-
1666
+
1667
+ # Assign category based on property name pattern or mapping
1668
+ def infer_category(name):
1669
+ retention = [
1670
+ "cleanup.policy", "compaction.strategy", "delete.retention.ms", "max.compaction.lag.ms",
1671
+ "min.cleanable.dirty.ratio", "min.compaction.lag.ms", "retention.bytes", "retention.ms"
1672
+ ]
1673
+ segment = [
1674
+ "compression.type", "max.message.bytes", "message.timestamp.type", "segment.bytes", "segment.ms"
1675
+ ]
1676
+ performance = [
1677
+ "flush.bytes", "flush.ms", "redpanda.leaders.preference", "replication.factor", "write.caching"
1678
+ ]
1679
+ tiered = [
1680
+ "initial.retention.local.target.bytes", "initial.retention.local.target.ms", "redpanda.remote.delete",
1681
+ "redpanda.remote.read", "redpanda.remote.recovery", "redpanda.remote.write", "retention.local.target.bytes",
1682
+ "retention.local.target.ms"
1683
+ ]
1684
+ remote_replica = ["redpanda.remote.readreplica"]
1685
+ iceberg = [
1686
+ "redpanda.iceberg.delete", "redpanda.iceberg.invalid.record.action", "redpanda.iceberg.mode",
1687
+ "redpanda.iceberg.partition.spec", "redpanda.iceberg.target.lag.ms"
1688
+ ]
1689
+ schema_registry = [
1690
+ "redpanda.key.schema.id.validation", "redpanda.key.subject.name.strategy", "redpanda.value.schema.id.validation",
1691
+ "redpanda.value.subject.name.strategy", "confluent.key.schema.validation", "confluent.key.subject.name.strategy",
1692
+ "confluent.value.schema.validation", "confluent.value.subject.name.strategy"
1693
+ ]
1694
+ if name in retention:
1695
+ return "retention-compaction"
1696
+ if name in segment:
1697
+ return "segment-message"
1698
+ if name in performance:
1699
+ return "performance-cluster"
1700
+ if name in tiered:
1701
+ return "tiered-storage"
1702
+ if name in remote_replica:
1703
+ return "remote-read-replica"
1704
+ if name in iceberg:
1705
+ return "iceberg-integration"
1706
+ if name in schema_registry:
1707
+ return "schema-registry"
1708
+ return "other"
1709
+
1648
1710
  converted_properties[prop_name] = {
1649
1711
  "name": prop_name,
1650
1712
  "description": prop_data.get("description", ""),
@@ -1654,7 +1716,8 @@ def extract_topic_properties(source_path):
1654
1716
  "corresponding_cluster_property": prop_data.get("corresponding_cluster_property", ""),
1655
1717
  "acceptable_values": prop_data.get("acceptable_values", ""),
1656
1718
  "is_deprecated": False,
1657
- "is_topic_property": True
1719
+ "is_topic_property": True,
1720
+ "category": infer_category(prop_name)
1658
1721
  }
1659
1722
 
1660
1723
  logging.info(f"Extracted {len(converted_properties)} topic properties (excluding {len([p for p in topic_properties.values() if p.get('is_noop', False)])} no-op properties)")
@@ -1,7 +1 @@
1
- === `{{name}}`
2
-
3
- {{#if description}}
4
- {{{description}}}
5
- {{else}}
6
- No description available.
7
- {{/if}}
1
+ - `{{name}}`
@@ -1,62 +1,88 @@
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}}
1
13
  === {{name}}
2
-
3
14
  {{#if version}}
15
+
16
+ ifndef::env-cloud[]
4
17
  *Introduced in {{version}}*
18
+ endif::[]
5
19
  {{/if}}
6
-
7
20
  {{#if description}}
21
+
8
22
  {{{description}}}
9
23
  {{else}}
24
+
10
25
  No description available.
11
26
  {{/if}}
12
-
13
27
  {{#if is_enterprise}}
28
+
14
29
  ifndef::env-cloud[]
15
30
  *Enterprise license required*: `{{enterprise_value}}` (for license details, see xref:get-started:licensing/index.adoc[Redpanda Licensing])
16
31
  endif::[]
17
-
18
32
  {{/if}}
19
-
33
+ {{#if cloud_byoc_only}}
34
+ ifdef::env-cloud[]
35
+ NOTE: This property is available only in Redpanda Cloud BYOC deployments.
36
+ endif::[]
37
+ {{/if}}
20
38
  {{#if units}}
21
- *Unit:* {{units}}
22
39
 
40
+ *Unit:* {{units}}
23
41
  {{else}}
24
42
  {{#if (formatUnits name)}}
25
- *Unit:* {{formatUnits name}}
26
43
 
44
+ *Unit:* {{formatUnits name}}
27
45
  {{/if}}
28
46
  {{/if}}
29
47
  {{#if (ne defined_in "src/v/config/node_config.cc")}}
30
48
  {{#if (ne needs_restart undefined)}}
31
- *Requires restart:* {{#if needs_restart}}Yes{{else}}No{{/if}}
32
49
 
50
+ *Requires restart:* {{#if needs_restart}}Yes{{else}}No{{/if}}
33
51
  {{/if}}
34
52
  {{/if}}
35
53
  {{#if visibility}}
36
- *Visibility:* `{{visibility}}`
37
54
 
55
+ // tag::self-managed-only[]
56
+ *Visibility:* `{{visibility}}`
57
+ // end::self-managed-only[]
38
58
  {{/if}}
39
59
  {{#if type}}
40
- *Type:* {{type}}
41
60
 
61
+ *Type:* {{type}}
42
62
  {{/if}}
43
63
  {{#if (and minimum maximum)}}
44
- *Accepted values:* [`{{minimum}}`, `{{maximum}}`]
45
64
 
65
+ *Accepted values:* [`{{minimum}}`, `{{maximum}}`]
46
66
  {{else}}
47
67
  {{#if minimum}}
48
- *Minimum value:* `{{minimum}}`
49
68
 
69
+ *Minimum value:* `{{minimum}}`
50
70
  {{/if}}
51
71
  {{#if maximum}}
52
- *Maximum value:* `{{maximum}}`
53
72
 
73
+ *Maximum value:* `{{maximum}}`
54
74
  {{/if}}
55
75
  {{/if}}
56
76
  {{#if (ne default undefined)}}
57
- *Default:* `{{formatPropertyValue default type}}`
58
77
 
78
+ ifdef::env-cloud[]
79
+ *Default:* Available in the Redpanda Cloud Console
80
+ endif::[]
81
+ ifndef::env-cloud[]
82
+ *Default:* `{{formatPropertyValue default type}}`
83
+ endif::[]
59
84
  {{/if}}
85
+
60
86
  *Nullable:* {{#if nullable}}Yes{{else}}No{{/if}}
61
87
  {{#if example}}
62
88
 
@@ -72,13 +98,21 @@ endif::[]
72
98
  {{/if}}
73
99
  {{#if aliases}}
74
100
 
101
+ // tag::self-managed-only[]
75
102
  *Aliases:* {{join aliases ", "}}
103
+ // end::self-managed-only[]
76
104
  {{/if}}
77
- {{#if is_deprecated}}
78
105
 
79
- [WARNING]
80
- ====
81
- This property is deprecated.
82
- ====
83
- {{/if}}
84
106
  ---
107
+ {{#if cloud_supported}}
108
+ // end::redpanda-cloud[]
109
+ {{/if}}
110
+ {{#if is_deprecated}}
111
+ // end::deprecated[]
112
+ {{/if}}
113
+ {{#if exclude_from_docs}}
114
+ // end::exclude-from-docs[]
115
+ {{/if}}
116
+ {{#if category}}
117
+ // end::category-{{category}}[]
118
+ {{/if}}
@@ -0,0 +1,13 @@
1
+ [cols="1a,1a"]
2
+ |===
3
+ | Topic property | Corresponding cluster property
4
+
5
+ {{#each topicProperties}}
6
+ | <<{{anchorName name}},`{{name}}`>>
7
+ | xref:./cluster-properties.adoc#{{corresponding_cluster_property}}[`{{corresponding_cluster_property}}`]
8
+ {{/each}}
9
+ |===
10
+
11
+ {{!-- Helper to generate anchor names --}}
12
+ {{!-- Usage: anchorName propertyName --}}
13
+ {{!-- Example: cleanup.policy -> cleanuppolicy --}}
@@ -1,3 +1,15 @@
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}}
1
13
  === {{name}}
2
14
  {{#if version}}
3
15
 
@@ -16,6 +28,11 @@ ifndef::env-cloud[]
16
28
  *Enterprise license required*: `{{enterprise_value}}` (for license details, see xref:get-started:licensing/index.adoc[Redpanda Licensing])
17
29
  endif::[]
18
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}}
19
36
  {{#if type}}
20
37
 
21
38
  *Type:* {{type}}
@@ -42,9 +59,19 @@ endif::[]
42
59
  {{/if}}
43
60
  {{/if}}
44
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}}
45
71
 
46
72
  *Default:* `{{formatPropertyValue default type}}`
47
73
  {{/if}}
74
+ {{/if}}
48
75
 
49
76
  *Nullable:* {{#if nullable}}Yes{{else}}No{{/if}}
50
77
  {{#if example}}
@@ -61,13 +88,21 @@ endif::[]
61
88
  {{/if}}
62
89
  {{#if aliases}}
63
90
 
91
+ // tag::self-managed-only[]
64
92
  *Aliases:* {{join aliases ", "}}
93
+ // end::self-managed-only[]
65
94
  {{/if}}
66
- {{#if is_deprecated}}
67
95
 
68
- [WARNING]
69
- ====
70
- This property is deprecated.
71
- ====
72
- {{/if}}
73
96
  ---
97
+ {{#if cloud_supported}}
98
+ // end::redpanda-cloud[]
99
+ {{/if}}
100
+ {{#if is_deprecated}}
101
+ // end::deprecated[]
102
+ {{/if}}
103
+ {{#if exclude_from_docs}}
104
+ // end::exclude-from-docs[]
105
+ {{/if}}
106
+ {{#if category}}
107
+ // end::category-{{category}}[]
108
+ {{/if}}
@@ -1,104 +0,0 @@
1
- {{#if cloud_supported}}
2
- // tag::redpanda-cloud[]
3
- {{/if}}
4
- === {{name}}
5
- {{#if version}}
6
-
7
- *Introduced in {{version}}*
8
- {{/if}}
9
- {{#if description}}
10
-
11
- {{{description}}}
12
- {{else}}
13
-
14
- No description available.
15
- {{/if}}
16
- {{#if is_enterprise}}
17
-
18
- ifndef::env-cloud[]
19
- *Enterprise license required*: `{{enterprise_value}}` (for license details, see xref:get-started:licensing/index.adoc[Redpanda Licensing])
20
- endif::[]
21
- {{/if}}
22
- {{#if cloud_byoc_only}}
23
- ifdef::env-cloud[]
24
- NOTE: This property is available only in Redpanda Cloud BYOC deployments.
25
- endif::[]
26
- {{/if}}
27
- {{#if units}}
28
-
29
- *Unit:* {{units}}
30
- {{else}}
31
- {{#if (formatUnits name)}}
32
-
33
- *Unit:* {{formatUnits name}}
34
- {{/if}}
35
- {{/if}}
36
- {{#if (ne defined_in "src/v/config/node_config.cc")}}
37
- {{#if (ne needs_restart undefined)}}
38
-
39
- *Requires restart:* {{#if needs_restart}}Yes{{else}}No{{/if}}
40
- {{/if}}
41
- {{/if}}
42
- {{#if visibility}}
43
-
44
- // tag::self-managed-only[]
45
- *Visibility:* `{{visibility}}`
46
- // end::self-managed-only[]
47
- {{/if}}
48
- {{#if type}}
49
-
50
- *Type:* {{type}}
51
- {{/if}}
52
- {{#if (and minimum maximum)}}
53
-
54
- *Accepted values:* [`{{minimum}}`, `{{maximum}}`]
55
- {{else}}
56
- {{#if minimum}}
57
-
58
- *Minimum value:* `{{minimum}}`
59
- {{/if}}
60
- {{#if maximum}}
61
-
62
- *Maximum value:* `{{maximum}}`
63
- {{/if}}
64
- {{/if}}
65
- {{#if (ne default undefined)}}
66
-
67
- ifdef::env-cloud[]
68
- *Default:* Available in the Redpanda Cloud Console
69
- endif::[]
70
- ifndef::env-cloud[]
71
- *Default:* `{{formatPropertyValue default type}}`
72
- endif::[]
73
- {{/if}}
74
-
75
- *Nullable:* {{#if nullable}}Yes{{else}}No{{/if}}
76
- {{#if example}}
77
-
78
- {{{renderPropertyExample this}}}
79
- {{/if}}
80
- {{#if related_topics}}
81
-
82
- *Related topics:*
83
-
84
- {{#each related_topics}}
85
- * {{{this}}}
86
- {{/each}}
87
- {{/if}}
88
- {{#if aliases}}
89
-
90
- // tag::self-managed-only[]
91
- *Aliases:* {{join aliases ", "}}
92
- // end::self-managed-only[]
93
- {{/if}}
94
- {{#if is_deprecated}}
95
-
96
- [WARNING]
97
- ====
98
- This property is deprecated.
99
- ====
100
- {{/if}}
101
- ---
102
- {{#if cloud_supported}}
103
- // end::redpanda-cloud[]
104
- {{/if}}
@@ -1,17 +0,0 @@
1
- = {{pageTitle}}
2
- {{#if pageAliases}}
3
- :page-aliases: {{join pageAliases ", "}}
4
- {{/if}}
5
- :description: {{description}}
6
-
7
- {{{intro}}}
8
-
9
- {{#if sectionTitle}}
10
- == {{sectionTitle}}
11
- {{/if}}
12
-
13
- {{#if sectionIntro}}
14
- {{{sectionIntro}}}
15
- {{/if}}
16
-
17
- include::reference:partial$properties/{{filename}}.adoc[]
@@ -1,22 +0,0 @@
1
- = {{pageTitle}}
2
- {{#if pageAliases}}
3
- :page-aliases: {{join pageAliases ", "}}
4
- {{/if}}
5
- :description: {{description}}
6
-
7
- {{{intro}}}
8
-
9
- {{#if sectionTitle}}
10
- == {{sectionTitle}}
11
- {{/if}}
12
-
13
- {{#if sectionIntro}}
14
- {{{sectionIntro}}}
15
- {{/if}}
16
-
17
- {{#each groups}}
18
- {{#each this.properties}}
19
- {{> (lookup ../this "template")}}
20
-
21
- {{/each}}
22
- {{/each}}
@@ -1,97 +0,0 @@
1
- {{#if cloud_supported}}
2
- // tag::redpanda-cloud[]
3
- {{/if}}
4
- === {{name}}
5
- {{#if version}}
6
-
7
- *Introduced in {{version}}*
8
- {{/if}}
9
- {{#if description}}
10
-
11
- {{{description}}}
12
- {{else}}
13
-
14
- No description available.
15
- {{/if}}
16
- {{#if is_enterprise}}
17
-
18
- ifndef::env-cloud[]
19
- *Enterprise license required*: `{{enterprise_value}}` (for license details, see xref:get-started:licensing/index.adoc[Redpanda Licensing])
20
- endif::[]
21
- {{/if}}
22
- {{#if cloud_byoc_only}}
23
-
24
- NOTE: This property is only available in Redpanda Cloud BYOC deployments.
25
- {{/if}}
26
- {{#if type}}
27
-
28
- *Type:* {{type}}
29
- {{/if}}
30
- {{#if acceptable_values}}
31
-
32
- *Accepted values:* {{{acceptable_values}}}
33
- {{/if}}
34
- {{#if corresponding_cluster_property}}
35
-
36
- *Related cluster property:* xref:reference:cluster-properties.adoc#{{corresponding_cluster_property}}[{{corresponding_cluster_property}}]
37
- {{/if}}
38
- {{#if (and minimum maximum)}}
39
-
40
- *Accepted values:* [`{{minimum}}`, `{{maximum}}`]
41
- {{else}}
42
- {{#if minimum}}
43
-
44
- *Minimum value:* `{{minimum}}`
45
- {{/if}}
46
- {{#if maximum}}
47
-
48
- *Maximum value:* `{{maximum}}`
49
- {{/if}}
50
- {{/if}}
51
- {{#if (ne default undefined)}}
52
- {{#if cloud_supported}}
53
-
54
- ifdef::env-cloud[]
55
- *Default:* Available in the Redpanda Cloud Console
56
- endif::[]
57
- ifndef::env-cloud[]
58
- *Default:* `{{formatPropertyValue default type}}`
59
- endif::[]
60
- {{else}}
61
-
62
- *Default:* `{{formatPropertyValue default type}}`
63
- {{/if}}
64
- {{/if}}
65
-
66
- // tag::self-managed-only[]
67
- *Nullable:* {{#if nullable}}Yes{{else}}No{{/if}}
68
- // end::self-managed-only[]
69
- {{#if example}}
70
-
71
- {{{renderPropertyExample this}}}
72
- {{/if}}
73
- {{#if related_topics}}
74
-
75
- *Related topics:*
76
-
77
- {{#each related_topics}}
78
- * {{{this}}}
79
- {{/each}}
80
- {{/if}}
81
- {{#if aliases}}
82
-
83
- // tag::self-managed-only[]
84
- *Aliases:* {{join aliases ", "}}
85
- // end::self-managed-only[]
86
- {{/if}}
87
- {{#if is_deprecated}}
88
-
89
- [WARNING]
90
- ====
91
- This property is deprecated.
92
- ====
93
- {{/if}}
94
- ---
95
- {{#if cloud_supported}}
96
- // end::redpanda-cloud[]
97
- {{/if}}