Skip to content

settings

Settings

Bases: BaseModelWithoutExtraKeys

bold_keywords = pydantic.Field(default=[], title='Bold Keywords', description='Keywords to automatically bold in the output.') class-attribute instance-attribute

current_date = pydantic.Field(default='today', title='Date', description='The date to use as "current date" for filenames, the "last updated" label, and time span calculations. Defaults to the actual current date.') class-attribute instance-attribute

model_config = pydantic.ConfigDict(extra='forbid', validate_default=True) class-attribute instance-attribute

pdf_title = pydantic.Field(default='NAME - CV', title='PDF Title', description="Title metadata for the PDF document. This appears in browser tabs and PDF readers. Available placeholders:\n- `NAME`: The CV owner's name from `cv.name`\n- `CURRENT_DATE`: Formatted date based on `design.templates.single_date`\n- `MONTH_NAME`: Full month name (e.g., January)\n- `MONTH_ABBREVIATION`: Abbreviated month name (e.g., Jan)\n- `MONTH`: Month number (e.g., 1)\n- `MONTH_IN_TWO_DIGITS`: Zero-padded month (e.g., 01)\n- `DAY`: Day of the month (e.g., 5)\n- `DAY_IN_TWO_DIGITS`: Zero-padded day (e.g., 05)\n- `YEAR`: Full year (e.g., 2025)\n- `YEAR_IN_TWO_DIGITS`: Two-digit year (e.g., 25)\n\nThe default value is `NAME - CV`.") class-attribute instance-attribute

render_command = pydantic.Field(default_factory=RenderCommand, title='Render Command Settings', description='Settings for the `render` command. These correspond to command-line arguments. CLI arguments take precedence over these settings.') class-attribute instance-attribute

keep_unique_keywords(value) classmethod

Remove duplicate keywords from bold list.

Why

Users might accidentally list same keyword multiple times. Deduplication prevents redundant bold highlighting operations during rendering.

Parameters:

  • value (list[str]) –

    List of keywords potentially with duplicates.

Returns:

  • list[str]

    List with unique keywords only.

Source code in src/rendercv/schema/models/settings/settings.py
@pydantic.field_validator("bold_keywords")
@classmethod
def keep_unique_keywords(cls, value: list[str]) -> list[str]:
    """Remove duplicate keywords from bold list.

    Why:
        Users might accidentally list same keyword multiple times. Deduplication
        prevents redundant bold highlighting operations during rendering.

    Args:
        value: List of keywords potentially with duplicates.

    Returns:
        List with unique keywords only.
    """
    return list(dict.fromkeys(value))

resolve_current_date()

Source code in src/rendercv/schema/models/settings/settings.py
@pydantic.model_validator(mode="after")
def resolve_current_date(self) -> "Settings":
    self._resolved_current_date = (
        datetime.date.today() if self.current_date == "today" else self.current_date
    )
    return self