embed_code.py 文件源码

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

项目:OpenMDAO 作者: OpenMDAO 项目源码 文件源码
def run(self):
        # create a list of document nodes to return
        doc_nodes = []
        for arg in self.arguments:
            # grabbing a list of the code segments that contain the
            # title, source, and output of a test segment.
            code = get_source_code_of_class_or_method(arg)

            # we want the body of test code to be formatted and code highlighted
            body = nodes.literal_block(code, code)
            body['language'] = 'python'

            # put the nodes we've created in the list, and return them
            doc_nodes.append(body)

        return doc_nodes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号