def METHOD_NAME(header: str,
                    content: str,
                    node_link: str,
                    header_index_offset: int) -> str:
    # Downgrade headers and use HTML to avoid creating sidebar items for them
    for header_index in range(4, 0, -1):
        markdown_header_prefix = '#' * header_index
        parts = re.split(f'\n{markdown_header_prefix} ([^\n]*)\n', content)
        # Nothing to do
        if len(parts) == 1:
            continue
        # We could start a section without a header
        if len(parts) % 2:
            section_headers = ['', *parts[1::2]]
            section_contents = parts[0::2]
        else:
            section_headers = parts[0::2]
            section_contents = parts[1::2]
        content = ''
        for section_header, section_content in zip(section_headers, section_contents):
            if not section_header:
                content += section_content
                continue
            header_html = build_header(
                header=section_header,
                header_index=(header_index + header_index_offset),
                node_link=node_link,
            )
            content += f'\n{header_html}\n{section_content}'
    return content