sample_generator
¶
create_sample_rendercv_pydantic_model(*, name='John Doe', theme='classic', locale='english')
¶
Build sample CV model from sample content.
Why
New users need working examples to understand structure. Sample content provides realistic content that validates successfully and renders to all output formats without errors.
Parameters:
-
name(str, default:'John Doe') –Person's full name.
-
theme(str, default:'classic') –Design theme identifier.
-
locale(str, default:'english') –Locale language identifier.
Returns:
-
RenderCVModel–Validated model with sample content.
Source code in src/rendercv/schema/sample_generator.py
create_sample_yaml_input_file(*, file_path=None, name='John Doe', theme='classic', locale='english')
¶
Generate formatted sample YAML with schema hint and commented design options.
Why
New command provides users with immediately usable CV templates. JSON schema hint enables IDE autocompletion, commented design fields show customization options without overwhelming beginners.
Example
Parameters:
-
file_path(Path | None, default:None) –Optional path to write file.
-
name(str, default:'John Doe') –Person's full name.
-
theme(str, default:'classic') –Design theme identifier.
-
locale(str, default:'english') –Language/date format identifier.
Returns:
-
str | None–YAML string if file_path is None, otherwise None after writing file.
Source code in src/rendercv/schema/sample_generator.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
dictionary_to_yaml(dictionary)
¶
Convert dictionary to formatted YAML string with multiline preservation.
Why
Sample YAML generation must produce readable output with proper formatting for multiline strings. Custom representer ensures bullet points and descriptions use pipe syntax.
Parameters:
-
dictionary(dict) –Data structure to convert.
Returns:
-
str–Formatted YAML string.