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