
    -Ph	                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 erddlmZ ddlmZ dd	lmZ dd
lmZ  G d de          ZddZdS )z6The title collector components for sphinx.environment.    )annotations)TYPE_CHECKING)nodes)EnvironmentCollector)SphinxContentsFilter)Set)Sphinx)BuildEnvironment)ExtensionMetadatac                  *    e Zd ZdZdd
ZddZddZdS )TitleCollectorz'title collector for sphinx.environment.appr	   envr
   docnamestrreturnNonec                r    |j                             |d            |j                            |d            d S N)titlespop
longtitles)selfr   r   r   s       c/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sphinx/environment/collectors/title.py	clear_doczTitleCollector.clear_doc   s6    
w%%%7D)))))    docnamesSet[str]otherc                d    |D ],}|j         |         |j         |<   |j        |         |j        |<   -d S r   )r   r   )r   r   r   r   r   r   s         r   merge_otherzTitleCollector.merge_other   sK       	@ 	@G"',w"7CJw&+&6w&?CN7##	@ 	@r   doctreenodes.documentc                   t          j                    }|}d|v r0t          j                    }|t          j        |d                   z  }|                    t           j                  D ]D}t          |          }|d                             |           ||                                z  } n+|t          j        |                    dd                    z  }||j	        j
        |j	        j        <   ||j	        j        |j	        j        <   dS )zAdd a title node to the document (just copy the first section title),
        and store that title in the environment.
        titler   z
<no title>N)r   r%   Textfindallsectionr   	walkaboutget_entry_textgetr   r   r   r   )r   r   r"   	titlenodelongtitlenodenodevisitors          r   process_doczTitleCollector.process_doc&   s     KMM	! g!KMMMUZ(8999MOOEM22 	H 	HD*733GGg&&&//111IE GKK$F$FGGGI*3sw'.;37?+++r   N)r   r	   r   r
   r   r   r   r   )
r   r	   r   r
   r   r   r   r
   r   r   )r   r	   r"   r#   r   r   )__name__
__module____qualname____doc__r   r!   r0    r   r   r   r      sZ        11* * * *	@ 	@ 	@ 	@< < < < < <r   r   r   r	   r   r   c                B    |                      t                     ddddS )NbuiltinT)versionparallel_read_safeparallel_write_safe)add_env_collectorr   )r   s    r   setupr<   >   s0    .))) "#  r   N)r   r	   r   r   )r4   
__future__r   typingr   docutilsr   sphinx.environment.collectorsr   sphinx.transformsr   collections.abcr   sphinx.applicationr	   sphinx.environmentr
   sphinx.util.typingr   r   r<   r5   r   r   <module>rF      s    < < " " " " " "                   > > > > > > 2 2 2 2 2 2 5######))))))333333444444'< '< '< '< '<) '< '< '<T     r   