+
    VBi                    v    R t ^ RIHt Rt^ RIt^ RIHtHtHt  ! R R]4      t	 ! R R4      t
 ! R	 R
]4      tR# )a  
This package contains modules for standard tree transforms available
to Docutils components. Tree transforms serve a variety of purposes:

- To tie up certain syntax-specific "loose ends" that remain after the
  initial parsing of the input plaintext. These transforms are used to
  supplement a limited syntax.

- To automate the internal linking of the document tree (hyperlink
  references, footnote references, etc.).

- To extract useful information from the document tree. These
  transforms may be used to construct (for example) indexes and tables
  of contents.

Each transform is an optional step that a Docutils component may
choose to perform on the parsed document.
)annotationsreStructuredTextN)	languagesApplicationErrorTransformSpecc                      ] tR t^!tRtR# )TransformError N)__name__
__module____qualname____firstlineno____static_attributes__r	       A/usr/lib/python3.14/site-packages/docutils/transforms/__init__.pyr   r   !   s    r   r   c                  6    ] tR t^%tRtRt RR R lltR tRtR# )	Transformz1Docutils transform component abstract base class.Nc                   V ^8  d   QhRR/#    returnNoner	   )formats   "r   __annotate__Transform.__annotate__+   s     6 6D 6r   c                    Wn          W n         \        P                  ! VP                  P
                  VP                  4      V n        R# )z1
Initial setup for in-place document transforms.
N)document	startnoder   get_languagesettingslanguage_codereporterlanguage)selfr   r   s   &&&r   __init__Transform.__init__+   sE    
 !-"	 "..++X->->@5r   c                    \        R4      h)z5Override to apply the transform to the document tree.z"subclass must override this method)NotImplementedError)r#   kwargss   &,r   applyTransform.apply<   s    !"FGGr   )r   r"   r   N)	r
   r   r   r   __doc__default_priorityr$   r)   r   r	   r   r   r   r   %   s    ;I6"Hr   r   c                  v    ] tR t^AtRtR R ltRR R lltR R ltRR	 R
 lltR R lt	R R lt
R R ltRtR# )TransformeraG  
Store "transforms" and apply them to the document tree.

Collect lists of `Transform` instances from Docutils
components (`TransformSpec` instances).
Apply collected "transforms" to the document tree.

Also keeps track of components by component type name.

https://docutils.sourceforge.io/docs/peps/pep-0258.html#transformer
c                   V ^8  d   QhRR/# r   r	   )r   s   "r   r   Transformer.__annotate__N   s      D r   c                	r    . V n          . V n         Wn         . V n         R V n         / V n         ^ V n        R# )FN)
transformsunknown_reference_resolversr   appliedsorted
componentsserialno)r#   r   s   &&r   r$   Transformer.__init__N   sU    	 ,.(	
 !J32	
 	r   Nc                   V ^8  d   QhRR/# r   r	   )r   s   "r   r   r1   m   s       r   c                    Vf   VP                   pV P                  V4      pV P                  P                  WARV34       RV n        R# )a  
Store a single transform.  Use `priority` to override the default.
`kwargs` is a dictionary whose contents are passed as keyword
arguments to the `apply` method of the transform.  This can be used to
pass application-specific data to the transform instance.
NF)r-   get_priority_stringr3   appendr6   )r#   transform_classpriorityr(   priority_strings   &&&, r   add_transformTransformer.add_transformm   sH     &77H228<tV<	>r   c                   V ^8  d   QhRR/# r   r	   )r   s   "r   r   r1   {   s       r   c                    V F<  pV P                  VP                  4      pV P                  P                  W2R/ 34       K>  	  RV n        R# )z3Store multiple transforms, with default priorities.NF)r<   r-   r3   r=   r6   )r#   transform_listr>   r@   s   &&  r   add_transformsTransformer.add_transforms{   sJ    -O"66002OOO"" 4<>  .
 r   c                   V ^8  d   QhRR/# r   r	   )r   s   "r   r   r1      s      T r   c                    VP                   pVf   VP                  pV P                  V4      pV P                  P	                  WCV/ 34       RV n        R# )z4Store a transform with an associated `pending` node.NF)	transformr-   r<   r3   r=   r6   )r#   pendingr?   r>   r@   s   &&&  r   add_pendingTransformer.add_pending   sQ    !++&77H228<w;	=r   c                   V ^8  d   QhRR/# )r   r   strr	   )r   s   "r   r   r1      s     7 7s 7r   c                \    V ;P                   ^,          un         RWP                   3,          # )z|
Return a string, `priority` combined with `self.serialno`.

This ensures FIFO order on transforms with identical priority.
z	%03d-%03d)r8   )r#   r?   s   &&r   r<   Transformer.get_priority_string   s$     	h666r   c                   V ^8  d   QhRR/# r   r	   )r   s   "r   r   r1      s     < <d <r   c                   . pV Fm  p\        V\        4      '       g   K  V P                  VP                  4       4       W0P                  VP
                  &   VP                  VP                  4       Ko  	  RV n        R pVP                  VR7       V ;P                  V,          un        V P                  '       d    \        P                  ! R\        ^R7       R# R# )a?  
Store each component's default transforms and reference resolvers.

Transforms are stored with default priorities for later sorting.
"Unknown reference resolvers" are sorted and stored.
Components that don't inherit from `TransformSpec` are ignored.

Also, store components by type name in a mapping for later lookup.
Fc                    V P                   # r+   )r?   )fs   &r   keyfun4Transformer.populate_from_components.<locals>.keyfun   s    ::r   )keyztThe `unknown_reference_resolvers` hook chain will be removed in Docutils 1.0.
Use a transform to resolve references.)
stacklevelN)
isinstancer   rF   get_transformsr7   component_typeextendr4   r6   sortwarningswarnDeprecationWarning)r#   r7   	resolvers	componentrV   s   &&   r   populate_from_components$Transformer.populate_from_components   s     	#Ii77	 8 8 :;8AOOI445YBBC $ 	6"((I5(+++MM C -< ,r   c                   V ^8  d   QhRR/# r   r	   )r   s   "r   r   r1      s     2 2$ 2r   c                <   V P                   P                  P                  V P                   P                  4       V P                  '       d   V P
                  '       g$   V P                  P                  RR7       RV n        V P                  P                  4       w  rr4V! V P                   VR7      pVP                  ! R/ VB  V P                  P                  WW434       K  V P                   P                  P                  V P                   P                  4       R# )z6Apply all of the stored transforms, in priority order.T)reverse)r   Nr	   )r   r!   attach_observernote_transform_messager3   r6   r^   popr)   r5   r=   detach_observer)r#   r?   r>   rK   r(   rJ   s   &     r   apply_transformsTransformer.apply_transforms   s    ..MM00	2ooo;;; $$T$2"9=9L9L9N6Hw'IIOO%f%LLG LM..MM00	2r   )r5   r7   r   r8   r6   r3   r4   r+   )r
   r   r   r   r,   r$   rA   rF   rL   r<   rd   rm   r   r	   r   r   r/   r/   A   s/    
>7<<2 2r   r/   )r,   
__future__r   __docformat__r_   docutilsr   r   r   r   r   r/   r	   r   r   <module>rr      sD   
& #"  ? ?	% 	H H8C2- C2r   