File: //usr/lib/python3/dist-packages/sphinx/ext/__pycache__/autosectionlabel.cpython-310.pyc
o
$�a� � @ s� d Z ddlmZmZmZ ddlmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ ddlmZ dd lmZ e�e�Zd
edefdd
�Zde
deddfdd�Zde
deeef fdd�ZdS )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.
� )�Any�Dict�cast)�nodes)�Node)�Sphinx)�StandardDomain)�__)�logging)�clean_astext�node�returnc C s2 d}| }|j | jkr|j }|d7 }|j | jks
|S )Nr � )�parent�document)r �i�cur_node� r �=/usr/lib/python3/dist-packages/sphinx/ext/autosectionlabel.py�get_node_depth s �r �appr Nc
C s� t t| j�d��}|�tj�D ]j}| jjrt |�| jjkrq|d d }| jj
}t tj|d �}t|d|�
� �}| jjrFt�|d | �}nt�|�}t|�} ||jv rjtjtd�|| j�|j| d �|d|d� ||f|j|<