MarkdownView.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pythonista-scripts 作者: khilnani 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号