HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/pygments/__pycache__/sphinxext.cpython-310.pyc
o

;j��@shdZddlZddlmZddlmZddlmZddlm	Z	dZ
dZd	Zd
Z
Gdd�de�Zd
d�ZdS)a
    pygments.sphinxext
    ~~~~~~~~~~~~~~~~~~

    Sphinx extension to generate automatic documentation of lexers,
    formatters and filters.

    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�nodes)�ViewList)�	Directive)�nested_parse_with_titlesz
.. module:: %s

%s
%s
z`
.. class:: %s

    :Short names: %s
    :Filenames:   %s
    :MIME types:  %s

    %s

    %s

zA
.. class:: %s

    :Short names: %s
    :Filenames: %s

    %s

z'
.. class:: %s

    :Name: %s

    %s

c@sLeZdZdZdZdZdZdZiZdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dS)�PygmentsDoczn
    A directive to collect all lexers/formatters/filters and generate
    autoclass directives for them.
    F�rcCs�t�|_|jddkr|��}n(|jddkr|��}n|jddkr(|��}n|jddkr4|��}ntd��t�	�}t
|�d�dd	�}t|j
||�|jD]}|j
jjj�|�qO|jS)
Nr�lexersZ
formatters�filtersZlexers_overviewz,invalid argument for "pygmentsdoc" directive�
�)�source)�set�	filenamesZ	arguments�document_lexers�document_formatters�document_filters�document_lexers_overview�	ExceptionrZcompoundr�splitr�stateZdocumentZsettingsZrecord_dependencies�add�children)�self�out�nodeZvl�fn�r�F/opt/saltstack/salt/lib/python3.10/site-packages/pygments/sphinxext.py�runGs 




zPygmentsDoc.runc
s\ddlm}ddl}g}g�dd�}t|��dd�d�D];\}}|j�|d	�}|j|j}��	||d	|j
�d
�|��dd��d
d�pEdd
�|d�|d�d|��d��qgd�}	�fdd�|	D���fdd����fdd�}
|�	|
��|�	�dddd��|�	|
���D]}|�	�|d|d|dd |d!�d"���q�|�	|
��d#�|�S)$z�Generate a tabular overview of all lexers.

        The columns are the lexer name, the extensions handled by this lexer
        (or "None"), the aliases and a link to the lexer class.r��LEXERSNcSs|rd|�d|�d�S|S)N�`z <z>`_r)�name�urlrrr�format_linkesz9PygmentsDoc.document_lexers_overview.<locals>.format_linkcSs|dd��S)Nr)�lower��xrrr�<lambda>jsz6PygmentsDoc.document_lexers_overview.<locals>.<lambda>��keyr�, �*�\*�_�\�None��.)r"�
extensions�aliases�classcs"g|]
�t�fdd��D���qS)cs g|]}|�rt|���qSr)�len)�.0�row��columnrr�
<listcomp>vs zCPygmentsDoc.document_lexers_overview.<locals>.<listcomp>.<listcomp>)�max)r7)�tabler9rr;vs�z8PygmentsDoc.document_lexers_overview.<locals>.<listcomp>csFg}t�|�D]\}}|r|�|�|��q|�d|�qd�|�S)zFormat a table row� )�zip�append�ljust�join)�columnsr�length�col)�column_lengthsrr�	write_rowys
z7PygmentsDoc.document_lexers_overview.<locals>.write_rowcsdd��D�}�|�S)zWrite a table separator rowcSsg|]}d|�qS)�=r)r7�crrrr;�szQPygmentsDoc.document_lexers_overview.<locals>.write_seperator.<locals>.<listcomp>r)�sep)rFrGrr�write_seperator�sz=PygmentsDoc.document_lexers_overview.<locals>.write_seperator�NamezExtension(s)z
Short name(s)zLexer classr"r3r4z	:class:`~r5r!r
)
�pygments.lexers._mappingr Zpygments.lexers�sorted�itemsrZfind_lexer_classrZalias_filenamesr@r#rB�replace)rr �pygmentsrr$�	classname�dataZ	lexer_clsr3Zcolumn_namesrKr8r)rFr=rGrrZs@
�
��
z$PygmentsDoc.document_lexers_overviewc
Cszddlm}ddl}ddl}ddl}g}i}i}t|��dd�d�D]�\}}	|	d}
t|
dd|g�}|j�	|j
�t||�}|jsIt
d|�d��|j}
t|
t�rV|
�d�}
t|d	d�}|r�|�|�|��jjd
d|}|jdd
�}|s�td|�d|����|	dr�|	dd}|
d7}
|
d|�d�7}
|��D]
}|
d|�d�7}
q�|jr�d|j��}nd}|�|
g��|d�|	d�p�dd�|	d��dd��dd�p�dd�|	d�p�d|
|f�|
|vr�|j}t|t�r�|�d�}|||
<q"t|��d d�d�D]:\}
}||
du�rtd!|
����||
��d���d"�}|�t|
|d#t|�f�|D]
}	|�t |	��q,q�d�|�S)$NrrcS�|dS�Nrrr&rrrr(��z-PygmentsDoc.document_lexers.<locals>.<lambda>r)z	Warning: z does not have a docstring.�utf8Z_exampleZtestsZexamplefileszutf-8)�encodingzEmpty example file 'z' for lexer r1z

    .. admonition:: Example
z
      .. code-block:: z

z
          r
z.. versionadded:: rr+r0�r,r-r.r/�cSrTrUrr&rrrr(�rVzMissing docstring for r2�-)!rMr rQ�inspect�pathlibrNrO�
__import__rr�__file__�getattr�__doc__�print�
isinstance�bytes�decode�PathZ
getabsfile�parent�	read_textr�
splitlinesZ
version_added�
setdefaultr@rBrP�strip�rstrip�	MODULEDOCr6�LEXERDOC)rr rQr\r]r�modulesZmoduledocstringsrRrS�module�mod�cls�	docstringZexample_file�p�contentZ
lexer_name�lineZversion_lineZmoddocr�headingrrrr�s�


����� �

��
zPygmentsDoc.document_lexersc

Cs�ddlm}g}t|��dd�d�D]I\}}|d}t|dd|g�}|j�|j�t||�}|j	}t
|t�r;|�d�}|j
}	|�t|	d�|d�pJd	d�|d
��dd�pVd	|f�qd
�|�S)Nr)�
FORMATTERScSrTrUrr&rrrr(�rVz1PygmentsDoc.document_formatters.<locals>.<lambda>r)rWr+r1r0rYr,r-r)Zpygments.formattersrxrNrOr^rrr_r`rarcrdre�__name__r@�FMTERDOCrBrP)
rrxrrRrSrprqrrrsrwrrrr�s 



�
zPygmentsDoc.document_formatterscCsrddlm}g}|��D]'\}}|j�tj|jj�|j	}t
|t�r(|�d�}|�
t|j||f�qd�|�S)Nr)�FILTERSrWr)Zpygments.filtersr{rOrr�sysro�
__module__r_rarcrdrer@�	FILTERDOCryrB)rr{rr"rrrsrrrr�s


zPygmentsDoc.document_filtersN)ryr}�__qualname__raZhas_contentZrequired_argumentsZoptional_argumentsZfinal_argument_whitespaceZoption_specrrrrrrrrrr<s<ArcCs|�dt�dS)NZpygmentsdoc)Z
add_directiver)Zapprrr�setup�sr�)rar|ZdocutilsrZdocutils.statemachinerZdocutils.parsers.rstrZsphinx.util.nodesrrmrnrzr~rr�rrrr�<module>s


;