관리-도구
편집 파일: sphinxext.cpython-38.pyc
U &?�f- � @ sh d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z dZ dZd Zd Z G dd� de�Zd d� ZdS )a pygments.sphinxext ~~~~~~~~~~~~~~~~~~ Sphinx extension to generate automatic documentation of lexers, formatters and filters. :copyright: Copyright 2006-2024 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 @ sL e Zd ZdZdZdZdZdZi Zdd� Z dd� Z d d � Zdd� Zd d� Z dS )�PygmentsDoczn A directive to collect all lexers/formatters/filters and generate autoclass directives for them. F� r c C s� t � | _| jd dkr | �� }nP| jd dkr8| �� }n8| jd dkrP| �� }n | jd dkrh| �� }ntd��t� � }t |�d�dd �}t| j ||� | jD ]}| j jjj�|� q�|jS ) Nr �lexers� formatters�filtersZlexers_overviewz,invalid argument for "pygmentsdoc" directive� � )�source)�set� filenames� arguments�document_lexers�document_formatters�document_filters�document_lexers_overview� Exceptionr Zcompoundr �splitr �stateZdocument�settingsZrecord_dependencies�add�children)�self�out�nodeZvl�fn� r �L/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/pygments/sphinxext.py�runG s zPygmentsDoc.runc sb ddl m} ddlm} g }g �dd� }t|�� dd� d�D ]r\}}||d �}|j|j }��||d |j �d � |��dd��d d�p�dd � |d �|d � d|� �d�� q<ddddg} �fdd�| D �� � fdd��� �fdd�} |�| � � |��dddd �� |�| � � �D ]2}|��|d |d |d d!|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 ��LEXERS)�find_lexer_classc S s |rd| � d|� d�S | S )N�`z <z>`_r )�name�urlr r r �format_linke s z9PygmentsDoc.document_lexers_overview.<locals>.format_linkc S s | d d � � S )Nr )�lower��xr r r �<lambda>j � z6PygmentsDoc.document_lexers_overview.<locals>.<lambda>��keyr �, �*�\*�_�\�None� �.)r&