From 7488f55de00b8ffd4813f504a1cf5cc3e602f6d8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 5 Oct 2010 17:11:06 +0000 Subject: Add both developer and maintainer information to generated documentation. --- lv2specgen/lv2specgen.py | 21 ++++++++++++++++++--- lv2specgen/template.html | 4 ++-- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'lv2specgen') 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 += '
%s
' % 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 += '
' + j.object.literal_value['string'] + '
' + maint += '
%s
' % j.object.literal_value['string'] + + if dev == '' and maint == '': + return '' + + ret = '' + if dev != '': + ret += 'Developer(s)' + dev + '' + if maint != '': + ret += 'Maintainer(s)' + maint + '' + 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 @@ - - + + @AUTHORS@
URI@URI@
Revision@REVISION@
Maintainer(s)@MAINTAINERS@
Namespaces@PREFIXES@
Namespaces@PREFIXES@
-- cgit v1.2.1