euporie.core.convert.formats.ft

Contain functions which convert data to formatted text.

Functions

ansi_to_ft(data[, width, height, fg, bg, ...])

Convert ANSI text to formatted text, lexing & formatting automatically.

detect_lexer([text, path, language])

Detect the pygments lexer for a file.

html_to_ft(data[, width, height, fg, bg, ...])

Convert markdown to formatted text.

register(from_, to[, filter_, weight])

Add a converter to the centralized format conversion system.

strip_one_trailing_newline(ft)

Remove up to one trailing new-line character from formatted text.

to_formatted_text(value[, style, auto_convert])

Convert the given value (which can be formatted text) into a list of text fragments.

Classes

ANSI(value[, tab_size])

Convert ANSI text into formatted text, preserving all control sequences.

SimpleCache([maxsize])

Very simple cache that discards the oldest item when the cache size is exceeded.

partial

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

async euporie.core.convert.formats.ft.ansi_to_ft(data: str | bytes, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') StyleAndTextTuples

Convert ANSI text to formatted text, lexing & formatting automatically.

async euporie.core.convert.formats.ft.html_to_ft(data: str | bytes, width: int | None = None, height: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') StyleAndTextTuples

Convert markdown to formatted text.