CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
build_tcmd_and_config_docs Namespace Reference

Functions

list|dict download_json (str url)
str strip_readiness_prefix (str readiness_level)
str escape_md_cell (str|None text)
str render_telecommand_section (list[dict] telecommands)
str render_config_variable_section (dict config_data)
None generate_markdown_file (Path output_path)
None main ()

Variables

str TELECOMMAND_LIST_URL = "https://raw.githubusercontent.com/CalgaryToSpace/CTS-SAT-1-Ground-Support/refs/heads/main/cts1_ground_support/bundled_data/cts_sat_1_telecommand_list.json"
str CONFIG_VARIABLE_LIST_URL = "https://raw.githubusercontent.com/CalgaryToSpace/CTS-SAT-1-Ground-Support/refs/heads/main/cts1_ground_support/bundled_data/cts_sat_1_config_variable_list.json"
str READINESS_LEVEL_PREFIX = "TCMD_READINESS_LEVEL_"
str MD_FILE_TEMPLATE

Detailed Description

Generate a Markdown file listing all telecommands and configuration variables.

The telecommand and configuration variable definitions are downloaded from the
CTS-SAT-1-Ground-Support repository's bundled data files (which are themselves
auto-generated from the OBC firmware source).

Run this script with:
```bash
pip install uv

uv run docs/generation/build_tcmd_and_config_list.py
```

The `uv` tool automatically installs the required dependencies specified in the
`dependencies` section below.

Function Documentation

◆ download_json()

list | dict download_json ( str url)
Downloads a JSON file from `url` and returns its parsed content.
Here is the caller graph for this function:

◆ escape_md_cell()

str escape_md_cell ( str | None text)
Makes a string safe to put inside a single Markdown table cell.

Pipes are escaped, and newlines are replaced with `<br>` so multi-line
docstrings render as multi-line cells.
Here is the caller graph for this function:

◆ generate_markdown_file()

None generate_markdown_file ( Path output_path)
Downloads source data and writes the assembled Markdown file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

None main ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_config_variable_section()

str render_config_variable_section ( dict config_data)
Renders the configuration variables section of the Markdown file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_telecommand_section()

str render_telecommand_section ( list[dict] telecommands)
Renders the telecommand section of the Markdown file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ strip_readiness_prefix()

str strip_readiness_prefix ( str readiness_level)
Strips the verbose `TCMD_READINESS_LEVEL_` prefix for nicer display.
Here is the caller graph for this function:

Variable Documentation

◆ CONFIG_VARIABLE_LIST_URL

str build_tcmd_and_config_docs.CONFIG_VARIABLE_LIST_URL = "https://raw.githubusercontent.com/CalgaryToSpace/CTS-SAT-1-Ground-Support/refs/heads/main/cts1_ground_support/bundled_data/cts_sat_1_config_variable_list.json"

◆ MD_FILE_TEMPLATE

str build_tcmd_and_config_docs.MD_FILE_TEMPLATE
Initial value:
= """\
# Telecommands and Configuration Variables
This is an auto-generated reference of all telecommands and configuration
variables supported by the CTS-SAT-1 OBC firmware. It is generated by the
`{this_script_file_name}` script.
Source data downloaded from the
[`CTS-SAT-1-Ground-Support`](https://github.com/CalgaryToSpace/CTS-SAT-1-Ground-Support)
repository's bundled data files.
## Table of Contents
- [Telecommands](#telecommands)
- [Readiness Levels](#readiness-levels)
- [Summary Table](#summary-table)
- [Telecommand Details](#telecommand-details)
- [Configuration Variables](#configuration-variables)
- [Summary Table](#summary-table-1)
- [Integer Configuration Variable Details](#integer-configuration-variable-details)
- [String Configuration Variable Details](#string-configuration-variable-details)
---
{telecommand_section}
---
{config_variable_section}
"""

◆ READINESS_LEVEL_PREFIX

str build_tcmd_and_config_docs.READINESS_LEVEL_PREFIX = "TCMD_READINESS_LEVEL_"

◆ TELECOMMAND_LIST_URL

str build_tcmd_and_config_docs.TELECOMMAND_LIST_URL = "https://raw.githubusercontent.com/CalgaryToSpace/CTS-SAT-1-Ground-Support/refs/heads/main/cts1_ground_support/bundled_data/cts_sat_1_telecommand_list.json"