提交 eb1b44fd 编写于 作者: W wizardforcel

2020-03-30 10:34:38

上级 62d205bb
因为 它太大了无法显示 source diff 。你可以改为 查看blob
# coding: utf-8
import sys
import re
from os import path
RE_LINK = r'^\[.+?\] (.+?) 上传完毕, .+?\n\[.+?\] META URL -> (.+?)$'
f = sys.argv[1]
co = open(f, encoding='utf-8').read()
links = re.findall(RE_LINK, co, re.M)
# links = {k:v for k, v in links}
print(f'count: {len(links)}')
res = [f'| {n} | {l} |' for n, l in links]
res = '| 文档 | 链接 |\n| --- | --- |\n' + '\n'.join(res)
outf = open(f + '.md', 'w', encoding='utf-8')
outf.write(res)
outf.close()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册