trlcdoc.converters.image_processing

Image file procesing tools.

Functions

convert_plantuml_to_image(plantuml_file, dest_dir, ...) → Optional[pathlib.Path]

Convert PlantUML diagram to an image file.

locate_file(file_path, directories) → Optional[str]

Locate a file by searching through the sources list if it

Module Contents

trlcdoc.converters.image_processing.convert_plantuml_to_image(plantuml_file: str, dest_dir: str, directories: List[str], image_format: str = 'svg') → pathlib.Path | None[source]

Convert PlantUML diagram to an image file.

Parameters:
  • plantuml_file (str) – Path or name of the PlantUML source file.

  • dest_dir (str) – Directory where the generated image will be written.

  • directories (List[str]) – Directories to search when plantuml_file is not an absolute path.

  • image_format (str) – Output image format passed to PlantUML (e.g. “svg” or “png”). Defaults to “svg”.

Returns:

Path to the generated image file, or None if the source file was not found.

Return type:

Optional[Path]

trlcdoc.converters.image_processing.locate_file(file_path: str, directories: List[str]) → str | None[source]

Locate a file by searching through the sources list if it cannot be accessed by the given file_path.

Parameters:
  • file_path (str) – The name of the file to locate.

  • directories (List[str]) – A list of directories to search for the file.

Returns:

The full path to the located file if found, otherwise None.

Return type:

str