if cover is not None:
self.cover = cover
- def dc(self, tag):
- return self.doc.meta.get_one(DCNS(tag))
+ def dc(self, tag, multiple=False):
+ if multiple:
+ return ', '.join(self.doc.meta.get(DCNS(tag)))
+ else:
+ return self.doc.meta.get_one(DCNS(tag))
def build(self, ctx=None):
'Information about the resource',
'Publisher: %s' % self.dc('publisher'),
'Rights: %s' % self.dc('rights'),
- 'Intended audience: %s' % self.dc('audience'),
+ 'Intended audience: %s' % self.dc('audience', multiple=True),
self.dc('description'),
'Resource prepared using MIL/PEER editing platform.',
'Source available at %s' % ctx.source_url,
doc.append(texml_cmd("section*", "Information about the resource"))
doc.append(texml_cmd("vspace", "1em"))
- for m, f in (
- ('Publisher: ', DCNS('publisher')),
- ('Rights: ', DCNS('rights')),
- ('Intended audience: ', DCNS('audience')),
- ('', DCNS('description'))):
- v = self.doc.meta.get_one(f)
+ for m, f, multiple in (
+ ('Publisher: ', DCNS('publisher'), False),
+ ('Rights: ', DCNS('rights'), False),
+ ('Intended audience: ', DCNS('audience'), True),
+ ('', DCNS('description'), False)):
+ if multiple:
+ v = ', '.join(self.doc.meta.get(f))
+ else:
+ v = self.doc.meta.get_one(f)
if v:
e = texml_cmd("par", "")
e[0].append(texml_cmd("noindent"))