from typing import List
from typing import Tuple


def build_sorted_text_output(headline: str, content: List[Tuple[str, str, int]]) -> str:

    """
    Takes a headline and a list of items and their respective descriptions,
    sorts it and returns a nicely readable output
    """

    content.sort()
    output: str = f"{headline}  \n\n"
    for (item, description, power_level) in content:
        if power_level != 0:
            output = f"{output}`{item}`: {description} (PL: {power_level})  \n"
        else:
            output = f"{output}`{item}`: {description}  \n"

    return output