def _rst_header(char, text, leading=False, newline=False):
    """Create rST header data from a given character and header text."""
    sep = char * len(text)
    data = [text, sep]
    if leading:
        data = [sep] + data
    if newline:
        data.append('')
    return data