def _render(self, context):
"""
Renders the plain and html versions of a template.
Return both in a tuple, where the first element is the plain text
version and the second element is the html version
:return: (str, str,)
"""
if not context:
context = Context({})
plain = self.template_plain.render(context)
html = self.template_html.render(context)
css = get_template(self.template_style).render(Context({}))
p = Pynliner()
html = p.from_string(html).with_cssString(css).run()
return plain, html
评论列表
文章目录