#!/usr/bin/env python """ 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 import cgi class HtmlEmit(Emit): def __init__(self): Emit.__init__(self) 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 APM 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.name t = '\n\n%s
\n" % cgi.escape(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 |