23 lines
576 B
Python
23 lines
576 B
Python
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!') |