-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeattribdoc
More file actions
executable file
·25 lines (22 loc) · 1.12 KB
/
makeattribdoc
File metadata and controls
executable file
·25 lines (22 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python3
import os
import sys
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.realpath(os.path.join(path, 'confluent', 'confluent_server'))
sys.path.append(path)
import confluent.config.attributes as attr
with open('docs/user_reference/node_attributes.md', 'w', encoding='utf-8') as outf:
outf.write('# Node Attributes\n\n')
outf.write('Confluent uses a variety of attributes on nodes to be configured and provide information. The currently recognized attributes are as follows.\n\n')
previous_category = None
for field in sorted(attr.node):
category = field.split('.')[0]
if category != previous_category:
outf.write(f'\n## {category}\n')
previous_category = category
outf.write(f'\n### {field}\n\n: {attr.node[field]['description']}\n')
# Optionally write valid values if they exist
for key, values in attr.node[field].items():
if key.startswith('valid'):
values_formatted = ', '.join(f"`{v if v != '' else ' '}`" for v in values)
outf.write(f"\n: Valid values: {values_formatted}\n")