Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/pygments/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/pygments/__pycache__/sphinxext.cpython-37.opt-1.pyc

B

ͽ�\1�@stdZddlmZddlZddlmZddlmZddlm	Z	ddl
mZdZd	Z
d
ZdZGdd
�d
e	�Zdd�ZdS)a
    pygments.sphinxext
    ~~~~~~~~~~~~~~~~~~

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

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

%s
%s
zX
.. class:: %s

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

    %s

zA
.. class:: %s

    :Short names: %s
    :Filenames: %s

    %s

z'
.. class:: %s

    :Name: %s

    %s

c@sDeZdZdZdZdZdZdZiZdd�Z	dd�Z
d	d
�Zdd�Zd
S)�PygmentsDoczn
    A directive to collect all lexers/formatters/filters and generate
    autoclass directives for them.
    F�rcCs�t�|_|jddkr |��}n8|jddkr8|��}n |jddkrP|��}ntd��t��}t	|�
d�dd�}t|j||�x |jD]}|jj
jj�|�q�W|jS)	Nr�lexersZ
formatters�filtersz,invalid argument for "pygmentsdoc" directive�
�)�source)�set�	filenamesZ	arguments�document_lexers�document_formatters�document_filters�	ExceptionrZcompoundr�splitr�stateZdocumentZsettingsZrecord_dependencies�addZchildren)�self�outZnodeZvl�fn�r�C/opt/alt/python37/lib/python3.7/site-packages/pygments/sphinxext.py�runHs


zPygmentsDoc.runc
Cs�ddlm}g}i}i}�x�t|��dd�d�D]�\}}|d}t|dd|g�}|j�|j�t||�}	|	j	szt
d|�|	j	}
t|
t�r�|
�
d�}
|�|g��|d�|d	�p�d
d�|d��dd
��dd�p�d
d�|d�p�d
|
f�||kr0|j	}t|t��r|�
d�}|||<q0Wx�t|��dd�d�D]z\}}||dk�rTtd|f��||��d���d�}
|�t||
dt|
�f�x|D]}|�t|��q�W�q0Wd�|�S)Nr)�LEXERScSs|dS)Nrr)�xrrr�<lambda>^�z-PygmentsDoc.document_lexers.<locals>.<lambda>)�keyz&Warning: %s does not have a docstring.�utf8z, ��None��*z\*�_�\�cSs|dS)Nrr)rrrrrtr zMissing docstring for %s�.�-r)Zpygments.lexers._mappingr�sorted�items�
__import__rr�__file__�getattr�__doc__�print�
isinstance�bytes�decode�
setdefault�append�join�replacer�
splitlines�strip�rstrip�	MODULEDOC�len�LEXERDOC)rrr�modulesZmoduledocstrings�	classname�data�module�mod�cls�	docstringZmoddocr	�headingrrrrYsB 


 

zPygmentsDoc.document_lexersc

Cs�ddlm}g}x�t|��dd�d�D]�\}}|d}t|dd|g�}|j�|j�t||�}|j	}t
|t�rx|�d�}|j
}	|�t|	d�|d�p�d	d�|d
��dd�p�d	|f�q&Wd
�|�S)Nr)�
FORMATTERScSs|dS)Nrr)rrrrr�r z1PygmentsDoc.document_formatters.<locals>.<lambda>)r!r"z, r#r$r%r&z\*r)Zpygments.formattersrHr,r-r.rrr/r0r1r3r4r5�__name__r7�FMTERDOCr8r9)
rrHrrArBrCrDrErFrGrrrr~s


zPygmentsDoc.document_formatterscCsvddlm}g}xZ|��D]N\}}|j�tj|jj�|j	}t
|t�rR|�d�}|�
t|j||f�qWd�|�S)Nr)�FILTERSr"r)Zpygments.filtersrKr-rr�sysr@�
__module__r/r1r3r4r5r7�	FILTERDOCrIr8)rrKr�namerErFrrrr�s

zPygmentsDoc.document_filtersN)
rIrM�__qualname__r1Zhas_contentZrequired_argumentsZoptional_argumentsZfinal_argument_whitespaceZoption_specrrrrrrrrr=s%rcCs|�dt�dS)NZpygmentsdoc)Z
add_directiver)Zapprrr�setup�srQ)r1Z
__future__rrLZdocutilsrZdocutils.statemachinerZdocutils.parsers.rstrZsphinx.util.nodesrr=r?rJrNrrQrrrr�<module>s
	`