eulaurarien/generate_index.py

26 lines
555 B
Python
Raw Permalink Normal View History

2019-12-27 14:21:33 +00:00
#!/usr/bin/env python3
import markdown2
2021-08-14 21:27:28 +00:00
extras = ["header-ids"]
2019-12-27 14:21:33 +00:00
2021-08-14 21:27:28 +00:00
with open("dist/README.md", "r") as fdesc:
2019-12-27 14:21:33 +00:00
body = markdown2.markdown(fdesc.read(), extras=extras)
output = f"""<!DOCTYPE html>
<html lang="en">
<head>
<title>Geoffrey Frogeye's block list of first-party trackers</title>
<meta charset="utf-8">
<meta name="author" content="Geoffrey 'Frogeye' Preud'homme" />
<link rel="stylesheet" type="text/css" href="markdown7.min.css">
</head>
<body>
{body}
</body>
</html>
"""
2021-08-14 21:27:28 +00:00
with open("dist/index.html", "w") as fdesc:
2019-12-27 14:21:33 +00:00
fdesc.write(output)