rendercv.renderer
¶
The rendercv.renderer
package contains the necessary classes and functions for
generating $\LaTeX$, PDF, Markdown, HTML, and PNG files from the RenderCVDataModel
object.
The $\LaTeX$ and Markdown files are generated with
Jinja2 templates. Then, the $\LaTeX$
file is rendered into a PDF with TinyTeX, a $\LaTeX$
distribution. The Markdown file is rendered into an HTML file with markdown
package.
The PDF files are rendered into PNG files with PyMuPDF
/fitz
package.
create_a_latex_file(rendercv_data_model, output_directory)
¶
Render the $\LaTeX$ file with the given data model and write it to the output directory.
Parameters:
-
rendercv_data_model
(RenderCVDataModel
) –The data model.
-
output_directory
(Path
) –Path to the output directory.
Returns:
-
Path
–The path to the generated $\LaTeX$ file.
Source code in rendercv/renderer/renderer.py
create_a_latex_file_and_copy_theme_files(rendercv_data_model, output_directory)
¶
Render the $\LaTeX$ file with the given data model in the output directory and copy the auxiliary theme files to the output directory.
Parameters:
-
rendercv_data_model
(RenderCVDataModel
) –The data model.
-
output_directory
(Path
) –Path to the output directory.
Returns:
-
Path
–The path to the rendered $\LaTeX$ file.
Source code in rendercv/renderer/renderer.py
create_a_markdown_file(rendercv_data_model, output_directory)
¶
Render the Markdown file with the given data model and write it to the output directory.
Parameters:
-
rendercv_data_model
(RenderCVDataModel
) –The data model.
-
output_directory
(Path
) –Path to the output directory.
Returns:
-
Path
–The path to the rendered Markdown file.
Source code in rendercv/renderer/renderer.py
render_a_pdf_from_latex(latex_file_path, local_latex_command=None)
¶
Run TinyTeX with the given $\LaTeX$ file to render the PDF.
Parameters:
-
latex_file_path
(Path
) –The path to the $\LaTeX$ file.
Returns:
-
Path
–The path to the rendered PDF file.
Source code in rendercv/renderer/renderer.py
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 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
render_an_html_from_markdown(markdown_file_path)
¶
Render an HTML file from a Markdown file with the same name and in the same
directory. It uses rendercv/themes/main.j2.html
as the Jinja2 template.
Parameters:
-
markdown_file_path
(Path
) –The path to the Markdown file.
Returns:
-
Path
–The path to the rendered HTML file.
Source code in rendercv/renderer/renderer.py
render_pngs_from_pdf(pdf_file_path)
¶
Render a PNG file for each page of the given PDF file.
Parameters:
-
pdf_file_path
(Path
) –The path to the PDF file.
Returns:
-
list[Path]
–The paths to the rendered PNG files.