iterative closest points
CEV ICP algorithm library
Loading...
Searching...
No Matches
readme.py
Go to the documentation of this file.
1if __name__ == "__main__":
2 import subprocess
3 from datetime import datetime as dt
4 import sys
5
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"
11
12 with open(README_GEN_PATH, "r") as f:
13 readme = {"content": f.read()}
14
15 def put(var, text):
16 readme["content"] = readme["content"].replace("{{" + var + "}}", text)
17
18 put("DATE", str(dt.now()))
19 put("VERSION", VERSION_TAG)
20 put("AUTHOR", "[Ethan Uppal](https://www.ethanuppal.com)")
21
22 with open(f"{VERSION_MD_PATH}/{VERSION_MAJOR}.md", "r") as md:
23 put("VERSIONMD", md.read())
24
25 with open(README_PATH, "w") as f:
26 f.write(
27 "<!-- THIS FILE IS GENERATED AUTOMATICALLY. -->\n<!-- DO NOT EDIT THIS FILE. -->\n<!-- EDIT README.md.build INSTEAD. -->\n"
28 + readme["content"]
29 )
put(var, text)
Definition readme.py:15