Coverage for rendercv/themes/moderncv/__init__.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-10-07 17:51 +0000

1from typing import Literal 

2 

3import pydantic 

4 

5from rendercv.data.models.base import RenderCVBaseModelWithoutExtraKeys 

6from rendercv.themes.common_options import LaTeXDimension 

7 

8 

9class ModerncvThemeOptions(RenderCVBaseModelWithoutExtraKeys): 

10 """This class is the data model of the theme options for the `moderncv` theme.""" 

11 

12 model_config = pydantic.ConfigDict(extra="forbid") 

13 

14 theme: Literal["moderncv"] 

15 font_size: Literal["10pt", "11pt", "12pt"] = pydantic.Field( 

16 default="10pt", 

17 title="Font Size", 

18 description='The font size of the CV. The default value is "10pt".', 

19 examples=["10pt", "11pt", "12pt"], 

20 ) 

21 page_size: Literal["a4paper", "letterpaper"] = pydantic.Field( 

22 default="letterpaper", 

23 title="Page Size", 

24 description='The page size of the CV. The default value is "letterpaper".', 

25 examples=["a4paper", "letterpaper"], 

26 ) 

27 color: ( 

28 Literal["blue"] 

29 | Literal["black"] 

30 | Literal["burgundy"] 

31 | Literal["green"] 

32 | Literal["grey"] 

33 | Literal["orange"] 

34 | Literal["purple"] 

35 | Literal["red"] 

36 ) = pydantic.Field( 

37 default="blue", 

38 validate_default=True, 

39 title="Primary Color", 

40 description='The primary color of the CV. The default value is "blue".', 

41 examples=[ 

42 "blue", 

43 "black", 

44 "burgundy", 

45 "green", 

46 "grey", 

47 "orange", 

48 "purple", 

49 "red", 

50 ], 

51 ) 

52 date_width: LaTeXDimension = pydantic.Field( 

53 default="3.8 cm", 

54 validate_default=True, 

55 title="Date and Location Column Width", 

56 description='The width of the date column. The default value is "3.8 cm".', 

57 ) 

58 content_scale: float = pydantic.Field( 

59 default=0.75, 

60 title="Content Scale", 

61 description=( 

62 "The scale of the content with respect to the page size. The default value" 

63 ' is "0.75".' 

64 ), 

65 ) 

66 show_only_years: bool = pydantic.Field( 

67 default=False, 

68 title="Show Only Years", 

69 description=( 

70 'If "True", only the years will be shown in the date column. The default' 

71 ' value is "False".' 

72 ), 

73 ) 

74 disable_page_numbers: bool = pydantic.Field( 

75 default=False, 

76 title="Disable Page Numbers", 

77 description=( 

78 'If "True", the page numbers will be disabled. The default value is' 

79 ' "False".' 

80 ), 

81 )