o
    i$                     @  sD   d Z ddlmZ dZddlmZmZ ddlmZ G d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
    )annotationsreStructuredText)nodes	languages)	Transformc                   @  s   e Zd ZdZdZdd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  returnNonec                 C  s   t | jjj| jj}| jtjD ]6}|j	j
}|d | t|tjsHtj|jg|jR i |j}td|j| }|d| || qd S )Nclasses r   )r   get_languagedocumentsettingslanguage_codereporterfindallr   
Admonition	__class____name__append
isinstance
admonition	rawsourcechildren
attributestitlelabelsinsertreplace_self)selflanguagenode	node_namer   r    r#   d/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/docutils/transforms/writer_aux.pyapply,   s   
zAdmonitions.applyN)r   r	   )r   
__module____qualname____doc__default_priorityr%   r#   r#   r#   r$   r      s    r   N)
r(   
__future__r   __docformat__docutilsr   r   docutils.transformsr   r   r#   r#   r#   r$   <module>   s   	