Coverage for src / rendercv / schema / models / settings / render_command.py: 100%
19 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-25 13:49 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-25 13:49 +0000
1import pathlib
3import pydantic
5from ..base import BaseModelWithoutExtraKeys
6from ..path import ExistingPathRelativeToInput, PlannedPathRelativeToInput
8file_path_placeholders_description = """The following placeholders can be used:
10- OUTPUT_FOLDER: The output folder path (e.g., rendercv_output)
11- MONTH_NAME: Full name of the month (e.g., January)
12- MONTH_ABBREVIATION: Abbreviation of the month (e.g., Jan)
13- MONTH: Month as a number (e.g., 1)
14- MONTH_IN_TWO_DIGITS: Month as a number in two digits (e.g., 01)
15- DAY: Day of the month (e.g., 5)
16- DAY_IN_TWO_DIGITS: Day of the month in two digits (e.g., 05)
17- YEAR: Year as a number (e.g., 2024)
18- YEAR_IN_TWO_DIGITS: Year as a number in two digits (e.g., 24)
19- NAME: The name of the CV owner (e.g., John Doe)
20- NAME_IN_SNAKE_CASE: The name of the CV owner in snake case (e.g., John_Doe)
21- NAME_IN_LOWER_SNAKE_CASE: The name of the CV owner in lower snake case (e.g., john_doe)
22- NAME_IN_UPPER_SNAKE_CASE: The name of the CV owner in upper snake case (e.g., JOHN_DOE)
23- NAME_IN_KEBAB_CASE: The name of the CV owner in kebab case (e.g., John-Doe)
24- NAME_IN_LOWER_KEBAB_CASE: The name of the CV owner in lower kebab case (e.g., john-doe)
25- NAME_IN_UPPER_KEBAB_CASE: The name of the CV owner in upper kebab case (e.g., JOHN-DOE)
26"""
29class RenderCommand(BaseModelWithoutExtraKeys):
30 output_folder: PlannedPathRelativeToInput = pydantic.Field(
31 default=pathlib.Path("rendercv_output"),
32 description=(
33 "Base output folder for all generated files. The default value is"
34 " `rendercv_output`. Referenced as `OUTPUT_FOLDER` in output path"
35 " defaults.\n\n"
36 ),
37 )
38 design: ExistingPathRelativeToInput | None = pydantic.Field(
39 default=None,
40 description="Path to a YAML file containing the `design` field.",
41 )
42 locale: ExistingPathRelativeToInput | None = pydantic.Field(
43 default=None,
44 description="Path to a YAML file containing the `locale` field.",
45 )
46 typst_path: PlannedPathRelativeToInput = pydantic.Field(
47 default=pathlib.Path("OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.typ"),
48 description=(
49 "Output path for the Typst file, relative to the input YAML file. The"
50 " default value is `OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.typ`.\n\n"
51 f"{file_path_placeholders_description}"
52 ),
53 )
54 pdf_path: PlannedPathRelativeToInput = pydantic.Field(
55 default=pathlib.Path("OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.pdf"),
56 description=(
57 "Output path for the PDF file, relative to the input YAML file. The default"
58 " value is `OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.pdf`.\n\n"
59 f"{file_path_placeholders_description}"
60 ),
61 )
62 markdown_path: PlannedPathRelativeToInput = pydantic.Field(
63 default=pathlib.Path("OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.md"),
64 title="Markdown Path",
65 description=(
66 "Output path for the Markdown file, relative to the input YAML file. The"
67 " default value is `OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.md`.\n\n"
68 f"{file_path_placeholders_description}"
69 ),
70 )
71 html_path: PlannedPathRelativeToInput = pydantic.Field(
72 default=pathlib.Path("OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.html"),
73 description=(
74 "Output path for the HTML file, relative to the input YAML file. The"
75 " default value is `OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.html`.\n\n"
76 f"{file_path_placeholders_description}"
77 ),
78 )
79 png_path: PlannedPathRelativeToInput = pydantic.Field(
80 default=pathlib.Path("OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.png"),
81 description=(
82 "Output path for PNG files, relative to the input YAML file. The default"
83 " value is `OUTPUT_FOLDER/NAME_IN_SNAKE_CASE_CV.png`.\n\n"
84 f"{file_path_placeholders_description}"
85 ),
86 )
87 dont_generate_markdown: bool = pydantic.Field(
88 default=False,
89 title="Don't Generate Markdown",
90 description=(
91 "Skip Markdown generation. This also disables HTML generation. The default"
92 " value is `false`."
93 ),
94 )
95 dont_generate_html: bool = pydantic.Field(
96 default=False,
97 title="Don't Generate HTML",
98 description="Skip HTML generation. The default value is `false`.",
99 )
100 dont_generate_typst: bool = pydantic.Field(
101 default=False,
102 title="Don't Generate Typst",
103 description=(
104 "Skip Typst generation. This also disables PDF and PNG generation. The"
105 " default value is `false`."
106 ),
107 )
108 dont_generate_pdf: bool = pydantic.Field(
109 default=False,
110 title="Don't Generate PDF",
111 description="Skip PDF generation. The default value is `false`.",
112 )
113 dont_generate_png: bool = pydantic.Field(
114 default=False,
115 title="Don't Generate PNG",
116 description="Skip PNG generation. The default value is `false`.",
117 )