add text_alignment option to sb2nov

This commit is contained in:
Sina Atalay 2024-02-17 19:09:37 +01:00
parent 433f37fa8e
commit 250471b62d
4 changed files with 29 additions and 18 deletions

View File

@ -212,6 +212,11 @@ class ThemeOptions(pydantic.BaseModel):
" 30 pt." " 30 pt."
), ),
) )
text_alignment: Literal["left-aligned", "justified"] = pydantic.Field(
default="justified",
title="Text Alignment",
description="The alignment of the text. The default value is justified.",
)
margins: Margins = pydantic.Field( margins: Margins = pydantic.Field(
default=Margins(), default=Margins(),
title="Margins", title="Margins",

View File

@ -9,12 +9,6 @@ class ClassicThemeOptions(ThemeOptions):
""" """ """ """
theme: Literal["classic"] theme: Literal["classic"]
text_alignment: Literal["left-aligned", "justified"] = pydantic.Field(
default="justified",
title="Text Alignment",
description="The alignment of the text. The default value is justified.",
)
show_timespan_in: list[str] = pydantic.Field( show_timespan_in: list[str] = pydantic.Field(
default=[], default=[],
title="Show Time Span in These Sections", title="Show Time Span in These Sections",

View File

@ -57,7 +57,9 @@
\setlength{\topskip}{0pt} % no top skip \setlength{\topskip}{0pt} % no top skip
% \raggedbottom % \raggedbottom
% \raggedright ((* if design.text_alignment == "left-aligned"*))
\raggedright
((* endif *))
\setlength{\tabcolsep}{0in} \setlength{\tabcolsep}{0in}
% Sections formatting % Sections formatting

View File

@ -63,6 +63,16 @@
"title": "Header Font Size", "title": "Header Font Size",
"type": "string" "type": "string"
}, },
"text_alignment": {
"default": "justified",
"description": "The alignment of the text. The default value is justified.",
"enum": [
"left-aligned",
"justified"
],
"title": "Text Alignment",
"type": "string"
},
"margins": { "margins": {
"allOf": [ "allOf": [
{ {
@ -103,16 +113,6 @@
"const": "classic", "const": "classic",
"title": "Theme" "title": "Theme"
}, },
"text_alignment": {
"default": "justified",
"description": "The alignment of the text. The default value is justified.",
"enum": [
"left-aligned",
"justified"
],
"title": "Text Alignment",
"type": "string"
},
"show_timespan_in": { "show_timespan_in": {
"default": [], "default": [],
"description": "The time span will be shown in the date and location column in these sections. The input should be a list of section titles as strings (case-sensitive).", "description": "The time span will be shown in the date and location column in these sections. The input should be a list of section titles as strings (case-sensitive).",
@ -1056,6 +1056,16 @@
"title": "Header Font Size", "title": "Header Font Size",
"type": "string" "type": "string"
}, },
"text_alignment": {
"default": "justified",
"description": "The alignment of the text. The default value is justified.",
"enum": [
"left-aligned",
"justified"
],
"title": "Text Alignment",
"type": "string"
},
"margins": { "margins": {
"allOf": [ "allOf": [
{ {
@ -1176,6 +1186,7 @@
"page_numbering_style": "NAME -- Page PAGE_NUMBER of TOTAL_PAGES", "page_numbering_style": "NAME -- Page PAGE_NUMBER of TOTAL_PAGES",
"show_last_updated_date": true, "show_last_updated_date": true,
"header_font_size": "30 pt", "header_font_size": "30 pt",
"text_alignment": "justified",
"margins": { "margins": {
"entry_area": { "entry_area": {
"date_and_location_width": "4.1 cm", "date_and_location_width": "4.1 cm",
@ -1204,7 +1215,6 @@
} }
}, },
"theme": "classic", "theme": "classic",
"text_alignment": "justified",
"show_timespan_in": [] "show_timespan_in": []
}, },
"description": "The design information of the CV.", "description": "The design information of the CV.",