latex.py 文件源码

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

项目:chalktalk_docs 作者: loremIpsum1771 项目源码 文件源码
def expand_show_urls(self):
        show_urls = self.document.settings.env.config.latex_show_urls
        if show_urls is False or show_urls == 'no':
            return

        for node in self.document.traverse(nodes.reference):
            uri = node.get('refuri', '')
            if uri.startswith(URI_SCHEMES):
                if uri.startswith('mailto:'):
                    uri = uri[7:]
                if node.astext() != uri:
                    index = node.parent.index(node)
                    if show_urls == 'footnote':
                        footnote_nodes = self.create_footnote(uri)
                        for i, fn in enumerate(footnote_nodes):
                            node.parent.insert(index + i + 1, fn)

                        self.expanded = True
                    else:  # all other true values (b/w compat)
                        textnode = nodes.Text(" (%s)" % uri)
                        node.parent.insert(index + 1, textnode)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号