display_file

glotaran.utils.ipython.display_file(path: str | Path, *, syntax: str | None = None) MarkdownStr[source]

Display a file with syntax highlighting syntax.

Parameters:
  • path (StrOrPath) – Paths to the file

  • syntax (str | None) – Syntax used for syntax highlighting. Defaults to None which means that the syntax is inferred based on the file extension. Pass the value "" to deactivate syntax highlighting.

Returns:

File content with syntax highlighting to render in ipython.

Return type:

MarkdownStr