metadata¶
academic_doc_generator.core.metadata
¶
Generation of web-compatible metadata files for student projects.
generate_metadata_file(output_folder, title, author, pages_text, llm_client, work_type, semester, date_str=None, copy_to_web_folder=True, students=None)
¶
Create a Jekyll-style Markdown file with frontmatter for a student project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_folder
|
str
|
Folder where the .md file will be saved. |
required |
title
|
str
|
Title of the work. |
required |
author
|
str
|
Full name of the student (or first student in group). |
required |
pages_text
|
dict[int, str]
|
Extracted text from the PDF. |
required |
llm_client
|
LLMClientProtocol
|
LLM client for summary generation. |
required |
work_type
|
str
|
String indicating the type of work. |
required |
semester
|
str
|
Semester name (e.g., "Wintersemester 24/25"). |
required |
date_str
|
Optional[str]
|
Date of the work (YYYY-MM-DD). Defaults to today. |
None
|
copy_to_web_folder
|
bool
|
Whether to copy the file to the global web metadata folder. |
True
|
students
|
Optional[list[StudentInfo]]
|
Optional list of student info for group projects. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Path to the generated .md file. |
Source code in src/academic_doc_generator/core/metadata.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
get_author_slug(name)
¶
Generate a short slug from the author's name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Full name of the person. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A 4-character lowercase slug. |
Source code in src/academic_doc_generator/core/metadata.py
get_initials(name)
¶
Generate initials for a name (e.g., 'Max Mustermann' -> 'M. M.').
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Full name of the person. |
required |
Returns:
| Type | Description |
|---|---|
str
|
String containing uppercase initials followed by dots. |
Source code in src/academic_doc_generator/core/metadata.py
summarize_for_web(pages_text, llm_client)
¶
Generate a concise, English summary suitable for publication on a website.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pages_text
|
dict[int, str]
|
Mapping of page indices to text content. |
required |
llm_client
|
LLMClientProtocol
|
LLM client for summary generation. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A short English summary string. |