Compare commits
5 Commits
527534f885
...
v0.7
Author | SHA1 | Date | |
---|---|---|---|
3f53ed89ba
|
|||
da11cd88fa
|
|||
d915b8cf27
|
|||
afc1ee372f
|
|||
d478d63812
|
8
Makefile
8
Makefile
@@ -33,6 +33,14 @@ pack/tultemplate2/template/LICENSE: LICENSE
|
||||
@mkdir -p $(@D)
|
||||
ln -f $< $@
|
||||
|
||||
pack/tultemplate2/template/tul_citace.csl: template/tul_citace.csl
|
||||
@mkdir -p $(@D)
|
||||
cat $< | sed 's/^\s*\(.*\)$$/\1/' | tr -d '\n' > $@
|
||||
|
||||
pack/tultemplate2/template/lang.json: template/lang.json
|
||||
@mkdir -p $(@D)
|
||||
cat $< | jq -c > $@
|
||||
|
||||
pack/tultemplate2/template/%: template/%
|
||||
@mkdir -p $(@D)
|
||||
ln -f $< $@
|
||||
|
@@ -331,7 +331,7 @@ Zvýrazněné hodnoty jsou základní -- pokud vynecháte parametr, pak bude pou
|
||||
- `author` (autor/autoři dokumentu)
|
||||
- Příklad: `"Pavel Novák"` nebo `"Petra Velká, Jindřich Peterka"`
|
||||
#line()
|
||||
- `author_gender` (jazykový rod autora - není potřeba pro angličtinu, která má základní hodnotu)
|
||||
- `author_pronouns` (jazykový rod autora - není potřeba pro angličtinu, která má základní hodnotu)
|
||||
- Pro vybraný jazyk _cs_:
|
||||
- `"masculine"` - Mužský rod
|
||||
- `"feminine"` - Ženský rod
|
||||
|
@@ -5,6 +5,7 @@
|
||||
assignment,
|
||||
disclaimer,
|
||||
abstract,
|
||||
acknowledgement,
|
||||
toc,
|
||||
abbrlist,
|
||||
imagelist,
|
||||
@@ -19,8 +20,8 @@
|
||||
faculty_id, faculty_color, language, assignment_document, citation_file,
|
||||
|
||||
// document info
|
||||
title, author, author_gender, supervisor, consultant, study_programme, study_branch,
|
||||
abstract_content, keywords,
|
||||
title, author, author_pronouns, supervisor, consultant, study_programme, study_branch,
|
||||
year_of_study, abstract_content, acknowledgement_content, keywords,
|
||||
|
||||
content
|
||||
) = {
|
||||
@@ -38,8 +39,9 @@
|
||||
if not is_none(keywords) {
|
||||
assert_dict_has(force_langs, keywords, "keywords");
|
||||
}
|
||||
assert_not_none(acknowledgement_content, "acknowledgement content");
|
||||
if language == "cs" {
|
||||
assert_not_none(author_gender, "author gender");
|
||||
assert_not_none(author_pronouns, "author gender");
|
||||
}
|
||||
|
||||
assert_type_signature(supervisor, "string | none", "supervisor");
|
||||
@@ -47,13 +49,14 @@
|
||||
|
||||
mainpage(
|
||||
faculty_id, language, "bp", title, author, supervisor, consultant, study_programme,
|
||||
study_branch,
|
||||
study_branch, year_of_study,
|
||||
);
|
||||
assignment(language, assignment_document);
|
||||
default_styling(false, faculty_color, {
|
||||
disclaimer(language, faculty_id, "bp", author, author_gender);
|
||||
disclaimer(language, faculty_id, "bp", author, author_pronouns);
|
||||
abstract("cs", title, abstract_content, keywords);
|
||||
abstract("en", title, abstract_content, keywords);
|
||||
acknowledgement(language, author, acknowledgement_content);
|
||||
toc(language);
|
||||
tablelist(language);
|
||||
imagelist(language);
|
||||
|
@@ -12,8 +12,8 @@
|
||||
language, faculty_id, document_type, citation_file, assignment_document,
|
||||
|
||||
// document info
|
||||
title, author, author_gender, supervisor, consultant, study_programme, study_branch, abstract,
|
||||
keywords,
|
||||
title, author, author_pronouns, supervisor, consultant, study_programme, study_branch,
|
||||
year_of_study, abstract, acknowledgement, keywords,
|
||||
|
||||
// content
|
||||
content,
|
||||
@@ -27,7 +27,7 @@
|
||||
map_none(title, (v) => assert_dict_has((language,), v, "title"));
|
||||
map_none(study_programme, (v) => assert_dict_has((language,), v, "study programme"));
|
||||
map_none(study_branch, (v) => assert_dict_has((language,), v, "study branch"));
|
||||
|
||||
map_none(acknowledgement, (v) => assert_dict_has((language,), v, "acknowledgement content"));
|
||||
|
||||
document_types.at(document_type)(
|
||||
faculty_id,
|
||||
@@ -37,12 +37,14 @@
|
||||
map_none(citation_file, (v) => "../../" + v),
|
||||
title,
|
||||
author,
|
||||
author_gender,
|
||||
author_pronouns,
|
||||
supervisor,
|
||||
consultant,
|
||||
study_programme,
|
||||
study_branch,
|
||||
year_of_study,
|
||||
abstract,
|
||||
acknowledgement,
|
||||
keywords,
|
||||
content,
|
||||
);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#import "../theme.typ": faculty_logotype, tul_logomark, faculty_color
|
||||
#import "../lang.typ": get_lang_item
|
||||
#import "../utils.typ": is_none, assert_dict_has
|
||||
#import "../utils.typ": is_none, assert_dict_has, map_none
|
||||
|
||||
#let base_font = "Inter";
|
||||
#let mono_font = "Noto Sans Mono";
|
||||
@@ -119,7 +119,7 @@
|
||||
faculty_id,
|
||||
language,
|
||||
document_type,
|
||||
title, author, supervisor, consultant, study_programme, study_branch,
|
||||
title, author, supervisor, consultant, study_programme, study_branch, year_of_study,
|
||||
) = {
|
||||
let info_name_value_padding = 5em;
|
||||
let info_name_min_width = 10em;
|
||||
@@ -141,11 +141,12 @@
|
||||
// other info
|
||||
// [field_name, field_value, bold]
|
||||
let info_fields = (
|
||||
("study_programme", study_programme, false),
|
||||
("study_branch", study_branch, false),
|
||||
("author", author, true),
|
||||
("supervisor", person_info(supervisor, "supervisor"), false),
|
||||
("consultant", person_info(consultant, "consultant"), false),
|
||||
("study_programme", study_programme, false),
|
||||
("study_branch", study_branch, false),
|
||||
("year_of_study", map_none(year_of_study, (v) => str(v) + "."), false),
|
||||
)
|
||||
context {
|
||||
let max_field_name_width = calc.max(..info_fields.map((v) => {
|
||||
@@ -180,7 +181,7 @@
|
||||
faculty_id,
|
||||
language,
|
||||
document_type,
|
||||
title, author, supervisor, consultant, study_programme, study_branch
|
||||
title, author, supervisor, consultant, study_programme, study_branch, year_of_study,
|
||||
) = {
|
||||
import "../utils.typ": has_all_none, map_none
|
||||
let nonetype = type(none);
|
||||
@@ -195,7 +196,7 @@
|
||||
info(
|
||||
faculty_id, language, document_type, map_none(title, (v) => v.at(language)),
|
||||
author, supervisor, consultant, map_none(study_programme, (v) => v.at(language)),
|
||||
map_none(study_branch, (v) => v.at(language)),
|
||||
map_none(study_branch, (v) => v.at(language)), year_of_study,
|
||||
);
|
||||
v(5em);
|
||||
}, bottom);
|
||||
@@ -227,11 +228,11 @@
|
||||
|
||||
// DISCLAIMER PAGE
|
||||
|
||||
#let disclaimer(language, faculty_id, disclaimer_type, author, author_gender) = {
|
||||
#let disclaimer(language, faculty_id, disclaimer_type, author, author_pronouns) = {
|
||||
import "../lang.typ": disclaimer
|
||||
heading(get_lang_item(language, "disclaimer"), numbering: none, outlined: false);
|
||||
par(
|
||||
text(disclaimer(language, disclaimer_type, author_gender))
|
||||
text(disclaimer(language, disclaimer_type, author_pronouns))
|
||||
);
|
||||
v(5em);
|
||||
grid(
|
||||
@@ -244,6 +245,18 @@
|
||||
);
|
||||
}
|
||||
|
||||
// ACKNOWLEDGEMENT PAGE
|
||||
|
||||
#let acknowledgement(language, author, content) = {
|
||||
if is_none(content) {
|
||||
return;
|
||||
}
|
||||
heading(get_lang_item(language, "acknowledgement"), numbering: none, outlined: false);
|
||||
par(content.at(language));
|
||||
v(2em);
|
||||
align(right, author);
|
||||
}
|
||||
|
||||
// ABSTRACT
|
||||
|
||||
#let abstract(language, title, content, keywords) = {
|
||||
|
@@ -18,14 +18,18 @@
|
||||
faculty_id, faculty_color, language, assignment_document, citation_file,
|
||||
|
||||
// document info
|
||||
title, author, _, supervisor, consultant, study_programme, study_branch, abstract_content, keywords,
|
||||
title, author, _, supervisor, consultant, study_programme, study_branch, year_of_study,
|
||||
abstract_content, _, keywords,
|
||||
|
||||
content
|
||||
) = {
|
||||
assert_not_none(title, "title");
|
||||
assert_dict_has((language,), title, "title");
|
||||
|
||||
mainpage(faculty_id, language, none, title, author, supervisor, consultant, study_programme, study_branch);
|
||||
mainpage(
|
||||
faculty_id, language, none, title, author, supervisor, consultant, study_programme,
|
||||
study_branch, year_of_study,
|
||||
);
|
||||
default_styling(true, faculty_color, {
|
||||
toc(language);
|
||||
tablelist(language);
|
||||
|
@@ -6,6 +6,7 @@
|
||||
"consultant": "Konzultant práce",
|
||||
"study_programme": "Studijní program",
|
||||
"study_branch": "Studijní obor",
|
||||
"year_of_study": "Ročník",
|
||||
|
||||
"bp": "Bakalářská práce",
|
||||
|
||||
@@ -36,6 +37,7 @@
|
||||
"date": "[day]. [month]. [year]",
|
||||
|
||||
"abstract": "Abstrakt",
|
||||
"acknowledgement": "Poděkování",
|
||||
"keywords": "Klíčová slova",
|
||||
"abbrs": "Seznam zkratek",
|
||||
"image_list": "Seznam obrázků",
|
||||
@@ -55,6 +57,7 @@
|
||||
"consultant": "Consultant",
|
||||
"study_programme": "Study programme",
|
||||
"study_branch": "Study branch",
|
||||
"year_of_study": "Year of study",
|
||||
|
||||
"bp": "Bachelor thesis",
|
||||
|
||||
@@ -74,6 +77,7 @@
|
||||
"date": "[year]-[month]-[day]",
|
||||
|
||||
"abstract": "Abstract",
|
||||
"acknowledgement": "Acknowledgement",
|
||||
"keywords": "Keywords",
|
||||
"abbrs": "List of abbreviations",
|
||||
"image_list": "List of images",
|
||||
|
@@ -45,13 +45,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
#let disclaimer(language, document_type, author_gender) = {
|
||||
#let disclaimer(language, document_type, author_pronouns) = {
|
||||
let disclaimer = get_lang_item(language, "disclaimer_content");
|
||||
let replacements = get_lang_item(language, "disclaimer_replace").at(document_type);
|
||||
if language == "cs" {
|
||||
disclaimer = replace_czech_gender(disclaimer, author_gender);
|
||||
disclaimer = replace_czech_gender(disclaimer, author_pronouns);
|
||||
} else if language == "en" {
|
||||
disclaimer = replace_english_pronounce(disclaimer, author_gender);
|
||||
disclaimer = replace_english_pronounce(disclaimer, author_pronouns);
|
||||
}
|
||||
for (key, value) in replacements.pairs() {
|
||||
disclaimer = disclaimer.replace("{" + key + "}", value);
|
||||
|
@@ -28,7 +28,7 @@
|
||||
// - document (str): Type of document. This can be "bp" or "other".
|
||||
// - title (dictionary): The title of the document.
|
||||
// - author (str): The name of the document's author.
|
||||
// - author_gender (str): The gender of the document's author. Needed only for the `cs` language.
|
||||
// - author_pronouns (str): The gender of the document's author. Needed only for the `cs` language.
|
||||
// - supervisor (str): The name of the document's supervisor.
|
||||
// - consultant (str): The name of the document's consultant.
|
||||
// - programme (dictionary): Study programme.
|
||||
@@ -45,8 +45,9 @@
|
||||
style: "classic", faculty: "tul", lang: "cs", document: "other",
|
||||
|
||||
// document info
|
||||
title: none, keywords: none, abstract: none, author: none, author_gender: none,
|
||||
supervisor: none, consultant: none, programme: none, branch: none,
|
||||
title: none, keywords: none, abstract: none, acknowledgement: none, author: none,
|
||||
author_pronouns: none, supervisor: none, consultant: none, programme: none,
|
||||
branch: none, year_of_study: none,
|
||||
|
||||
// links
|
||||
assignment: none, citations: "citations.bib",
|
||||
@@ -66,8 +67,11 @@
|
||||
assert_type_signature(
|
||||
abstract, "dictionary[string : string | content] | none", "abstract argument"
|
||||
);
|
||||
assert_type_signature(
|
||||
acknowledgement, "dictionary[string : string] | none", "acknowledgement content"
|
||||
);
|
||||
assert_type_signature(author, "string | none", "author argument");
|
||||
assert_type_signature(author_gender, "string | none", "author gender argument");
|
||||
assert_type_signature(author_pronouns, "string | none", "author gender argument");
|
||||
assert_type_signature(
|
||||
supervisor, "string | dictionary[string : string] | none", "supervisor argument"
|
||||
);
|
||||
@@ -78,6 +82,7 @@
|
||||
programme, "dictionary[string : string] | none", "study programme argument"
|
||||
);
|
||||
assert_type_signature(branch, "dictionary[string : string] | none", "study branch argument");
|
||||
assert_type_signature(year_of_study, "integer | none", "year of study");
|
||||
assert_type_signature(assignment, "string | none", "assignment document argument");
|
||||
assert_type_signature(citations, "string", "citations file argument");
|
||||
|
||||
@@ -96,8 +101,8 @@
|
||||
// template call
|
||||
templates.at(style)(
|
||||
lang, faculty, document, citations, assignment,
|
||||
title, author, author_gender, supervisor, consultant,
|
||||
programme, branch, abstract, keywords, content
|
||||
title, author, author_pronouns, supervisor, consultant,
|
||||
programme, branch, year_of_study, abstract, acknowledgement, keywords, content
|
||||
);
|
||||
|
||||
import "prototyping.typ": assert_release_ready
|
||||
|
Reference in New Issue
Block a user