Small improvements

This commit is contained in:
Govindas 2022-01-22 16:19:47 +02:00
parent c5cf7e970d
commit a5785092c4

View File

@ -21,8 +21,8 @@ def generateNavigationBar(lines):
global navbar
navbar = E
for line in lines:
split = line.strip().split(";", 1)
navbar = navbar.li(HTML("<a href='" + split[1] + "'>" + split[0] + "</a>"))
title, link = line.strip().split(";", 1)
navbar = navbar.li(HTML("<a href='" + link + "'>" + title + "</a>"))
def generateLines(title, lines):
global document
@ -54,7 +54,10 @@ if os.path.exists("./navbar"):
else:
print("No 'navbar' file found, there will be no navigation bar.")
pagescount = 0
for file in os.listdir("./"):
if file.endswith(".page"):
with open(file, 'r') as page:
generateLines(os.path.basename(file), page.readlines())
pagescount=pagescount+1
print("Generated " + str(pagescount) + " pages")