def write_styles(self):
"""Write the stylesheet."""
formatter = HtmlFormatter(nowrap=True)
tmpl = jinja2_env.get_template('styles.css')
rendered = tmpl.render(
pygments_css=formatter.get_style_defs()
)
stylesheet = os.path.join(self.outdir, 'styles.css')
with codecs.open(stylesheet, 'w', encoding='utf8') as f:
f.write(rendered)
评论列表
文章目录