(docname, anchor="anchor", text="test text", bullet=False)
return nodes.bullet_list("", ret_list) if bullet else ret_list
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.
Create the node structure that Sphinx expects for TOC Tree entries.
Create the node structure that Sphinx expects for TOC Tree entries .
def _build_toc_node(docname, anchor="anchor", text="test text", bullet=False):
    """
    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.
    """
    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
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