import os from html5tagger import Document from shutil import rmtree #if homepage is at Home.page, set homepage to "Home" homepage = "Home" try: os.mkdir("./website-output") except FileExistsError: print("Output directory already exists, let's clean it!") #deleting contents of folder without deleting the folder, to increase compatibility with various systems for root, dirs, files in os.walk('./website-output'): for f in files: os.unlink(os.path.join(root, f)) for d in dirs: rmtree(os.path.join(root, d)) #generate navigation bar navbarfound = False if os.path.exists("./navbar"): with open("./navbar", 'r') as navbarfile: navbarfound = True navbar = "" for line in navbarfile.readlines(): split = line.strip().split(";", 1) navbar = navbar + "