def to_html(self, md = None, scroll_pos = -1, content_only = False):
md = md or self.markup.text
result = markdown(md, extras=self.extras)
if not content_only:
intro = Template(self.htmlIntro.safe_substitute(css = self.css))
(font_name, font_size) = self.font
result = intro.safe_substitute(
background_color = self.to_css_rgba(self.markup.background_color),
text_color = self.to_css_rgba(self.markup.text_color),
font_family = font_name,
text_align = self.to_css_alignment(),
font_size = str(font_size)+'px',
init_postfix = self.init_postfix,
link_prefix = self.link_prefix,
debug_prefix = self.debug_prefix,
scroll_pos = scroll_pos
) + result + self.htmlOutro
return result
评论列表
文章目录