§
    ŽŸjÞ  ã                   ó¢   — d Z ddlZddlZddlZddlZddlmZmZ ddlm	Z	 ddl
mZ dZdZdd
„Zd„ Zd„ Zde_         G d„ de¦  «        Zd„ ZdadS )zUtility for calling pandocé    N)ÚBytesIOÚTextIOWrapper)Úcheck_versioné   )ÚConversionExceptionz2.9.2z4.0.0úutf-8c                 óŽ  — dd|d|g}|r|                      |¦  «         t          ¦   «          t          j        |t          j        t          j        ¬¦  «        }|                     |                      ¦   «         ¦  «        \  }}t          t          |¦  «        |d¦  «         	                    ¦   «         }	|	 
                    d¦  «        S )aL  Convert an input string using pandoc.

    Pandoc converts an input string `from` a format `to` a target format.

    Parameters
    ----------
    source : string
        Input string, assumed to be valid format `from`.
    fmt : string
        The name of the input format (markdown, etc.)
    to : string
        The name of the output format (html, etc.)

    Returns
    -------
    out : unicode
        Output as returned by pandoc.

    Raises
    ------
    PandocMissing
        If pandoc is not installed.
    Any error messages generated by pandoc are printed to stderr.

    Úpandocz-fz-t)ÚstdinÚstdoutÚreplaceú
)ÚextendÚcheck_pandoc_versionÚ
subprocessÚPopenÚPIPEÚcommunicateÚencoder   r   ÚreadÚrstrip)
ÚsourceÚfmtÚtoÚ
extra_argsÚencodingÚcmdÚpÚoutÚ_Úout_strs
             úc/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/nbconvert/utils/pandoc.pyr
   r
      s«   € ð4 �T˜3  bÐ
)€CØð Ø�
Š
�:ÑÔÐõ ÑÔÐõ 	Ô˜¥J¤O½J¼OÐLÑLÔL€AØ�]Š]˜6Ÿ=š=™?œ?Ñ+Ô+�F€CˆÝ�G C™LœL¨(°IÑ>Ô>×CÒCÑEÔE€GØ�>Š>˜$ÑÔÐó    c                  ór  — t           €ªt          j        d¦  «        st          ¦   «         ‚t	          j        ddg¦  «        } |                      ¦   «         }t          j        d¦  «        }|d          	                    dd¦  «         
                    ¦   «         D ]}|                     |¦  «        r|a  nŒt           S )ar  Gets the Pandoc version if Pandoc is installed.

    If the minimal version is not met, it will probe Pandoc for its version, cache it and return that value.
    If the minimal version is met, it will return the cached version and stop probing Pandoc
    (unless `clean_cache()` is called).

    Raises
    ------
    PandocMissing
        If pandoc is unavailable.
    Nr
   z-vz^\d+(\.\d+){1,}$r   Úasciir   )Ú	__versionÚshutilÚwhichÚPandocMissingr   Úcheck_outputÚ
splitlinesÚreÚcompileÚdecodeÚsplitÚmatch)r   Ú	out_linesÚversion_patternÚtoks       r"   Úget_pandoc_versionr4   ;   s¶   € õ ÐÝŒ|˜HÑ%Ô%ð 	"Ý‘/”/Ð!åÔ% x°Ð&6Ñ7Ô7ˆØ—N’NÑ$Ô$ˆ	Ýœ*Ð%8Ñ9Ô9ˆØ˜Q”<×&Ò& w°	Ñ:Ô:×@Ò@ÑBÔBð 	ð 	ˆCØ×$Ò$ SÑ)Ô)ð Ø�	Ø�ðõ Ðr#   c                  óV  — t           j        �t           j        S t          ¦   «         } | €t          j        dt
          d¬¦  «         dS t          | t          t          ¬¦  «        }|t           _        |s8t          j        d| z  dt          z  z   d	t          z  z   d
z   t
          d¬¦  «         |S )z�Returns True if pandoc's version meets at least minimal version.

    Raises
    ------
    PandocMissing
        If pandoc is unavailable.
    Nz�Sorry, we cannot determine the version of pandoc.
Please consider reporting this issue and include theoutput of pandoc --version.
Continuing...é   )Ú
stacklevelF)Úmax_vz5You are using an unsupported version of pandoc (%s).
z#Your version must be at least (%s) zbut less than (%s).
zFRefer to https://pandoc.org/installing.html.
Continuing with doubts...)	r   Ú_cachedr4   ÚwarningsÚwarnÚRuntimeWarningr   Ú_minimal_versionÚ_maximal_version)ÚvÚoks     r"   r   r   W   sÓ   € õ Ô#Ð/Ý#Ô+Ð+åÑÔ€AØ€yÝŒð9õ Øð	
ñ 	
ô 	
ð 	
ð ˆuÝ	�qÕ*Õ2BÐ	CÑ	CÔ	C€BØ#%ÕÔ Øð 
ÝŒØDÀqÑHØ3Õ6FÑFñGà%Õ(8Ñ8ñ9ð XñXõ Øð	
ñ 	
ô 	
ð 	
ð €Ir#   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )r)   z(Exception raised when Pandoc is missing.c                 óJ   •— t          ¦   «                              d¦  «         dS )zInitialize the exception.z^Pandoc wasn't found.
Please check that pandoc is installed:
https://pandoc.org/installing.htmlN)ÚsuperÚ__init__)ÚselfÚargsÚkwargsÚ	__class__s      €r"   rD   zPandocMissing.__init__„   s.   ø€ å‰Œ×Òð1ñ	
ô 	
ð 	
ð 	
ð 	
r#   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__rD   Ú__classcell__)rH   s   @r"   r)   r)   �   s>   ø€ € € € € Ø2Ð2ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r#   r)   c                  ó
   — da dS )zClean the internal cache.N)r&   © r#   r"   Úclean_cacherP   �   s   € ð €I€I€Ir#   )Nr   )rL   r,   r'   r   r:   Úior   r   Únbconvert.utils.versionr   Ú
exceptionsr   r=   r>   r
   r4   r   r9   r)   rP   r&   rO   r#   r"   ú<module>rT      s   ðØ  Ð  ð 
€	€	€	Ø €€€Ø Ð Ð Ð Ø €€€Ø %Ð %Ð %Ð %Ð %Ð %Ð %Ð %à 1Ð 1Ð 1Ð 1Ð 1Ð 1à +Ð +Ð +Ð +Ð +Ð +àÐ ØÐ ð% ð % ð % ð % ðPð ð ð8 ð  ð  ðF  $Ð Ô ð	
ð 	
ð 	
ð 	
ð 	
Ð'ñ 	
ô 	
ð 	
ðð ð ð €	€	€	r#   