diff --git a/setup.py b/setup.py index 650818d73461fb323ca1c786f0451a98a4172070..3679b0e8100a823022f03b2d1befe9b489a8e545 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ with open("README.md", "r", encoding="utf-8") as fh: # beamer-slider setuptools.setup( name="coursebox", - version="0.1.15", + version="0.1.16", author="Tue Herlau", author_email="tuhe@dtu.dk", description="A course management system currently used at DTU", diff --git a/src/coursebox.egg-info/PKG-INFO b/src/coursebox.egg-info/PKG-INFO index 12bfe3cf35a4aefa54a91a70f5afeddd9fdd9af4..5da7428848dbcd686fa05e1790b54364fcbc76ae 100644 --- a/src/coursebox.egg-info/PKG-INFO +++ b/src/coursebox.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: coursebox -Version: 0.1.15 +Version: 0.1.16 Summary: A course management system currently used at DTU Home-page: https://lab.compute.dtu.dk/tuhe/coursebox Author: Tue Herlau diff --git a/src/coursebox/core/info.py b/src/coursebox/core/info.py index ae7d4b3960ee9365e34fe585e10a7661d8a39657..6ef112efd48278ae6205fafaf5cfbaa110b081d2 100644 --- a/src/coursebox/core/info.py +++ b/src/coursebox/core/info.py @@ -378,6 +378,12 @@ def class_information(): ri['latex_long'] = f"{nd.strftime('%A')} {nd.day}{ab} {nd.strftime('%B')}, {nd.year}" ri['latex_short'] = f"{nd.strftime('%B')} {nd.day}{ab}, {nd.year}" d['reports_info'][k] = ri + + + ppi = core_conf.get('post_process_info', None) + if ppi is not None: + d = ppi(paths, d) + return d def fix_instructor_comma(dd, instructors): diff --git a/src/coursebox/material/homepage_lectures_exercises.py b/src/coursebox/material/homepage_lectures_exercises.py index 3eeeeeb2e202c54f1f42f1e28387072f9a33fff5..75da37ead41636c11c0b217ef5342685bffc5c01 100644 --- a/src/coursebox/material/homepage_lectures_exercises.py +++ b/src/coursebox/material/homepage_lectures_exercises.py @@ -306,7 +306,7 @@ def fix_shared(paths, output_dir, pdf2png=False,dosvg=True,verbose=False, compil # Perform sync here. for rel in source: - if rel.endswith("_partial.tex"): + if "_partial." in rel: continue if rel not in target or target[rel]['hash'] != source[rel]['hash']: @@ -335,11 +335,13 @@ def fix_shared(paths, output_dir, pdf2png=False,dosvg=True,verbose=False, compil def jinjafy_shared_templates_dir(paths, info): tpd = paths['shared'] + "/templates" - for f in glob.glob(tpd + "/*.tex"): - print(f) - ex = "_partial.tex" - if f.endswith(ex): - jinjafy_template(info, file_in=f, file_out=f"{tpd}/{os.path.basename(f)[:-len(ex)]}.tex") + for f in glob.glob(tpd + "/*.*"): + # ex = "_partial." + if "_partial." in f: + ff = os.path.basename(f) + ff = ff[:ff.rfind("_partial.")] + + jinjafy_template(info, file_in=f, file_out=f"{tpd}/{ff}.{f.split('.')[-1]}") def get_filters(): diff --git a/src/coursebox/setup_coursebox.py b/src/coursebox/setup_coursebox.py index aca83073c8395fc11ffc06fe6bd221d1b08f60ea..f3d790743e3213e777cd52a7ec9d925a1a74e7d7 100644 --- a/src/coursebox/setup_coursebox.py +++ b/src/coursebox/setup_coursebox.py @@ -5,7 +5,7 @@ def setup_coursebox(working_dir, course_number="02450", semester='spring', year= slides_includelabels=False, continuing_education_mode = False, slides_shownotes=False, - continuing_education_month = "March", **kwargs): + continuing_education_month = "March", post_process_info=None, **kwargs): info_paths.core_conf['working_dir'] = working_dir info_paths.core_conf['course_number'] = course_number @@ -16,5 +16,7 @@ def setup_coursebox(working_dir, course_number="02450", semester='spring', year= info_paths.core_conf['continuing_education_mode'] = continuing_education_mode info_paths.core_conf['continuing_education_month'] = continuing_education_month info_paths.core_conf['slides_shownotes'] = slides_shownotes + info_paths.core_conf['post_process_info'] = post_process_info + for a, val in kwargs.items(): info_paths.core_conf[a] = val