mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 10:26:52 +08:00
Parameter markdown use page css for layout
This commit is contained in:
@@ -3,21 +3,39 @@ import codecs
|
|||||||
|
|
||||||
class MarkdownTablesOutput():
|
class MarkdownTablesOutput():
|
||||||
def __init__(self, groups):
|
def __init__(self, groups):
|
||||||
result = ("# Parameter Reference\n"
|
result = (
|
||||||
"> **Note** **This documentation was auto-generated from the source code for this PX4 version** (using `make parameters_metadata`).\n"
|
"""# Parameter Reference
|
||||||
"\n"
|
|
||||||
"<span></span>\n"
|
:::note
|
||||||
"> **Note** If a listed parameter is missing from the Firmware see: [Finding/Updating Parameters](http://docs.px4.io/master/en/advanced_config/parameters.html#missing).\n"
|
This documentation was auto-generated from the source code for this PX4 version (using `make parameters_metadata`).
|
||||||
"\n")
|
:::
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
If a listed parameter is missing from the Firmware see: [Finding/Updating Parameters](http://docs.px4.io/master/en/advanced_config/parameters.html#missing).
|
||||||
|
:::
|
||||||
|
|
||||||
|
<!-- markdown generator: src/lib/parameters/px4params/markdownout.py -->
|
||||||
|
|
||||||
|
<style>
|
||||||
|
tr > * {
|
||||||
|
vertical-align : top;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
for group in groups:
|
for group in groups:
|
||||||
result += '## %s\n\n' % group.GetName()
|
result += '## %s\n\n' % group.GetName()
|
||||||
result += '<table>\n'
|
result += (
|
||||||
result += ' <colgroup><col style="width: 23%"><col style="width: 46%"><col style="width: 11%"><col style="width: 11%"><col style="width: 9%"></colgroup>\n'
|
"""<table>
|
||||||
result += ' <thead>\n'
|
<colgroup><col style="width: 23%"><col style="width: 46%"><col style="width: 11%"><col style="width: 11%"><col style="width: 9%"></colgroup>
|
||||||
result += ' <tr><th>Name</th><th>Description</th><th>Min > Max (Incr.)</th><th>Default</th><th>Units</th></tr>\n'
|
<thead>
|
||||||
result += ' </thead>\n'
|
<tr><th>Name</th><th>Description</th><th>Min > Max (Incr.)</th><th>Default</th><th>Units</th></tr>
|
||||||
result += '<tbody>\n'
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
"""
|
||||||
|
)
|
||||||
for param in group.GetParams():
|
for param in group.GetParams():
|
||||||
code = param.GetName()
|
code = param.GetName()
|
||||||
name = param.GetFieldValue("short_desc") or ''
|
name = param.GetFieldValue("short_desc") or ''
|
||||||
@@ -84,7 +102,7 @@ class MarkdownTablesOutput():
|
|||||||
if is_boolean and def_val=='0':
|
if is_boolean and def_val=='0':
|
||||||
def_val='Disabled (0)'
|
def_val='Disabled (0)'
|
||||||
|
|
||||||
result += '<tr>\n <td style="vertical-align: top;">%s (%s)</td>\n <td style="vertical-align: top;"><p>%s</p>%s %s %s %s</td>\n <td style="vertical-align: top;">%s</td>\n <td style="vertical-align: top;">%s</td>\n <td style="vertical-align: top;">%s</td>\n</tr>\n' % (code, type, name, long_desc, enum_output, bitmask_output, reboot_required, max_min_combined, def_val, unit)
|
result += '<tr>\n <td>%s (%s)</td>\n <td>%s %s %s %s %s</td>\n <td>%s</td>\n <td>%s</td>\n <td>%s</td>\n</tr>\n' % (code, type, name, long_desc, enum_output, bitmask_output, reboot_required, max_min_combined, def_val, unit)
|
||||||
|
|
||||||
#Close the table.
|
#Close the table.
|
||||||
result += '</tbody></table>\n\n'
|
result += '</tbody></table>\n\n'
|
||||||
|
|||||||
Reference in New Issue
Block a user