def METHOD_NAME(cls, filename, content, headers, compiler, rewrite_html=True):
    """Ask the specified compiler to write the post to disk."""
    if rewrite_html:
        try:
            doc = html.document_fromstring(content)
            doc.rewrite_links(replacer)
            content = html.tostring(doc, encoding='utf8')
        except etree.ParserError:
            pass
    if isinstance(content, bytes):
        content = content.decode('utf-8')
    compiler.create_post(
        filename,
        content=content,
        onefile=True,
        **headers)