fix anchors, introduce top anchor and link to it

This commit is contained in:
fordprefect
2022-02-25 12:05:22 +01:00
parent 34d3e68aac
commit 2ae6135180

View File

@@ -76,7 +76,7 @@ with open("index.html", "w") as f:
f.write("""<html> f.write("""<html>
<head> <head>
</head> </head>
<body> <body id='top'>
""") """)
f.write(f"zuletzt aktualisiert: {datetime.datetime.now().strftime('%d.%m.%Y %H:%M')}<br>") f.write(f"zuletzt aktualisiert: {datetime.datetime.now().strftime('%d.%m.%Y %H:%M')}<br>")
@@ -87,13 +87,14 @@ with open("index.html", "w") as f:
f.write("</list>\n<br><br>\n") f.write("</list>\n<br><br>\n")
for b in bistros: for b in bistros:
f.write(f"<h1><a name='#{b}'></a>{b}</h1>\n") f.write(f"<h1><a id='{b}'></a>{b}</h1>\n")
try: try:
f.write(bistros[b]['f']()) f.write(bistros[b]['f']())
f.write("\n") f.write("\n")
except Exception as e: except Exception as e:
print(f"Speiseplan: Aktualisierung von {b} fehlgeschlagen mit {e}") print(f"Speiseplan: Aktualisierung von {b} fehlgeschlagen mit {e}")
f.write("fehlgeschlagen<br>\n") f.write("fehlgeschlagen<br>\n")
f.write("<p align=right><a href=#top>zurück nach oben</a></p>\n")
f.write("<br><br>\n") f.write("<br><br>\n")