| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/docutils/transforms/__pycache__/ |
Upload File : |
a
OԼa� � @ sl d Z dZddlZddlZddlZddlZddlmZmZ ddlm Z m
Z
ddlmZm
Z
G dd� de�ZdS ) z(
Docutils component-related transforms.
ZreStructuredText� N)�nodes�utils)�ApplicationError� DataError)� Transform�TransformErrorc @ s e Zd ZdZdZdd� ZdS )�Filtera�
Include or exclude elements which depend on a specific Docutils component.
For use with `nodes.pending` elements. A "pending" element's dictionary
attribute ``details`` must contain the keys "component" and "format". The
value of ``details['component']`` must match the type name of the
component the elements depend on (e.g. "writer"). The value of
``details['format']`` is the name of a specific format or context of that
component (e.g. "html"). If the matching Docutils component supports that
format or context, the "pending" element is replaced by the contents of
``details['nodes']`` (a list of nodes); otherwise, the "pending" element
is removed.
For example, up to version 0.17, the reStructuredText "meta"
directive created a "pending" element containing a "meta" element
(in ``pending.details['nodes']``).
Only writers (``pending.details['component'] == 'writer'``)
supporting the "html", "latex", or "odf" formats
(``pending.details['format'] == 'html,latex,odf'``) included the
"meta" element; it was deleted from the output of all other writers.
This transform is no longer used by Docutils, it may be removed in future.
i c C sf | j }|jd }|jd �d�}| jjj| }|D ]"}|�|�r2|�|jd � qbq2|j� |� d S )N� component�format�,r )
Z startnodeZdetails�splitZdocumentZtransformer�
componentsZsupportsZreplace_self�parent�remove)�selfZpendingZcomponent_type�formatsr r
� r �B/usr/lib/python3.9/site-packages/docutils/transforms/components.py�apply2 s
zFilter.applyN)�__name__�
__module__�__qualname__�__doc__Zdefault_priorityr r r r r r s r )r Z
__docformat__�sys�os�re�timeZdocutilsr r r r Zdocutils.transformsr r r r r r r �<module> s