
    7 f                        d Z ddlmZ ddlmZ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  G d	 d
e	          ZddZdS )z6The title collector components for sphinx.environment.    )annotations)TYPE_CHECKINGAny)nodes)EnvironmentCollector)SphinxContentsFilter)Sphinx)BuildEnvironmentc                  *    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       Y/var/www/equiseq/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   sI     	@ 	@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    r/    r   r   r   r      sZ        11* * * *@ @ @ @< < < < < <r   r   r   r	   r   dict[str, Any]c                B    |                      t                     ddddS )NbuiltinT)versionparallel_read_safeparallel_write_safe)add_env_collectorr   )r   s    r   setupr<   6   s0    .))) "#  r   N)r   r	   r   r5   )r3   
__future__r   typingr   r   docutilsr   sphinx.environment.collectorsr   sphinx.transformsr   sphinx.applicationr	   sphinx.environmentr
   r   r<   r4   r   r   <module>rD      s    < < " " " " " " % % % % % % % %       > > > > > > 2 2 2 2 2 2 4))))))333333"< "< "< "< "<) "< "< "<J     r   