
    -PhH                     X    d Z ddlmZ ddlmZ dZ ej        e          Zd Z	d Z
d ZdS )	z>A small sphinx extension to add "copy" buttons to code blocks.    )Path)loggingz0.5.2c                     | j         j                            t          t	          t
                    j                            d                                                               d S )N_static)	confightml_static_pathappendstrr   __file__parentjoinpathabsoluteapps    Z/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sphinx_copybutton/__init__.pyscb_static_pathr   
   sW    J&&DNN!**955>>@@AA        c                    |j                             d|j        i           |j                             d|j        i           |j                             d|j        i           |j                             d|j        i           |j                             d|j        i           |j                             d|j        i           |j                             d|j        i           |j	        rt          | j                  |j	        z  }t                              d           |                                st          d	          |j        d
k    st          d          |                                |_        |j                             d|j        i           |j                             d|j        i           |j                             dt          t(                    j                            dd                                                              dd          i           |j                             d|j        i           d S )Ncopybutton_prompt_textcopybutton_prompt_is_regexp!copybutton_only_copy_prompt_linescopybutton_remove_promptscopybutton_copy_empty_lines&copybutton_line_continuation_charactercopybutton_here_doc_delimiterz=copybutton_image_path is deprecated, use copybutton_image_svgz"copybutton_img_path does not existz.svgz"copybutton_img_path must be an SVGcopybutton_image_svgcopybutton_selectorcopybutton_format_funcr   zcopybutton_funcs.jszexport functionfunctioncopybutton_exclude)html_contextupdater   r   r   r   r   r   r   copybutton_image_pathr   srcdirloggerwarningexists
ValueErrorsuffix	read_textr   r   r   r   r   replacer    )r   r   paths      r   add_to_contextr-      s^   
	!6#@A   	&(JK   	,f.VW   	$f&FG   	&(JK   4=	
   	(&*NO   # 7CJ&">>VWWW{{}} 	CABBB{f$$ABBB&*nn&6&6#
 68STUUU
 5v7QRSSS
$d8nnHHY(=>>Y[[W&
33		
    4f6OPQQQQQr   c                 0   t                               d           |                     dt                     |                     ddd           |                     ddd           |                     dd	d           |                     d
d	d           |                     dd	d           |                     ddd           |                     ddd           |                     ddd           |                     ddd           |                     ddd           |                     ddd           |                     dt
                     |                     d           |                     d           |                     d           t          d	d	dS )Nz%Adding copy buttons to code blocks...zbuilder-initedr    htmlr   Fr   Tr   r   r   r   r   r   zdiv.highlight prer    z.linenosr#   zconfig-initedzcopybutton.csszclipboard.min.jszcopybutton.js)versionparallel_read_safeparallel_write_safe)	r%   verboseconnectr   add_config_valuer-   add_css_fileadd_js_file__version__r   s    r   setupr:   D   s   
NN:;;;KK /222 12v>>>6vFFF<dFKKK4dFCCC6fEEEA2vNNN8"fEEE/V<<<.0CVLLL-z6BBB 0"f=== KK000 %&&&OO&'''OOO$$$"#  r   N)__doc__pathlibr   sphinx.utilr   r9   	getLogger__name__r%   r   r-   r:    r   r   <module>rA      s    D D            		8	$	$  1R 1R 1Rh    r   