from typing import OrderedDict


def _get_file_metadata(help_topic_dict):
    """
    Parse a dictionary of help topics from the help index and return back an
    ordered dictionary associating help file names with their titles.

    Assumes the help dictionary has already been validated.
    """
    retVal = OrderedDict()
    for file in sorted(help_topic_dict.keys()):
        retVal[file] = help_topic_dict[file][0]

    return retVal