
    N&i/
                     f    d Z dZddlmZ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    )nodesutils	languages)	Transformc                       e Zd ZdZdZd ZdS )Compounda  
    Flatten all compound paragraphs.  For example, transform ::

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

    into ::

        <paragraph>
        <literal_block classes="continued">
        <paragraph classes="continued">
    i  c                    | j                             t          j                  D ]`}d}|D ]<}|rt	          |t          j                  sd}!|d                             d           =|                    |d d                     ad S )NTFclasses	continued)documentfindallr   compound
isinstance	Invisibleappendreplace_self)selfr   first_childchilds       k/home/geonatureadmin/si_en_reseau/tutos/venv/lib/python3.11/site-packages/docutils/transforms/writer_aux.pyapplyzCompound.apply(   s    --en== 		/ 		/HK! 9 9 9%eU_== ,&+)$++K8888!!(111+....		/ 		/    N__name__
__module____qualname____doc__default_priorityr    r   r   r	   r	      s5          
/ 
/ 
/ 
/ 
/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   
Admonition	__class__r   r   r   
admonition	rawsourcechildren
attributestitlelabelsinsertr   )r   languagenode	node_namer+   r/   s         r   r   zAdmonitions.applyK   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   Nr   r    r   r   r"   r"   5   s5         $ . . . . .r   r"   N)
r   __docformat__docutilsr   r   r   docutils.transformsr   r	   r"   r    r   r   <module>r8      s   
  # , , , , , , , , , , ) ) ) ) ) )/ / / / /y / / /@#. #. #. #. #.) #. #. #. #. #.r   