diff --git a/scripts/config.py b/scripts/config.py index c152848..9ef3ea8 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -20,3 +20,4 @@ LOCALE = "de_DE.utf8" COURSE_IGNORE_FILE = '.courseignore' COURSE_INFO_FILE = 'info.yaml' DEFAULT_MASTER_FILE_NAME = 'master.tex' +MAX_LEN = 40 diff --git a/scripts/utils.py b/scripts/utils.py index ac06a70..428a227 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -1,14 +1,17 @@ +from config import MAX_LEN + + def beautify(string): return string.replace('_', ' ').replace('-', ' ').title() + def unbeautify(string): return string.replace(' ', '-').lower() -MAX_LEN = 40 + def generate_short_title(title): short_title = title or 'Untitled' if len(title) >= MAX_LEN: short_title = title[:MAX_LEN - len(' ... ')] + ' ... ' short_title = short_title.replace('$', '') return short_title -