diff options
| author | Patrick Williams <patrick@stwcx.xyz> | 2016-10-09 16:23:20 -0500 |
|---|---|---|
| committer | Patrick Williams <patrick@stwcx.xyz> | 2016-10-13 08:07:57 -0500 |
| commit | 40c2e1928f1858972eda5aafc9dd5e4f8e076f4a (patch) | |
| tree | 555d0daa06f4e42017445f80e8bdb48a67307fc3 | |
| parent | 96683faf78a273b0838baad45de570e527e14781 (diff) | |
| download | sdbusplus-40c2e1928f1858972eda5aafc9dd5e4f8e076f4a.tar.gz sdbusplus-40c2e1928f1858972eda5aafc9dd5e4f8e076f4a.zip | |
signal: render as markdown
Change-Id: Ibd5da3a0558b6ddbad3d0b64ee692746dc2ced32
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
| -rw-r--r-- | tools/sdbusplus/signal.py | 4 | ||||
| -rw-r--r-- | tools/templates/interface.mako.md | 9 | ||||
| -rw-r--r-- | tools/templates/signal.mako.md | 12 |
3 files changed, 25 insertions, 0 deletions
diff --git a/tools/sdbusplus/signal.py b/tools/sdbusplus/signal.py index f7cf71b..824840f 100644 --- a/tools/sdbusplus/signal.py +++ b/tools/sdbusplus/signal.py @@ -7,3 +7,7 @@ class Signal(NamedElement, object): kwargs.pop('properties', []) ] super(Signal, self).__init__(**kwargs) + + def markdown(self, loader): + template = loader.get_template("signal.mako.md") + return template.render(signal=self, loader=loader) diff --git a/tools/templates/interface.mako.md b/tools/templates/interface.mako.md index a11320b..f11c9e9 100644 --- a/tools/templates/interface.mako.md +++ b/tools/templates/interface.mako.md @@ -21,3 +21,12 @@ ${"##"} Properties %else: No properties. %endif + +${"##"} Signals +% if len(interface.signals): + % for s in interface.signals: +${s.markdown(loader)} + %endfor +%else: +No signals. +%endif diff --git a/tools/templates/signal.mako.md b/tools/templates/signal.mako.md new file mode 100644 index 0000000..ae8b3c4 --- /dev/null +++ b/tools/templates/signal.mako.md @@ -0,0 +1,12 @@ +${"###"} ${signal.name} + +${signal.description} + +%if len(signal.properties): +${"####"} Properties +| name | type | description | +|------|------|-------------| + % for p in signal.properties: +| ${p.markdown(loader)} | + % endfor +% endif |

