From ba87ee895e358bd9f5a994adcbfdc315b3f31321 Mon Sep 17 00:00:00 2001 From: Govindas Date: Mon, 24 Jan 2022 12:25:29 +0200 Subject: [PATCH] Cleanup document, remove unnecessary join --- generate.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/generate.py b/generate.py index fe62b27..fb13ec4 100644 --- a/generate.py +++ b/generate.py @@ -27,7 +27,7 @@ def generateNavigationBar(lines): def generateLines(title, lines): title = title.replace(".page", "") - document = Document(title, lang="en") + doc = Document(title, lang="en") rawhtml = False for line in lines: @@ -42,21 +42,21 @@ def generateLines(title, lines): html = html + line.strip() else: rawhtml = False - document.join(HTML(html)) + doc(HTML(html)) #parse markdown else: md = markdown.markdown(line.strip()) - document.join(HTML(md)) + doc(HTML(md)) #if indented html was the last line, this is needed for it to not be ignored if rawhtml == True: rawhtml = False - document.join(HTML(html)) + doc(HTML(html)) - generatePage(title, document) + generatePage(title, doc) -def generatePage(title, document): +def generatePage(title, doc): #creates ./website-output/pagetitle/index.html file if it is not homepage foldername = "" @@ -66,9 +66,9 @@ def generatePage(title, document): with open("./website-output" + foldername + "/index.html", 'w') as newpage: if 'navbar' in globals(): - newpage.write(str(E.ul(navbar).join(document))) + newpage.write(str(E.ul(navbar)) + str(doc)) else: - newpage.write(str(document)) + newpage.write(str(doc)) if os.path.exists("./navbar"): with open("./navbar", 'r') as navbarfile: