U
    H8e*  ã                   @   s6   d dl Z d dlZd dlZd
dd„Zdd„ Zdd	„ ZdS )é    NÚ0©Útableztable-stripedztable-hoverc              
   K   s:   t  dd¡$ | jf ||dœ|—ŽW  5 Q R £ S Q R X dS )as  Convert a dataframe to HTML without truncating contents.

    pandas will truncate cell contents that exceed 50 characters by default.
    Use this function to avoid this truncation behavior.

    This function uses different default parameters than `DataFrame.to_html` to
    give uniform styling to HTML tables that are compatible with q2template
    themes. These parameters can be overridden, and they (along with any other
    parameters) will be passed through to `DataFrame.to_html`.

    Parameters
    ----------
    df : pd.DataFrame
        DataFrame to convert to HTML.
    kwargs : dict
        Parameters passed through to `pd.DataFrame.to_html`.

    Returns
    -------
    str
        DataFrame converted to HTML.

    References
    ----------
    .. [1] https://stackoverflow.com/q/26277757/3776794
    .. [2] https://github.com/pandas-dev/pandas/issues/1852

    zdisplay.max_colwidthéÿÿÿÿ)ÚborderÚclassesN)ÚpdZoption_contextZto_html)Zdfr   r   Úkwargs© r
   úNlib/python3.8/site-packages/q2templates-2023.9.0-py3.8.egg/q2templates/util.pyÚ
df_to_html   s    r   c                 C   sb   t  | ¡D ]R}| d¡rq
t j | |¡}t j ||¡}t j |¡rPt ||¡ q
t ||¡ q
d S )NÚ.)	ÚosÚlistdirÚ
startswithÚpathÚjoinÚisdirÚshutilZcopytreeZcopy2)Z
source_dirZ
output_dirÚitemÚsrcÚdestr
   r
   r   Úcopy_assets2   s    
r   c                 C   s   t | tƒr| fS | S )N)Ú
isinstanceÚstr)r   r
   r
   r   Úget_iterableB   s    
r   )r   r   )r   r   Zpandasr   r   r   r   r
   r
   r
   r   Ú<module>	   s
   
#