CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/autotest/param_metadata/rstlatexpdfemit.py
Views: 1862
1
from rstemit import RSTEmit
2
3
4
class RSTLATEXPDFEmit(RSTEmit):
5
def __init__(self, *args, **kwargs):
6
RSTEmit.__init__(self, *args, **kwargs)
7
8
def output_fname(self):
9
return 'ParametersLatex.rst'
10
11
def render_table_headings(self, ret, row, headings, field_table_info, field, param):
12
# add to ret rather than append rows
13
ret = ''
14
if field in ['Values', 'Bitmask']:
15
ret = "\n\n" + self.render_prog_values_field(field_table_info[field], param, field) + "\n\n"
16
else:
17
row.append(self.render_prog_values_field(field_table_info[field], param, field))
18
19
# remove Values and Bitmask items from headings list
20
while any(x in headings for x in ['Values', 'Bitmask']):
21
try:
22
headings.remove('Bitmask')
23
except ValueError:
24
pass
25
try:
26
headings.remove('Values')
27
except ValueError:
28
pass
29
return ret
30
31