Skip to content

Commit

Permalink
Change titles on docs to show zap vs. spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Mar 28, 2024
1 parent bb4ac53 commit d1ed316
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ testing/index
tools/index
BUG_REPORT
code_generation
clusters
zap_clusters
spec_clusters
ERROR_CODES
```

```{include} README.md
Expand Down
2 changes: 1 addition & 1 deletion docs/cluster_ids.md → docs/spec_clusters.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Matter Cluster IDs
# List of currently defined spec clusters
This file was **AUTOMATICALLY** generated by `python scripts/generate_spec_xml.py`. DO NOT EDIT BY HAND!

| ID (Decimal) | ID (hex) | Name |
Expand Down
2 changes: 1 addition & 1 deletion docs/clusters.md → docs/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Generally regenerate using one of:
- ./scripts/codegen.py --output-dir docs --generator summary-markdown src/controller/data_model/controller-clusters.matter
-->

## List of currently defined clusters
## List of currently defined ZAP clusters

| Code (dec) | Code (hex) | Name |
| ---------- | ---------- | ------------------------------------------------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs):
def internal_render_all(self):
self.internal_render_one_output(
template_path="clusters_markdown.jinja",
output_file_name="clusters.md",
output_file_name="zap_clusters.md",
vars={
'idl': self.idl,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Generally regenerate using one of:
- ./scripts/codegen.py --output-dir docs --generator summary-markdown src/controller/data_model/controller-clusters.matter
-->

## List of currently defined clusters
## List of currently defined ZAP clusters

| Code (dec) | Code (hex) | Name |
| ---------- | ---------- | ------------------------------------------------------- |
Expand Down
11 changes: 6 additions & 5 deletions scripts/spec_xml/generate_spec_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
os.path.join(os.path.dirname(__file__), '..', '..'))
DEFAULT_OUTPUT_DIR = os.path.abspath(
os.path.join(DEFAULT_CHIP_ROOT, 'data_model'))
DEFAULT_DOCUMENTATION_DIR = os.path.abspath(
os.path.join(DEFAULT_CHIP_ROOT, 'docs', 'cluster_ids.md'))
DEFAULT_DOCUMENTATION_FILE = os.path.abspath(
os.path.join(DEFAULT_CHIP_ROOT, 'docs', 'spec_clusters.md'))


def get_xml_path(filename, output_dir):
Expand Down Expand Up @@ -156,11 +156,12 @@ def dump_cluster_ids(output_dir):
python_testing_path = os.path.abspath(
os.path.join(DEFAULT_CHIP_ROOT, 'src', 'python_testing'))
sys.path.insert(0, python_testing_path)
clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters'))
clusters_output_dir = os.path.abspath(
os.path.join(output_dir, 'clusters'))

from spec_parsing_support import build_xml_clusters

header = '# Matter Cluster IDs\n'
header = '# List of currently defined spec clusters\n'
header += 'This file was **AUTOMATICALLY** generated by `python scripts/generate_spec_xml.py`. DO NOT EDIT BY HAND!\n\n'

clusters, problems = build_xml_clusters()
Expand All @@ -180,7 +181,7 @@ def dump_cluster_ids(output_dir):
hex_id = f'0x{id:04X}'
s += f'|{id:<{dec_len}}|{hex_id:<{hex_len}}|{cluster.name:<{name_len}}|\n'

with open(DEFAULT_DOCUMENTATION_DIR, 'w') as fout:
with open(DEFAULT_DOCUMENTATION_FILE, 'w') as fout:
fout.write(header)
fout.write(s)

Expand Down

0 comments on commit d1ed316

Please sign in to comment.