Skip to content
Snippets Groups Projects
Commit b6f988c6 authored by Lukas Kluft's avatar Lukas Kluft
Browse files

Merge branch 'inactive_calendar' into 'main'

calendar: CSS support for inactive entries

Closes #8

See merge request generic-software-skills/lecture-materials!41
parents 220454b4 fac83eb4
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ If not, don't worry, the lecture will be in a computer room.
| 2024-04-30 | Complexity | Tobi, Dominik |
| 2024-05-07 | Debugging Strategies| Dominik, Rene |
| 2024-05-14 | Good scientific & coding practice | Bjorn, Theresa|
| 2024-05-21 | User experience design | Theresa, Flo |
| [2024-05-21]{.inactive} | User experience design | Theresa, Flo |
| 2024-05-28 | Testing | Nils, René |
| 2024-06-04 | Git advanced | Tobi, Nils |
| 2024-06-11 | Parallelism | Georgiana, Claudia, JFE |
......
......@@ -11,7 +11,10 @@ from datetime import datetime, timezone
def extract_lecture_dates(markdown_file, output_file):
with open(markdown_file, "r") as file:
html_content = markdown2.markdown(file.read(), extras=["tables"])
if markdown_file.suffix == ".html":
html_content = file.read()
else:
html_content = markdown2.markdown(file.read(), extras=["tables"])
cal = Calendar()
cal.add("prodid", "-//md2ical//Generic Software Skills Lectures//EN")
......@@ -23,7 +26,7 @@ def extract_lecture_dates(markdown_file, output_file):
for table_entry in soup.findAll("tr")[1:]:
date, title, lecturers = [e.contents[0] for e in table_entry.findAll("td")]
if lecturers == "-":
if lecturers == "-" or table_entry.find(class_="inactive"):
# Table entries without lecturer are considered to be breaks/holidays.
continue
......@@ -52,7 +55,12 @@ def main():
prog="md2ical",
description="Convert a Markdown calendar table to an iCal calendar.",
)
parser.add_argument("-f", "--filename", default="index.qmd")
parser.add_argument(
"-f",
"--filename",
default=pathlib.Path(os.environ.get("QUARTO_PROJECT_OUTPUT_DIR", ""))
/ "index.html",
)
parser.add_argument(
"-o",
"--output",
......
/* css styles */
tr:has(.inactive) {
opacity: .5;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment