From 02a0187b5b58fe1747969bd28e76475d35b01169 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 29 Aug 2023 14:22:57 +0200 Subject: adapt to new tex template --- scripts/gen_map/gen_map.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'scripts/gen_map/gen_map.py') diff --git a/scripts/gen_map/gen_map.py b/scripts/gen_map/gen_map.py index 9660565d..c3866ee0 100755 --- a/scripts/gen_map/gen_map.py +++ b/scripts/gen_map/gen_map.py @@ -32,7 +32,7 @@ ICAL_BASE_URL = 'https://www.schulferien.eu/downloads/ical4.php' TEMPLATE_DIR = Path( os.environ['HOME'] ) / 'Documents/MyDocuments/Work/Schule/Unterricht/templates' -TEMPLATE_FILE = 'map.md' +TEMPLATE_FILE = 'map.tex' LPP_BASE_URL = 'https://www.lehrplanplus.bayern.de/fachlehrplan/gymnasium' @@ -258,10 +258,9 @@ def gen_latex_table( week_iter = start + timedelta(days=1) while week_iter < end: if week_iter > next_holiday.start: - rows.append(( - f'\\rowcolor{{blue!30}}{week_iter.isocalendar().week} & ' - f' \\multicolumn{{2}}{{c}}{{{fmt_holiday(next_holiday)}}} \\\\' - )) + rows.append( + rf'\Holiday{{{week_iter.isocalendar().week}}}{{{fmt_holiday(next_holiday)}}} \\' + ) week_iter = next_holiday.end + timedelta(days=1) next_holiday = next(holiday_iter) continue @@ -283,10 +282,10 @@ def print_map(rows: list[str], template_path: Path, outfile): with open(template_path, 'r', encoding='utf-8') as template_file: template = template_file.readlines() - template_prefix = template[:-6] + template_prefix = template[:-8] template_suffix = template[-2:] - print(''.join(template_prefix), file=outfile) + print(''.join(template_prefix), file=outfile, end='') print('\n'.join(rows), file=outfile) print(''.join(template_suffix), file=outfile) -- cgit v1.2.3