adds chapters to the todo md file

This commit is contained in:
waldek 2022-07-14 11:54:58 +02:00
parent 98125772f3
commit 17e141c6bf
2 changed files with 321 additions and 301 deletions

View File

@ -10,18 +10,23 @@ URL = "https://gitea.86thumbs.net/waldek/linux_introduction/src/branch/master/"
if __name__ == "__main__": if __name__ == "__main__":
with open(INPUT, "r") as fp: with open(INPUT, "r") as fp:
data = [] src = []
for line in fp.readlines(): for line in fp.readlines():
src.append(line)
data = []
for nr, line in zip(range(0, len(src)), src):
stripped = line.strip() stripped = line.strip()
stripped = stripped.replace("*", "") stripped = stripped.replace("*", "")
stripped = stripped.strip() stripped = stripped.strip()
if "====" in line:
data.append("# {}".format(src[nr - 1]))
if "(./" in stripped: if "(./" in stripped:
topic = stripped[stripped.find("[")+1:stripped.find("]")] topic = stripped[stripped.find("[")+1:stripped.find("]")]
url = stripped.replace("(./", "({}".format(URL)) url = stripped.replace("(./", "({}".format(URL))
url = re.sub("\[.*\]", "[Link]", url) url = re.sub("\[.*\]", "[Link]", url)
url = " * {} to course documentation".format(url) url = " * {} to course documentation".format(url)
header = "# {}".format(topic) header = "## {}".format(topic)
notes = "## Student notes:" notes = "### Student notes:"
data.append(header) data.append(header)
data.append(url) data.append(url)

File diff suppressed because it is too large Load Diff