def shorten(txt: str, length: int = 10, ellipsis: str = "…") -> str:
    """Truncate ``txt``, adding ``ellipsis`` to end, with total ``length``."""
    if len(txt) > length:
        return txt[: length - len(ellipsis)] + ellipsis
    else:
        return txt