path_resolver
¶
resolve_output_folder_placeholder(file_path, output_folder)
¶
Replace the OUTPUT_FOLDER directory component with the actual output folder.
Why
Output file paths use OUTPUT_FOLDER as a placeholder directory so users
can redirect all output via the single output_folder setting. Both
paths are already absolute (resolved by PlannedPathRelativeToInput from
the same base), so the replacement swaps the placeholder component and
appends remaining path segments.
Parameters:
-
file_path(Path) –Absolute path potentially containing an OUTPUT_FOLDER component.
-
output_folder(Path) –Absolute path to the actual output folder.
Returns:
-
Path–Path with OUTPUT_FOLDER replaced, or original path if not present.
Source code in src/rendercv/renderer/path_resolver.py
resolve_rendercv_file_path(rendercv_model, file_path)
¶
Resolve output file path with placeholder substitution and directory creation.
Why
Users specify output paths like OUTPUT_FOLDER/NAME_CV_YEAR.pdf with
placeholders for dynamic naming. This function first resolves the
OUTPUT_FOLDER directory component to the configured output folder, then
substitutes name and date placeholders in the filename, and finally
creates parent directories as needed.
Example
Parameters:
-
rendercv_model(RenderCVModel) –CV model containing name, date, and output folder for substitution.
-
file_path(Path) –Template path with placeholders.
Returns:
-
Path–Resolved absolute path with substituted placeholders.