From 441d363329301580401abba676b42a17e70a9007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler=20=28via=20gitlab=20runner=29?= Date: Wed, 27 Oct 2021 19:37:29 +0200 Subject: [PATCH] start working on initialization of courses --- scripts/fallback.yaml | 2 + scripts/init-all-courses.py | 77 +++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/scripts/fallback.yaml b/scripts/fallback.yaml index 483957a..26e5de1 100644 --- a/scripts/fallback.yaml +++ b/scripts/fallback.yaml @@ -1,6 +1,8 @@ title: 'Unnamed course' short: 'unnamed' language: 'english' +lecturer: '' +assistant: '' links: webpage: '' ecampus: '' diff --git a/scripts/init-all-courses.py b/scripts/init-all-courses.py index f7397fb..dd36ece 100644 --- a/scripts/init-all-courses.py +++ b/scripts/init-all-courses.py @@ -1,6 +1,83 @@ #!/bin/python3 from courses import Courses +MASTER_FILE_TEXT=[ + r'\documentclass[a4paper, {language}, fancyfoot, git]{{mkessler-script}}', + r'', + r'\course{{{course}}}', + r'\lecturer{{{lecturer}}}', + r'\assistant{{{assistant}}}', + r'\author{{{author}}}', + r'', + r'', + r'\usepackage{{{package_name}}}', + r'\restatesetup{{strict=false}}', + r'', + r'\begin{{document}}', + r' \maketitle', + r' \begin{{abstract}}', + r' {{\color{{red}} Caution: This version is only intended for editing. Some parts are missing, todo notes are compiled. For the correct version of the notes, please see the full version on\href{{{github}}}{{GitHub}}}}.', + r' \end{{abstract}}', + r' \newpage', + r' \listoftodos', + r' \newpage', + r' \summaryoflectures', + r' \newpage', + r' % start lectures', + r' % end lectures', + r'\end{{document}}' +] + +FULL_FILE_TEXT= [ + r'\documentclass[a4paper, {language}, fancyfoot, git, dvipsnames]{{mkessler-script}}', + r'', + r'\course{{{course}}}', + r'\lecturer{{{lecturer}}}', + r'\assistant{{{assistant}}}', + r'\author{{{author}}}', + r'', + r'\usepackage{{{package_name}}}', + r'\setuptodonotes{{disable}}', + r'\restatesetup{{strict=true}}', + r'', + r'\import{inputs/exercises/}{preamble_exercise_sheets.tex}', + r'', + r'\begin{document}', + r' \maketitle', + r'', + r' \import{inputs/}{abstract.tex}', + r'', + r' %Table of contents', + r' \cleardoublepage', + r' \tableofcontents', + r'', + r' %List of lectures with their corresponding keywords', + r' \cleardoublepage', + r' \summaryoflectures', + r'', + r' \cleardoublepage', + r' % start lectures', + r' % end lectures', + r'', + r' %Start appendix', + r' \cleardoublepage', + r' \appendix', + r' \part{Appendix}', + r'', + r' %Index', + r' \cleardoublepage', + r' \printvocabindex', + r'', + r' %Image attributions', + r' %\cleardoublepage', + r' %\printimageattributions', + r'', + r' %Literature', + r' %\cleardoublepage', + r' %\printliterature', + r'\end{document}' +] + for course in Courses(): lectures = course.lectures course_title = lectures.course.info["title"]