diff --git a/scripts/config.py b/scripts/config.py index 950b694..c665b47 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -20,6 +20,7 @@ MAX_LEN = 40 LECTURE_START_MARKER = 'start lectures' LECTURE_END_MARKER = 'end lectures' DEFAULT_NEW_LECTURE_HEADER = r'\lecture[]{{{date}}}{{{title}}}' +DEFAULT_NEW_LECTURE_TITLE = 'Untitled' DEFAULT_LECTURE_SEARCH_REGEX = r'lecture.*({\d*})?{(.*?)}{(.*)}' DEFAULT_IMPORT_INDENTATION = 4 FALLBACK_COURSE_INFO_FILE = Path('fallback.yaml').resolve() diff --git a/scripts/lectures.py b/scripts/lectures.py index a64bc46..bfc7ba6 100644 --- a/scripts/lectures.py +++ b/scripts/lectures.py @@ -5,7 +5,8 @@ import re import warnings from datetime import datetime -from config import DATE_FORMAT, LOCALE, DEFAULT_NEW_LECTURE_HEADER, DEFAULT_LECTURE_SEARCH_REGEX +from config import DATE_FORMAT, LOCALE, DEFAULT_NEW_LECTURE_HEADER, DEFAULT_LECTURE_SEARCH_REGEX, \ + DEFAULT_NEW_LECTURE_TITLE from utils import get_week from edit import edit @@ -117,7 +118,8 @@ class Lectures(list): date = today.strftime(DATE_FORMAT) vimtex_root_str = f"%! TEX root = {str(os.path.relpath(self.notes.master_file, self.root))}\n" - header_str = DEFAULT_NEW_LECTURE_HEADER.format(number=new_lecture_number, date=date, title='Untitled') + header_str = DEFAULT_NEW_LECTURE_HEADER.format( + number=new_lecture_number, date=date, title=DEFAULT_NEW_LECTURE_TITLE) new_lecture_path.touch() new_lecture_path.write_text(vimtex_root_str + header_str)