romtools.workflows.formatting#
Functions
|
Replace RTVAR placeholders in a file and write the result. |
|
Replace RTVAR placeholders in multiple files. |
|
Replace RTVAR placeholders in the input text with provided values. |
|
- romtools.workflows.formatting.format_file(path, variables, output_path=None, strict=True, encoding='utf-8')[source]#
Replace RTVAR placeholders in a file and write the result.
If output_path is None, the input file is modified in-place.
- Parameters:
path (str)
variables (Mapping[str, Any])
output_path (str | None)
strict (bool)
encoding (str)
- Return type:
Path
- romtools.workflows.formatting.format_files(paths, variables, output_dir=None, strict=True, encoding='utf-8')[source]#
Replace RTVAR placeholders in multiple files.
If output_dir is provided, formatted files are written there using the original filenames.
- Parameters:
paths (Iterable[str])
variables (Mapping[str, Any])
output_dir (str | None)
strict (bool)
encoding (str)
- Return type:
List[Path]