def METHOD_NAME(self, contents):
    """Write the anchors to an HTML file."""
    if not self._html_file:
        return
    root = lxml.etree.Element("html")
    body = lxml.etree.SubElement(root, "body")
    title = lxml.etree.SubElement(body, "h1")
    subtitle = lxml.etree.SubElement(body, "em")
    title.text = contents["_metadata"]["title"].strip(".")
    subtitle.text = contents["_metadata"]["subtitle"].strip(".")
    vocab_list = lxml.etree.SubElement(body, "h2")
    vocab_list.text = "NXDL Vocabulary"
    p = lxml.etree.SubElement(body, "p")
    p.text = "This content is also available in these formats: "
    for ext in "json txt yml".split():
        a = lxml.etree.SubElement(p, "a")
        a.attrib["href"] = f"{MANUAL_URL}/_static/{self._txt_file.stem}.{ext}"
        a.text = f" {ext}"
    dl = lxml.etree.SubElement(body, "dl")
    for term, termlist in sorted(contents["terms"].items()):
        dterm = lxml.etree.SubElement(dl, "dt")
        dterm.text = term
        for _, itemdict in sorted(termlist.items()):
            ddef = lxml.etree.SubElement(dterm, "dd")
            a = lxml.etree.SubElement(ddef, "a")
            a.attrib["href"] = itemdict["url"]
            a.text = itemdict["term"]
    lxml.etree.SubElement(body, "hr")
    foot = lxml.etree.SubElement(body, "p")
    foot_em = lxml.etree.SubElement(foot, "em")
    foot_em.text = f"written: {contents['_metadata']['datetime']}"
    html = lxml.etree.tostring(root, pretty_print=True).decode()
    with open(self._html_file, "w") as f:
        f.write(html)
        f.write("\n")