BallanceBlenderTutorial/gen.py

23 lines
576 B
Python
Raw Normal View History

2022-03-01 14:49:14 +08:00
import markdown
with open('main.md', 'r', encoding='utf-8') as fr:
with open('main.html', 'w', encoding='utf-8') as fw:
fw.write('<!DOCTYPE html>\
<html>\
<head>\
<meta charset="utf-8">\
<link rel="stylesheet" href="main.css">\
</head>\
<body>\
')
fw.write(markdown.markdown(
fr.read(),
output_format='html5',
extensions = [
'markdown.extensions.admonition',
'markdown.extensions.tables'
]))
fw.write('</body>\
</html>')
print('OK!')