model_processor
¶
download_photo_from_url(rendercv_model)
¶
Download photo from URL to output directory and update model to local path.
Why
Templates and Typst compiler require cv.photo to be a local pathlib.Path. When user provides a URL, this downloads the image before template rendering, preserving the local-path invariant for all downstream code.
Parameters:
-
rendercv_model(RenderCVModel) –CV model whose photo URL will be downloaded in-place.
Source code in src/rendercv/renderer/templater/model_processor.py
process_fields(entry, string_processors)
¶
Apply string processors to all entry fields except skipped technical fields.
Why
Entry fields need markdown parsing and formatting, but dates, DOIs, and URLs must remain unprocessed for correct linking and formatting. Field- level processing enables selective transformation.
Parameters:
-
entry(Entry) –Entry to process (model or string).
-
string_processors(list[Callable[[str], str]]) –Transformation functions to apply.
Returns:
-
Entry–Entry with processed fields.
Source code in src/rendercv/renderer/templater/model_processor.py
process_model(rendercv_model, file_type)
¶
Pre-process CV model for template rendering with format-specific transformations.
Why
Templates need processed data, not raw model. This applies markdown parsing, keyword bolding, connection formatting, date rendering, and entry template expansion before templates execute.
Parameters:
-
rendercv_model(RenderCVModel) –Validated CV model.
-
file_type(Literal['typst', 'markdown']) –Target format for format-specific processors.
Returns:
-
RenderCVModel–Processed model ready for templates.
Source code in src/rendercv/renderer/templater/model_processor.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 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 | |