def extract_md_header(file):
    """Extract the header from the input markdown file.

    Paramters
    ---------
    file : generator
        A generator that generates lines.

    Returns
    -------
    string | None
        The extracted header content or `None`.
    """
    first_line = True
    header_content = ""
    for line in file:
        if first_line:
            if line.strip() != "<!--":
                return None
            first_line = False
            continue

        if line.strip() == "-->":
            return header_content

        header_content += line

    return None