import common
def html(entries, date):
colour_class = f"month-{date.month:02d}"
list_of_entries = (
"
"
+ "".join(
("" + common.link_to_entry(entry) + " ")
for entry in entries
if entries[entry]["date"].year == date.year
and entries[entry]["date"].month == date.month
)
+ " "
)
list_of_dates = (
"Years: "
+ ""
+ "".join(
("" + f'{year:%Y} ' + " ")
for year in common.years
)
+ " "
+ "Months: "
+ ""
+ "".join(
(
""
+ (
f"{month:%B} "
if month.month == date.month
else f'{month:%B} '
)
+ " "
)
for month in common.months
if month.year == date.year
)
+ " "
+ "Days: "
+ ""
+ "".join(
("" + f'{day:%d} ' + " ")
for day in common.days
if day.year == date.year and day.month == date.month
)
+ " "
)
return common.print_html(
f"""
{common.head}
{common.title(f"{date:%B %Y}")}
{list_of_entries}
{common.footer}
"""
)