diff options
| author | Patrick Williams <patrick@stwcx.xyz> | 2016-10-09 16:21:34 -0500 |
|---|---|---|
| committer | Patrick Williams <patrick@stwcx.xyz> | 2016-10-13 08:07:57 -0500 |
| commit | 62c3f27d25809699bddc95254f5aeee59cb2ea0b (patch) | |
| tree | 17cd4b039e9b5c7fc4f199ef65ca9b9184955258 /tools | |
| parent | a90b01e255a42b2de779d182635ec24e61214f6f (diff) | |
| download | sdbusplus-62c3f27d25809699bddc95254f5aeee59cb2ea0b.tar.gz sdbusplus-62c3f27d25809699bddc95254f5aeee59cb2ea0b.zip | |
property: render as markdown
Change-Id: I2b01534e553f9d683a3866f6400708201b7805f9
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/sdbusplus/property.py | 4 | ||||
| -rw-r--r-- | tools/templates/interface.mako.md | 11 | ||||
| -rw-r--r-- | tools/templates/property.mako.md | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/tools/sdbusplus/property.py b/tools/sdbusplus/property.py index ef7864b..5b25869 100644 --- a/tools/sdbusplus/property.py +++ b/tools/sdbusplus/property.py @@ -6,3 +6,7 @@ class Property(NamedElement): self.defaultValue = kwargs.pop('default', None) super(Property, self).__init__(**kwargs) + + def markdown(self, loader): + template = loader.get_template("property.mako.md") + return template.render(property=self, loader=loader).strip() diff --git a/tools/templates/interface.mako.md b/tools/templates/interface.mako.md index 17eb835..41d2cce 100644 --- a/tools/templates/interface.mako.md +++ b/tools/templates/interface.mako.md @@ -1,3 +1,14 @@ # ${interface.name} ${interface.description} + +${"##"} Properties +% if len(interface.properties): +| name | type | description | +|------|------|-------------| + % for p in interface.properties: +| ${p.markdown(loader)} | + % endfor +%else: +No properties. +%endif diff --git a/tools/templates/property.mako.md b/tools/templates/property.mako.md new file mode 100644 index 0000000..ee7e451 --- /dev/null +++ b/tools/templates/property.mako.md @@ -0,0 +1 @@ +**${ property.name }** | ${ property.typeName } | ${ property.description.strip() } |

