google_doc.py 文件源码

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

项目:fieldsight-kobocat 作者: awemulya 项目源码 文件源码
def _navigation_list(self, node=None):
        """
        Return an html representation of the table of contents for
        this document. This is done recursively adding on a list item
        for each element in the tree, and an unordered list if this
        node has children. I might want to double check that this html
        is the correct way to nest lists.
        """
        if node is None:
            self._construct_section_tree()
            return self._navigation_list(self._section_tree)
        result = ""
        if 'title' in node.value and 'id' in node.value:
            result += '<li>%s</li>' % node.value.url()
        if len(node) > 0:
            result += "<ul>%s</ul>" % \
                "\n".join([self._navigation_list(child) for child in node])
        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号