aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_map
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gen_map')
-rwxr-xr-xscripts/gen_map/gen_map.py13
1 files changed, 6 insertions, 7 deletions
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)