Your IP : 216.73.216.196


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.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�	filenames�	arguments�document_lexers�document_formatters�document_filters�	ExceptionrZcompoundr�splitr�stateZdocumentZsettingsZrecord_dependencies�add�children)�self�out�nodeZvl�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)r!rrrr"tr#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)rr r�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)r!rrrr"�r#z1PygmentsDoc.document_formatters.<locals>.<lambda>)r$r%z, r&r'r(r)z\*r)Zpygments.formattersrKr/r0r1rrr2r3r4r6r7r8�__name__r:�FMTERDOCr;r<)
rrKrrDrErFrGrHrIrJrrrr~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.filtersrNr0rr�sysrC�
__module__r2r4r6r7r8r:�	FILTERDOCrLr;)rrNr�namerHrIrrrr�s

zPygmentsDoc.document_filtersN)
rLrP�__qualname__r4Zhas_contentZrequired_argumentsZoptional_argumentsZfinal_argument_whitespaceZoption_specrrrrrrrrr=s%rcCs|�dt�dS)NZpygmentsdoc)Z
add_directiver)Zapprrr�setup�srT)r4�
__future__rrOZdocutilsrZdocutils.statemachinerZdocutils.parsers.rstrZsphinx.util.nodesrr@rBrMrQrrTrrrr�<module>s
	`