""" Emit docs in a form acceptable to the old Ardupilot wordpress docs site """ from param import known_param_fields, known_units from emit import Emit try: from cgi import escape as cescape except Exception: from html import escape as cescape class HtmlEmit(Emit): def __init__(self, *args, **kwargs): Emit.__init__(self, *args, **kwargs) html_fname = 'Parameters.html' self.f = open(html_fname, mode='w') self.preamble = """
This is a complete list of the parameters which can be set via the MAVLink protocol in the EEPROM of your autopilot to control vehicle behaviour. This list is automatically generated from the latest ardupilot source code, and so may contain parameters which are not yet in the stable released versions of the code.
[toc exclude="Complete Parameter List"] """ self.t = '' def escape(self, s): s = s.replace(' ', '-') s = s.replace(':', '-') s = s.replace('(', '') s = s.replace(')', '') return s def close(self): self.f.write(self.preamble) self.f.write(self.t) self.f.close() def start_libraries(self): pass def emit(self, g): tag = '%s Parameters' % g.reference t = '\n\n%s
\n" % cescape(param.Description) t += "Value | Meaning | \n" for value in values: v = value.split(':') if len(v) != 2: raise ValueError("Bad value (%s)" % v) t += "
---|---|
%s | %s |