diff --git a/src/lib/parameters/px4params/markdownout.py b/src/lib/parameters/px4params/markdownout.py index 4c698fb511..d8ab163957 100644 --- a/src/lib/parameters/px4params/markdownout.py +++ b/src/lib/parameters/px4params/markdownout.py @@ -20,11 +20,24 @@ If a listed parameter is missing from the Firmware see: [Finding/Updating Parame """ ) + # Define the groups and parameters that are specific to certain boards, to allow for a note to be added to the documentation. + BOARD_SPECIFIC_GROUPS = ['Actuator Outputs'] + PARAM_IS_OUTPUT_TIMER = ['PWM_MAIN_TIM0', 'PWM_MAIN_TIM1', 'PWM_MAIN_TIM2', 'PWM_AUX_TIM0', 'PWM_AUX_TIM1', 'PWM_AUX_TIM2', 'PWM_AUX_TIM3'] + for group in groups: result += f'## {group.GetName()}\n\n' + group_is_board_specific = (group.GetName() in BOARD_SPECIFIC_GROUPS) + for param in group.GetParams(): name = param.GetName() + + # Apply note if either the group is board specific + apply_note_board_specific_group = group_is_board_specific + + # Apply note if name is in list of timer group parameters + apply_timer_param_note = (name in PARAM_IS_OUTPUT_TIMER) + short_desc = param.GetFieldValue("short_desc") or '' # Add fullstop to short_desc if not present @@ -78,6 +91,10 @@ If a listed parameter is missing from the Firmware see: [Finding/Updating Parame def_val='Disabled (0)' result += f'### {name} (`{type}`)' + ' {#' + name + '}\n\n' + if apply_note_board_specific_group: + result += f'\n\n' + if apply_timer_param_note: + result += f'\n\n' if short_desc: result += f'{short_desc}\n\n' if long_desc: @@ -87,7 +104,7 @@ If a listed parameter is missing from the Firmware see: [Finding/Updating Parame if bitmask_list: result += bitmask_output # Format the ranges as a table. - result += f"Reboot | minValue | maxValue | increment | default | unit\n--- | --- | --- | --- | --- | ---\n{'✓' if reboot_required else ' ' } | {min_val} | {max_val} | {increment} | {def_val} | {unit} \n\n" + result += f"Reboot | minValue | maxValue | increment | default | unit\n--- | --- | --- | --- | --- | ---\n{'✓' if reboot_required else ' ' } | {min_val} | {max_val} | {increment} | {def_val} | {unit} | \n\n" self.output = result