mirror of
http://shenjack.top:5100/ARS/ARS-docs.git
synced 2024-11-23 11:21:06 +08:00
shenjack
2558274afb
push 看起来还是得要node是吧 用这个 还得ensurepip是吧 用一下 setup python reee 行 v4 ? 还得是local 使用新 mirror 的 ? 不用了,行吧 ? v1 ? 行吗?
29 lines
585 B
Python
29 lines
585 B
Python
|
|
from pathlib import Path
|
|
from pprint import pprint
|
|
|
|
import mistune
|
|
|
|
ast_markdown = mistune.create_markdown(renderer='ast')
|
|
|
|
def read_files(module_path: Path):
|
|
with open(module_path, 'r', encoding='utf-8') as f:
|
|
file = f.read()
|
|
|
|
parsed = ast_markdown(file)
|
|
return parsed
|
|
|
|
|
|
if __name__ == '__main__':
|
|
module_path = Path('modules')
|
|
|
|
# walk through the modules
|
|
# for every markdown file
|
|
# parse the label
|
|
|
|
for md_file in module_path.rglob('*.md'):
|
|
print(md_file)
|
|
parsed = read_files(md_file)
|
|
pprint(parsed)
|
|
|