a
    þd-  ã                   @   s.   d dl Z d dlZd dlZeeddœdd„ZdS )é    N)Úpath_inÚpath_outÚreturnc                 C   sÊ   t | ƒ}| ¡ }W d  ƒ n1 s&0    Y  d}t|ƒD ]T\}}| d¡rj|dd…  d¡d  ¡ }q<| d¡r<| dd|› d	¡}|||< q<t |d
ƒ}| |¡ W d  ƒ n1 s¼0    Y  dS )z…Adjust changelog titles so not to be duplicated.

    Args:
        path_in: input MD file
        path_out: output also MD file
    NÚ z## é   ú-r   z### z###z -Úw)ÚopenÚ	readlinesÚ	enumerateÚ
startswithÚsplitÚstripÚreplaceÚ
writelines)r   r   ÚfpZchlog_linesZ	chlog_verÚiÚln© r   úl/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/lightning_utilities/docs/formatting.pyÚ_transform_changelog	   s    
&


r   )ÚglobÚosÚreÚstrr   r   r   r   r   Ú<module>   s   