File: //lib/python3/dist-packages/docutils/transforms/__pycache__/parts.cpython-312.pyc
�
�dd � � � d Z dZddlZddlmZ ddlmZ G d� de� Z G d� d e� Z G d
� dej � Z
y)z'
Transforms related to document parts.
�reStructuredText� N)�nodes)� Transformc �$ � e Zd ZdZdZ d� Zdd�Zy)�SectNumaS
Automatically assigns numbers to the titles of document sections.
It is possible to limit the maximum section level for which the numbers
are added. For those sections that are auto-numbered, the "autonum"
attribute is set, informing the contents table generator that a different
form of the TOC should be used.
i� c � � | j j j dd � | _ | j j j dd� | _ | j j j dd� | _ | j j j dd� | _ | j j j | j � | j j j r=| j �t j | _ | j | j � y | j | j j _ | j | j j _ | j
| j j _ | j | j j _ y )N�depth�start� �prefix� �suffix)� startnode�details�get�maxdepth�
startvaluer r �parent�remove�document�settings�
sectnum_xform�sys�maxsize�update_section_numbers�
sectnum_depth�
sectnum_start�sectnum_prefix�sectnum_suffix��selfs �;/usr/lib/python3/dist-packages/docutils/transforms/parts.py�applyz
SectNum.apply s( � ����.�.�2�2�7�D�A��
��.�.�0�0�4�4�W�a�@����n�n�,�,�0�0��2�>����n�n�,�,�0�0��2�>��������$�$�T�^�^�4��=�=�!�!�/�/��}�}�$� #����
��'�'��
�
�6�37�=�=�D�M�M�"�"�0�37�?�?�D�M�M�"�"�0�48�K�K�D�M�M�"�"�1�48�K�K�D�M�M�"�"�1� c � � |dz
}|rd}n| j }|D ]� }t |t j � s�|t |� fz }|d }t j
d| j dj |� z | j z dz dg�� }|j d|� d|d<