markdown.py 文件源码

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

项目:cs251-toolkit 作者: StoDevX 项目源码 文件源码
def format_assignment_markdown(recording, debug=False):
    """Given a single recording, format it into a markdown file.

    Each recording will only have one student.

    Returns a {content: str, student: str, type: str, assignment: str} dict.
    """

    try:
        files = format_files_list(recording.get('files', {}))
        warnings = format_warnings(recording.get('warnings', {}).items())
        header = format_header(recording, warnings)
        output = (header + files) + '\n\n'

    except Exception as err:
        if debug:
            raise err
        output = indent(traceback.format_exc(), ' ' * 4) + '\n\n'

    return {
        'assignment': recording['spec'],
        'content': output,
        'student': recording['student'],
        'type': 'md',
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号