1if __name__ ==
"__main__":
3 from datetime
import datetime
as dt
6 README_PATH =
"../README.md"
7 README_GEN_PATH = README_PATH +
".build"
8 VERSION_TAG = sys.argv[1][1:-1]
9 VERSION_MAJOR = VERSION_TAG.split(
".")[0]
10 VERSION_MD_PATH =
"../book/versions"
12 with open(README_GEN_PATH,
"r")
as f:
13 readme = {
"content": f.read()}
16 readme[
"content"] = readme[
"content"].replace(
"{{" + var +
"}}", text)
18 put(
"DATE", str(dt.now()))
19 put(
"VERSION", VERSION_TAG)
20 put(
"AUTHOR",
"[Ethan Uppal](https://www.ethanuppal.com)")
22 with open(f
"{VERSION_MD_PATH}/{VERSION_MAJOR}.md",
"r")
as md:
23 put(
"VERSIONMD", md.read())
25 with open(README_PATH,
"w")
as f:
27 "<!-- THIS FILE IS GENERATED AUTOMATICALLY. -->\n<!-- DO NOT EDIT THIS FILE. -->\n<!-- EDIT README.md.build INSTEAD. -->\n"