@classmethod
def heading(cls, heading_text, char='=', level=0, ansi=False):
    """
        Turn the supplied heading text into a suitable heading with
        optional underline and color.
        """
    heading_color = cls.headings[level] if ansi else '%s'
    if char is None:
        return heading_color % '%s\n' % heading_text
    else:
        heading_ul = char * len(heading_text)
        return heading_color % '%s\n%s\n%s' % (heading_ul, heading_text,
            heading_ul)
