From 54a39e59a36d4dfc4e43619654eb9c4102eba53c Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Thu, 15 Feb 2024 19:46:10 +0100 Subject: [PATCH] add common theme options to themes/__init__.py --- rendercv/themes/__init__.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/rendercv/themes/__init__.py b/rendercv/themes/__init__.py index e69de29..c29f97f 100644 --- a/rendercv/themes/__init__.py +++ b/rendercv/themes/__init__.py @@ -0,0 +1,33 @@ +from typing import Annotated + +import pydantic + +LaTeXDimension = Annotated[ + str, + pydantic.Field( + pattern=r"\d+\.?\d* *(cm|in|pt|mm|ex|em)", + ), +] + + +class PageMargins(pydantic.BaseModel): + top: LaTeXDimension = pydantic.Field( + default="2 cm", + title="Top Margin", + description="The top margin of the page with units.", + ) + bottom: LaTeXDimension = pydantic.Field( + default="2 cm", + title="Bottom Margin", + description="The bottom margin of the page with units.", + ) + left: LaTeXDimension = pydantic.Field( + default="1.24 cm", + title="Left Margin", + description="The left margin of the page with units.", + ) + right: LaTeXDimension = pydantic.Field( + default="1.24 cm", + title="Right Margin", + description="The right margin of the page with units.", + )