from html5tagger import Document, E, HTML import shutil import markdown import html from pathlib import Path #TODO re-think navigation bar. Think of way to add option to display navigation bar entry differently if you're currently on that page. def generateNavigationBar(lines, pagetitle): global navbar navbar = E rawhtml = False htmlstring = "" dropdown = False for id, line in enumerate(lines): #parse raw HTML rawhtml, navbar, htmlstring = parseRawHTML(navbar, line, htmlstring, rawhtml, id, len(lines)) #parse navigation bar (custom format) if not rawhtml: if ";" in line: #experimental dropdown parsing, to be removed or used soon #contents = [] #if "|" in line: # contents.append(line.split("|")) #else: # contents.append(line) #for entry in contents: title, link = line.split(";", 1) if line.strip().endswith("|"): dropdown = True line = line.strip()[-1] dphtml = E dphtml = dphtml(HTML("