2023-03-22 15:37:47 -05:00
|
|
|
import os
|
2023-05-09 11:58:45 -05:00
|
|
|
from pathlib import Path
|
2023-03-22 15:37:47 -05:00
|
|
|
|
2023-05-09 11:58:45 -05:00
|
|
|
dir = os.path.dirname(__file__)
|
|
|
|
os.chdir(dir)
|
|
|
|
files = [str(item)[:-3] for item in Path(dir).rglob('*.md')]
|
2023-03-22 15:37:47 -05:00
|
|
|
|
2023-05-09 11:58:45 -05:00
|
|
|
for item in files:
|
2023-03-23 22:03:13 -05:00
|
|
|
os.system(f'pandoc -f markdown-smart --data-dir . --template template.html -t html -o {item}.html {item}.md --metadata title=\"$(grep -m 1 -oP \'(?<=^# ).*\' {item}.md | cat)\"')
|