call bp/dp definitions only where necessary
This commit is contained in:
@@ -4,21 +4,7 @@
|
||||
#import "thesis_base.typ": thesis_base
|
||||
|
||||
#let bp(args, content) = {
|
||||
let force_langs = ("cs", "en");
|
||||
|
||||
let title = req_arg(args, "title");
|
||||
let abstract_content = req_arg(args, "abstract.content");
|
||||
let keywords = req_arg(args, "abstract.keywords");
|
||||
let title_pages = get_arg(args, "title_pages");
|
||||
let language = req_arg(args, "document.language");
|
||||
|
||||
assert_dict_has(force_langs, title, "title");
|
||||
assert_dict_has(force_langs, abstract_content, "abstract");
|
||||
if not is_none(keywords) {
|
||||
assert_dict_has(force_langs, keywords, "keywords");
|
||||
}
|
||||
|
||||
if is_none(title_pages) {
|
||||
let programme = req_arg(args, "author.programme");
|
||||
assert_dict_has((language,), programme, "study programme");
|
||||
let specialization = req_arg(args, "author.specialization");
|
||||
@@ -26,14 +12,8 @@
|
||||
if language == "cs" {
|
||||
let _ = req_arg(args, "author.pronouns");
|
||||
}
|
||||
}
|
||||
|
||||
if is_none(title_pages) {
|
||||
mainpage(args);
|
||||
assignment(args);
|
||||
} else {
|
||||
external_title_pages(title_pages);
|
||||
}
|
||||
|
||||
thesis_base(args, content);
|
||||
}
|
||||
|
@@ -1,14 +1,15 @@
|
||||
// tools & utils
|
||||
#import "../theme.typ": faculty_logotype, tul_logomark, faculty_color
|
||||
#import "../lang.typ": lang_id, get_lang_item
|
||||
#import "../utils.typ": assert_in_dict, assert_in_arr, map_none, assert_dict_has
|
||||
#import "../arguments.typ": req_arg, map_arg
|
||||
#import "common.typ": default_styling
|
||||
#import "../utils.typ": assert_in_dict, assert_in_arr, map_none, assert_dict_has, is_none
|
||||
#import "../arguments.typ": req_arg, map_arg, get_arg
|
||||
#import "common.typ": default_styling, external_title_pages
|
||||
|
||||
// thesis types
|
||||
#import "bp.typ": bp
|
||||
#import "dp.typ": dp
|
||||
#import "other.typ": other
|
||||
#import "thesis_base.typ": thesis_base
|
||||
|
||||
#let template_classic(args, content) = {
|
||||
let language = req_arg(args, "document.language");
|
||||
@@ -33,5 +34,10 @@
|
||||
args.citations = map_arg(args, "citations", (v) => "../../" + v);
|
||||
args.title_pages = map_arg(args, "title_pages", (v) => "../../" + v);
|
||||
|
||||
if not is_none(get_arg(args, "title_pages")) and not req_arg(args, "document.type") == "other" {
|
||||
external_title_pages(req_arg(args, "title_pages"));
|
||||
thesis_base(args, content);
|
||||
} else {
|
||||
document_types.at(req_arg(args, "document.type"))(args, content);
|
||||
}
|
||||
}
|
||||
|
@@ -4,21 +4,7 @@
|
||||
#import "thesis_base.typ": thesis_base
|
||||
|
||||
#let dp(args, content) = {
|
||||
let force_langs = ("cs", "en");
|
||||
|
||||
let title = req_arg(args, "title");
|
||||
let abstract_content = req_arg(args, "abstract.content");
|
||||
let keywords = req_arg(args, "abstract.keywords");
|
||||
let title_pages = get_arg(args, "title_pages");
|
||||
let language = req_arg(args, "document.language");
|
||||
|
||||
assert_dict_has(force_langs, title, "title");
|
||||
assert_dict_has(force_langs, abstract_content, "abstract");
|
||||
if not is_none(keywords) {
|
||||
assert_dict_has(force_langs, keywords, "keywords");
|
||||
}
|
||||
|
||||
if is_none(title_pages) {
|
||||
let programme = req_arg(args, "author.programme");
|
||||
assert_dict_has((language,), programme, "study programme");
|
||||
map_arg(args, "author.specialization", (v) => {
|
||||
@@ -27,14 +13,8 @@
|
||||
if language == "cs" {
|
||||
let _ = req_arg(args, "author.pronouns");
|
||||
}
|
||||
}
|
||||
|
||||
if is_none(title_pages) {
|
||||
mainpage(args);
|
||||
assignment(args);
|
||||
} else {
|
||||
external_title_pages(title_pages);
|
||||
}
|
||||
|
||||
thesis_base(args, content);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#import "../theme.typ": faculty_color
|
||||
#import "../arguments.typ": get_arg, req_arg
|
||||
#import "../utils.typ": is_none
|
||||
#import "../utils.typ": is_none, assert_dict_has
|
||||
#import "common.typ": (
|
||||
default_styling,
|
||||
disclaimer,
|
||||
@@ -15,6 +15,11 @@
|
||||
#import "../attachments.typ": attachment_list
|
||||
|
||||
#let thesis_base(args, content) = {
|
||||
let force_langs = ("cs", "en");
|
||||
assert_dict_has(force_langs, req_arg(args, "title"), "title");
|
||||
assert_dict_has(force_langs, req_arg(args, "abstract.content"), "abstract");
|
||||
assert_dict_has(force_langs, req_arg(args, "abstract.keywords"), "keywords");
|
||||
|
||||
let language = req_arg(args, "document.language");
|
||||
default_styling(false, faculty_color(req_arg(args, "document.faculty")), {
|
||||
if is_none(get_arg(args, "title_pages")) {
|
||||
|
Reference in New Issue
Block a user