
    -Ph                     j    d Z dZddlZddlmZmZ ddlmZ  G d de          Z G d d	e          Z	dS )
z
Auxiliary transforms mainly to be used by Writer components.

This module is called "writer_aux" because otherwise there would be
conflicting imports like this one::

    from docutils import writers
    from docutils.transforms import writers
reStructuredText    N)nodes	languages)	Transformc                   .     e Zd ZdZdZd fd	Zd Z xZS )Compounda  
    .. warning:: This transform is not used by Docutils since Dec 2010
                 and will be removed in Docutils 0.21 or later.

    Flatten all compound paragraphs.  For example, transform ::

        <compound>
            <paragraph>
            <literal_block>
            <paragraph>

    into ::

        <paragraph>
        <literal_block classes="continued">
        <paragraph classes="continued">
    i  Nc                     t          j        dt          d           t                                          ||           d S )Nzddocutils.transforms.writer_aux.Compound is deprecated and will be removed in Docutils 0.21 or later.   )
stacklevel)warningswarnDeprecationWarningsuper__init__)selfdocument	startnode	__class__s      ^/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/docutils/transforms/writer_aux.pyr   zCompound.__init__-   sI     H(Q	8 	8 	8 	8 	9-----    c                    | j                             t          j                  D ]`}d}|D ]<}|rt	          |t          j                  sd}!|d                             d           =|                    |d d                     ad S )NTFclasses	continued)r   findallr   compound
isinstance	Invisibleappendreplace_self)r   r   first_childchilds       r   applyzCompound.apply3   s    --en== 		/ 		/HK! 9 9 9%eU_== ,&+)$++K8888!!(111+....		/ 		/r   )N)__name__
__module____qualname____doc__default_priorityr   r"   __classcell__)r   s   @r   r   r      s^         $ . . . . . .
/ 
/ 
/ 
/ 
/ 
/ 
/r   r   c                       e Zd ZdZdZd ZdS )AdmonitionsaZ  
    Transform specific admonitions, like this:

        <note>
            <paragraph>
                 Note contents ...

    into generic admonitions, like this::

        <admonition classes="note">
            <title>
                Note
            <paragraph>
                Note contents ...

    The admonition title is localized.
    i  c                    t          j        | j        j        j        | j        j                  }| j                            t          j                  D ]}|j	        j
        }|d                             |           t          |t          j                  sot          j        |j        g|j        R i |j        }t          j        d|j        |                   }|                    d|           |                    |           d S )Nr    r   )r   get_languager   settingslanguage_codereporterr   r   
Admonitionr   r#   r   r   
admonition	rawsourcechildren
attributestitlelabelsinsertr   )r   languagenode	node_namer2   r6   s         r   r"   zAdmonitions.applyV   s   )$-*@*N*.-*@B BM))%*:;; 
	. 
	.D/IO""9---dE$455 ."-dn At} A A A04A A
B	(BCC!!!U+++!!*---
	. 
	.r   N)r#   r$   r%   r&   r'   r"    r   r   r*   r*   @   s5         $ . . . . .r   r*   )
r&   __docformat__r   docutilsr   r   docutils.transformsr   r   r*   r<   r   r   <module>r@      s   
  #  % % % % % % % % ) ) ) ) ) )&/ &/ &/ &/ &/y &/ &/ &/R#. #. #. #. #.) #. #. #. #. #.r   