diff options
author | David Robillard <d@drobilla.net> | 2010-10-05 17:11:06 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-10-05 17:11:06 +0000 |
commit | 7488f55de00b8ffd4813f504a1cf5cc3e602f6d8 (patch) | |
tree | f9f98b403f073ed0d655725d8d6a84ea93743fb7 | |
parent | 4b1bcc2063e0e71c415ad5a6cf1bbdb400ce6093 (diff) | |
download | lv2-7488f55de00b8ffd4813f504a1cf5cc3e602f6d8.tar.xz |
Add both developer and maintainer information to generated documentation.
-rwxr-xr-x | lv2specgen/lv2specgen.py | 21 | ||||
-rw-r--r-- | lv2specgen/template.html | 4 |
2 files changed, 20 insertions, 5 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index df13d05..3a8e5b5 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -549,10 +549,25 @@ def specProperties(m, subject, predicate): def specAuthors(m, subject): "Return an HTML description of the authors of the spec." - ret = '' + dev = '' + for i in m.find_statements(RDF.Statement(None, doap.developer, None)): + for j in m.find_statements(RDF.Statement(i.object, foaf.name, None)): + dev += '<div class="author" property="doap:developer">%s</div>' % j.object.literal_value['string'] + + maint = '' for i in m.find_statements(RDF.Statement(None, doap.maintainer, None)): for j in m.find_statements(RDF.Statement(i.object, foaf.name, None)): - ret += '<div class="author" property="dc:creator">' + j.object.literal_value['string'] + '</div>' + maint += '<div class="author" property="doap:maintainer">%s</div>' % j.object.literal_value['string'] + + if dev == '' and maint == '': + return '' + + ret = '' + if dev != '': + ret += '<tr><th class="metahead">Developer(s)</th><td>' + dev + '</td></tr>' + if maint != '': + ret += '<tr><th class="metahead">Maintainer(s)</th><td>' + maint + '</td></tr>' + return ret @@ -683,7 +698,7 @@ def specgen(specloc, docdir, template, instances=False, mode="spec"): template = template.replace('@PREFIXES@', str(prefixes_html)) template = template.replace('@BASE@', spec_ns_str) - template = template.replace('@MAINTAINERS@', specAuthors(m, spec_url)) + template = template.replace('@AUTHORS@', specAuthors(m, spec_url)) template = template.replace('@INDEX@', azlist) template = template.replace('@REFERENCE@', termlist.encode("utf-8")) template = template.replace('@FILENAME@', filename) diff --git a/lv2specgen/template.html b/lv2specgen/template.html index c30c83c..8af2635 100644 --- a/lv2specgen/template.html +++ b/lv2specgen/template.html @@ -22,8 +22,8 @@ <table> <tr><th class="metahead">URI</th><td><a href="@URI@">@URI@</a></td></tr> <tr><th class="metahead">Revision</th><td>@REVISION@</td></tr> - <tr><th class="metahead">Maintainer(s)</th><td>@MAINTAINERS@</td></tr> - <tr><th class="metahead">Namespaces</th><td>@PREFIXES@</td></tr> + <tr><th class="metahead">Namespaces</th><td>@PREFIXES@</td></tr> + @AUTHORS@ </table> </div> |