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

30 statements  

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

1from typing import Literal 

2 

3import pydantic 

4import pydantic_extra_types.color as pydantic_color 

5 

6from rendercv.themes.common_options import ( 

7 EntryAreaMargins, 

8 HeaderMargins, 

9 HighlightsAreaMargins, 

10 LaTeXDimension, 

11 Margins, 

12 ThemeOptions, 

13) 

14 

15 

16class EntryAreaMarginsForEngineeringresumes(EntryAreaMargins): 

17 """This class is a data model for the entry area margins.""" 

18 

19 left_and_right: LaTeXDimension = pydantic.Field( 

20 default="0 cm", 

21 title="Left Margin", 

22 description="The left margin of entry areas. The default value is 0 cm.", 

23 ) 

24 

25 

26class HighlightsAreaMarginsForEngineeringresumes(HighlightsAreaMargins): 

27 """This class is a data model for the highlights area margins.""" 

28 

29 top: LaTeXDimension = pydantic.Field( 

30 default="0.10 cm", 

31 title="Top Margin", 

32 description="The top margin of highlights areas. The default value is 0.10 cm.", 

33 ) 

34 left: LaTeXDimension = pydantic.Field( 

35 default="0 cm", 

36 title="Left Margin", 

37 description="The left margin of highlights areas. The default value is 0 cm.", 

38 ) 

39 vertical_between_bullet_points: LaTeXDimension = pydantic.Field( 

40 default="0.10 cm", 

41 title="Vertical Margin Between Bullet Points", 

42 description=( 

43 "The vertical margin between bullet points. The default value is 0.10 cm." 

44 ), 

45 ) 

46 

47 

48class HeaderMarginsForEngineeringresumes(HeaderMargins): 

49 """This class is a data model for the header margins.""" 

50 

51 vertical_between_name_and_connections: LaTeXDimension = pydantic.Field( 

52 default="5 pt", 

53 title="Vertical Margin Between the Name and Connections", 

54 description=( 

55 "The vertical margin between the name of the person and the connections." 

56 " The default value is 5 pt." 

57 ), 

58 ) 

59 bottom: LaTeXDimension = pydantic.Field( 

60 default="5 pt", 

61 title="Bottom Margin", 

62 description=( 

63 "The bottom margin of the header, i.e., the vertical margin between the" 

64 " connections and the first section title. The default value is 5 pt." 

65 ), 

66 ) 

67 horizontal_between_connections: LaTeXDimension = pydantic.Field( 

68 default="10 pt", 

69 title="Space Between Connections", 

70 description=( 

71 "The space between the connections (like phone, email, and website). The" 

72 " default value is 20 pt." 

73 ), 

74 ) 

75 

76 

77class MarginsForEngineeringresumes(Margins): 

78 """This class is a data model for the margins.""" 

79 

80 entry_area: EntryAreaMarginsForEngineeringresumes = pydantic.Field( 

81 default=EntryAreaMarginsForEngineeringresumes(), 

82 title="Entry Area Margins", 

83 description="Entry area margins.", 

84 ) 

85 highlights_area: HighlightsAreaMarginsForEngineeringresumes = pydantic.Field( 

86 default=HighlightsAreaMarginsForEngineeringresumes(), 

87 title="Highlights Area Margins", 

88 description="Highlights area margins.", 

89 ) 

90 header: HeaderMarginsForEngineeringresumes = pydantic.Field( 

91 default=HeaderMarginsForEngineeringresumes(), 

92 title="Header Margins", 

93 description="Header margins.", 

94 ) 

95 

96 

97class EngineeringresumesThemeOptions(ThemeOptions): 

98 """This class is the data model of the theme options for the `engineeringresumes` 

99 theme. 

100 """ 

101 

102 theme: Literal["engineeringresumes"] 

103 font: Literal[ 

104 "Latin Modern Serif", 

105 "Latin Modern Sans Serif", 

106 "Latin Modern Mono", 

107 "Source Sans 3", 

108 "Charter", 

109 ] = pydantic.Field( 

110 default="Charter", 

111 title="Font", 

112 description="The font family of the CV. The default value is Charter.", 

113 ) 

114 header_font_size: LaTeXDimension = pydantic.Field( 

115 default="25 pt", 

116 title="Header Font Size", 

117 description=( 

118 "The font size of the header (the name of the person). The default value is" 

119 " 25 pt." 

120 ), 

121 ) 

122 color: pydantic_color.Color = pydantic.Field( 

123 default="rgb(0,0,0)", 

124 validate_default=True, 

125 title="Primary Color", 

126 description=( 

127 "The primary color of the theme. \nThe color can be specified either with" 

128 " their [name](https://www.w3.org/TR/SVG11/types.html#ColorKeywords)," 

129 " hexadecimal value, RGB value, or HSL value. The default value is" 

130 " rgb(0,0,0)." 

131 ), 

132 examples=["Black", "7fffd4", "rgb(0,79,144)", "hsl(270, 60%, 70%)"], 

133 ) 

134 disable_external_link_icons: bool = pydantic.Field( 

135 default=True, 

136 title="Disable External Link Icons", 

137 description=( 

138 "If this option is set to true, then the external link icons will not be" 

139 " shown next to the links. The default value is true." 

140 ), 

141 ) 

142 disable_page_numbering: bool = pydantic.Field( 

143 default=True, 

144 title="Disable Page Numbering", 

145 description=( 

146 "If this option is set to true, then the page numbering will not be shown." 

147 " The default value is true." 

148 ), 

149 ) 

150 disable_last_updated_date: bool = pydantic.Field( 

151 default=True, 

152 title="Disable Last Updated Date", 

153 description=( 

154 "If this option is set to true, then the last updated date will not be" 

155 " shown in the header. The default value is true." 

156 ), 

157 ) 

158 text_alignment: Literal[ 

159 "left-aligned", "justified", "justified-with-no-hyphenation" 

160 ] = pydantic.Field( 

161 default="left-aligned", 

162 title="Text Alignment", 

163 description="The alignment of the text. The default value is left-aligned.", 

164 ) 

165 seperator_between_connections: str = pydantic.Field( 

166 default="$|$", 

167 title="Seperator Between Connections", 

168 description=( 

169 "The separator between the connections in the header. The default value is" 

170 " empty string." 

171 ), 

172 ) 

173 use_icons_for_connections: bool = pydantic.Field( 

174 default=False, 

175 title="Use Icons for Connections", 

176 description=( 

177 "If this option is set to true, then icons will be used for the connections" 

178 " (like phone, email, and website). The default value is false." 

179 ), 

180 ) 

181 margins: MarginsForEngineeringresumes = pydantic.Field( 

182 default=MarginsForEngineeringresumes(), 

183 title="Margins", 

184 description="Page, section title, entry field, and highlights field margins.", 

185 )