code: def _build_toc_node(docname, anchor="anchor", text="test text", bullet=False):
      
      reference = nodes.reference(
          "",
          "",
          internal=True,
          refuri=docname,
          anchorname="#" + anchor,
          *[nodes.Text(text, text)]
      )
      para = addnodes.compact_paragraph("", "", reference)
      ret_list = nodes.list_item("", para)
      return nodes.bullet_list("", ret_list) if bullet else ret_list
docs: Create the node structure that Sphinx expects for TOC Tree entries.
  
      The ``bullet`` argument wraps it in a ``nodes.bullet_list``,
      which is how you nest TOC Tree entries.