o $a@sdZddlmZmZmZddlmZddlmZddl m Z ddl m Z ddl mZddlmZdd lmZeeZd ed efd d Zde ded dfddZde d eeeffddZdS)z sphinx.ext.autosectionlabel ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Allow reference sections by :ref: role using its title. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. )AnyDictcast)nodes)Node)Sphinx)StandardDomain)__)logging) clean_astextnodereturncCs2d}|}|j|jkr|j}|d7}|j|jks |S)Nr)parentdocument)r icur_noder=/usr/lib/python3/dist-packages/sphinx/ext/autosectionlabel.pyget_node_depths  rapprNc Cstt|jd}|tjD]j}|jjrt ||jjkrq|dd}|jj }ttj |d}t |d| }|jjrFt|d|}nt|}t|} ||jvrjtjtd||j|j|d|d|d||f|j|<||| f|j|<qdS) Nstdidsr rawsource:z(duplicate label %s, other instance in %sautosectionlabel)locationtypesubtype)rrenv get_domaintraversersectionconfigautosectionlabel_maxdepthrdocnametitlegetattrastext autosectionlabel_prefix_documentfully_normalize_namer labelsloggerwarningr doc2path anonlabels) rrdomainr labelidr%r&ref_namenamesectnamerrrregister_sections_as_label"s*    r5cCs4|ddd|ddd|dtddddS) Nr)Frr$z doctree-readbuiltinT)versionparallel_read_safeparallel_write_safe)add_config_valueconnectr5)rrrrsetup;s r<)__doc__typingrrrdocutilsrdocutils.nodesrsphinx.applicationrsphinx.domains.stdr sphinx.localer sphinx.utilr sphinx.util.nodesr getLogger__name__r,intrr5strr<rrrrs