+
    VBi                    t    R t ^ RIHt Rt^ RIHt ^ RIHt  ! R R]4      t ! R R]4      t	 ! R	 R
]4      t
R# )z
Miscellaneous transforms.
)annotationsreStructuredText)nodes)	Transformc                  *    ] tR t^tRtRtR R ltRtR# )CallBacka  
Inserts a callback into a document.  The callback is called when the
transform is applied, which is determined by its priority.

For use with `nodes.pending` elements.  Requires a ``details['callback']``
entry, a bound method or function which takes one parameter: the pending
node.  Other data can be stored in the ``details`` attribute or in the
object hosting the callback method.
i  c                   V ^8  d   QhRR/#    returnNone )formats   "=/usr/lib/python3.14/site-packages/docutils/transforms/misc.py__annotate__CallBack.__annotate__   s     ' 't '    c                	    V P                   pVP                  R ,          ! V4       VP                  P                  V4       R# )callbackN)	startnodedetailsparentremove)selfpendings   & r   applyCallBack.apply   s.    ..
#G,g&r   r   N__name__
__module____qualname____firstlineno____doc__default_priorityr   __static_attributes__r   r   r   r   r      s     ' 'r   r   c                  *    ] tR t^%tRt^tR R ltRtR# )ClassAttributez[
Move the "class" attribute specified in the "pending" node into the
next visible element.
c                   V ^8  d   QhRR/# r	   r   )r   s   "r   r   ClassAttribute.__annotate__.   s     $ $t $r   c                	   V P                   pVP                  pTpV'       d   \        VP                  V4      ^,           \	        V4      4       F  pW$,          p\        V\        P                  4      '       g!   \        V\        P                  4      '       d   KM  VR;;,          VP                  R,          ,          uu&   VP                  P                  V4        R# 	  TpVP                  pK  V P                  P                  P                  RVP                  R,          ,          \        P                  ! VP                  VP                  4      VP                   R7      pVP#                  V4       R# )   classesclassNz,No suitable element following "%s" directive	directive)line)r   r   rangeindexlen
isinstancer   	Invisiblesystem_messager   r   documentreportererrorliteral_block	rawsourcer.   replace_self)r   r   r   childr0   elementr7   s   &      r   r   ClassAttribute.apply.   s   ..v||E2Q6FD -w88!'5+?+?@@	"goog&>>"%%g. E &&,,:ook*+ 1 173D3DE	 - 
 	U#r   r   Nr   r   r   r   r&   r&   %   s    
 $ $r   r&   c                  6    ] tR t^HtRtRtR R ltR R ltRtR# )	Transitionsa  
Move transitions at the end of sections up the tree.  Complain
on transitions after a title, subtitle, meta, or decoration element,
at the beginning or end of the document, and after another transition.

For example, transform this::

    <section>
        ...
        <transition>
    <section>
        ...

into this::

    <section>
        ...
    <transition>
    <section>
        ...
i>  c                   V ^8  d   QhRR/# r	   r   )r   s   "r   r   Transitions.__annotate__b   s     ( (t (r   c                	    V P                   P                  \        P                  4       F  pV P	                  V4       K  	  R # )N)r5   findallr   
transitionvisit_transition)r   nodes   & r   r   Transitions.applyb   s/    MM))%*:*:;D!!$' <r   c                   V ^8  d   QhRR/# r	   r   )r   s   "r   r   rA   f   s     1/ 1/ 1/r   c                	   VP                   P                  V4      pVP                  4       pR p\        VP                   \        P
                  \        P                  34      '       g   RpMzV^ 8X  gO   \        V\        P                  \        P                  \        P                  \        P                  34      '       d   RpM"\        V\        P                  4      '       d   RpV'       d   V P
                  P                  P                  WAR7      p\        P                  ! 4       VP                   V&    VP                   P                  RR7       WP                   V&   VP                   P!                  V^,           V4       V^,          p\        VP                   \        P
                  \        P                  34      '       g   R# V\%        VP                   4      8  g   Q hV\%        VP                   4      ^,
          8w  d   R# TpV\%        VP                   4      ^,
          8X  d|   VP                   pVP                   fE   V P
                  P                  P                  RVR7      pVP                   P'                  V4       R# VP                   P                  V4      pK  VP                   P)                  V4       VP                   P!                  V^,           V4       R#   \        P"                   d    YP                   T&    ELi ; i)	 z4Transition must be child of <document> or <section>.z4Document or section may not begin with a transition.zZAt least one body element must separate transitions; adjacent transitions are not allowed.)	base_nodeF)	recursiveNz'Document may not end with a transition.)r   r0   previous_siblingr2   r   r5   sectiontitlesubtitlemeta
decorationrD   r6   warning	paragraphvalidateinsertValidationErrorr1   appendr   )r   rF   r0   rM   msgrS   siblings   &&     r   rE   Transitions.visit_transitionf   sG   !!$'002$++'FGGHCaZ:&69>9>9>9I9I9K L L IC(%*:*:;;;Cmm,,44S4IG!&!2DKK$$u$5 &*E"""57G4
$++'FGGs4;;''''C$q((s7>>*Q..nnG~~% --0088G(, 9 . ""7+NN((1E4 eai.; (( *%)E"*s   6K% %#LLr   N)	r   r   r    r!   r"   r#   r   rE   r$   r   r   r   r?   r?   H   s    , (1/ 1/r   r?   N)r"   
__future__r   __docformat__docutilsr   docutils.transformsr   r   r&   r?   r   r   r   <module>r`      sA   
 #"  )'y '( $Y  $FO/) O/r   