def html(self): """ The contents of the document rendered as HTML. """ parts = [] try: with open(INDEX, 'rU') as index: parts.append(index.read()) except IOError: pass try: with open(DIRECTIVES, 'rU') as directives: parts.append(directives.read()) except IOError: pass parts.append(self.content) body = "".join(parts) return rst_to_html(body)
def html_paragraphs(self): return list(rst_to_html(p) for p in self.gen_paragraphs())