+
    VBi                        R t ^ RIHt Rt^ RIt^ RIHt ^ RIHt  ! R R]4      t	 ! R R	]4      t
 ! R
 R]P                  4      tR# )z'
Transforms related to document parts.
)annotationsreStructuredTextN)nodes)	Transformc                  <    ] tR t^tRtRt R R ltR	R R lltRtR# )
SectNuma8  
Automatically assigns numbers to the titles of document sections.

It is possible to limit the maximum section level for which the numbers
are added.  For those sections that are auto-numbered, the "auto"
attribute is set, informing the contents table generator that a different
form of the TOC should be used.
i  c                   V ^8  d   QhRR/#    returnNone )formats   ">/usr/lib/python3.14/site-packages/docutils/transforms/parts.py__annotate__SectNum.__annotate__    s     @ @t @    c                	   V P                   P                  P                  R R4      V n        V P                   P                  P                  R^4      V n        V P                   P                  P                  RR4      V n        V P                   P                  P                  RR4      V n        V P                   P                  P                  V P                   4       V P                  P                  P                  '       dA   V P                  f   \        P                  V n        V P                  V P                  4       R# V P                  V P                  P                  n        V P                  V P                  P                  n        V P
                  V P                  P                  n        V P                  V P                  P                  n        R# )depthNstartprefix suffix)	startnodedetailsgetmaxdepth
startvaluer   r   parentremovedocumentsettingssectnum_xformsysmaxsizeupdate_section_numberssectnum_depthsectnum_startsectnum_prefixsectnum_suffixselfs   &r   applySectNum.apply    s+   ..227DA..0044Wa@nn,,002>nn,,002>$$T^^4==!!///}}$ #''637==DMM""037??DMM""048KKDMM""148KKDMM""1r   c                   V ^8  d   QhRR/# r	   r   )r   s   "r   r   r   0   s      $ r   c                	   V^,          pV'       d   ^pMV P                   pV F  p\        V\        P                  4      '       g   K%  V\	        V4      3,           pV^ ,          p\        P
                  ! RV P                  RP                  V4      ,           V P                  ,           R,           R.R7      pVP                  ^ V4       ^VR&   W0P                  8  d   V P                  WVV4       V^,          pK  	  R# )   r   .sectnum)classesautoNu      )r   
isinstancer   sectionstr	generatedr   joinr   insertr   r%   )	r+   noder   r   r2   childnumberstitler8   s	   &&&&     r   r%   SectNum.update_section_numbers0   s    
GooGE%// CL?2a!OOsxx'884;;F'(&K)	 Q	* !f==(//F1 r   )r   r   r   r   N)r       )	__name__
__module____qualname____firstlineno____doc__default_priorityr,   r%   __static_attributes__r   r   r   r   r      s"     .@  r   r   c                  :    ] tR t^FtRtRtR R ltR	R ltR tRt	R# )
Contentsa  
This transform generates a table of contents from the entire document tree
or from a single branch.  It locates "section" elements and builds them
into a nested bullet list, which is placed within a "topic" created by the
contents directive.  A title is either explicitly specified, taken from
the appropriate language module, or omitted (local table of contents).
The depth may be specified.  Two-way references between the table of
contents and section titles are generated (requires Writer support).

This transform requires a startnode, which contains generation
options and provides the location for the generated table of contents (the
startnode is replaced by the table of contents "topic").
i  c                   V ^8  d   QhRR/# r	   r   )r   s   "r   r   Contents.__annotate__X   s     G Gt Gr   c                	X   \        V P                  P                  R R4      pV'       d   R# V P                  P                  pRV9   dp   V P                  P
                  P
                  p\        V\        P                  4      '       g/   \        V\        P                  4      '       g   VP
                  pKN  MV P                  pV P                  P
                  R,          ^ ,          V n	        RV9   d   VR,          V n
        M%V P                  P                  P                  V n
        V P                  V4      p\        V4      '       d   V P                  P                  V4       R# V P                  P
                  P
                  P                  V P                  P
                  4       R# )use_latex_tocFNlocalids	backlinks)getattrr    r!   r   r   r   r5   r   r6   toc_idrP   toc_backlinksbuild_contentslenreplace_selfr   )r+   toc_by_writerr   r   contentss   &    r   r,   Contents.applyX   s    6 6O..((g--44I!)U]];;$Y??%,,	Inn++E215'!$[1DN!]]33AADN&&y1x==NN''1NN!!((//0E0EFr   c                	   V^,          pV Uu. uF'  p\        V\        P                  4      '       g   K%  VNK)  	  pp. pV P                  P                  P                  R\        P                  4      pV EF<  pV^ ,          pVP                  R4      p	V P                  V4      p
\        P                  ! RR.V
O5RVR,          ^ ,          / pV P                  P                  VRR7      p\        P                  ! RRV4      p\        P                  ! RV4      pV P                  R9   dX   VP                  \        P                  4      f7   V P                  R8X  d   WR&   M V P                  R	8X  d   V P                   VR&   W&8  d   V P#                  Wr4      pW,          pVP%                  V4       EK?  	  V'       d;   \        P&                  ! R.VO5!  pX	'       d   VR
,          P%                  R4       V# . # u upi )r0   r   r4   r   refidrO   z	toc-entry)suggested_prefixentrytopr3   zauto-toc)r]   r^   )r5   r   r6   r   r   r   r#   r$   copy_and_filter	referencer    set_id	paragraph	list_itemrP   	next_noderR   rT   appendbullet_list)r+   r;   levelsectsectionsentriesr   r6   r>   r4   	entrytextr`   ref_idr]   itemsubsectsrX   s   &&&              r   rT   Contents.build_contentsr   s   
%)MTTZemm-LDDTM&&**7CKK@GAJE99V$D,,U3IB 4)24genQ6G 4I]])));F * HFOOBI6E??2u-D"22OOEOO4<>>W,%+'N^^u,%)[[E'N}..w> NN4 '  ( ((6g6H#**:6OI; Ns
   "G:G:c                n    \        V P                  4      pVP                  V4       VP                  4       # )z@Return a copy of a title, with references, images, etc. removed.)ContentsFilterr    	walkaboutget_entry_text)r+   r;   visitors   && r   r_   Contents.copy_and_filter   s+     /w%%''r   )rP   rR   N)r@   )
rA   rB   rC   rD   rE   rF   r,   rT   r_   rG   r   r   r   rI   rI   F   s      G4B(r   rI   c                  @    ] tR t^tR tR tR tR tR t]t	]t
]tRtR# )rq   c                	6    V P                  4       P                  # N)get_tree_copychildrenr*   s   &r   rs   ContentsFilter.get_entry_text   s    !!#,,,r   c                	"    \         P                  hrx   r   SkipNoder+   r;   s   &&r   visit_citation_reference'ContentsFilter.visit_citation_reference       nnr   c                	"    \         P                  hrx   r}   r   s   &&r   visit_footnote_reference'ContentsFilter.visit_footnote_reference   r   r   c                	    VP                  R 4      '       d7   V P                  P                  \        P                  ! VR ,          4      4       \        P
                  h)alt)hasattrr   re   r   Textr~   r   s   &&r   visit_imageContentsFilter.visit_image   s:    <<KKuzz$u+67nnr   c                	"    \         P                  hrx   )r   SkipDeparturer   s   &&r    ignore_node_but_process_children/ContentsFilter.ignore_node_but_process_children   s    !!!r   r   N)rA   rB   rC   rD   rs   r   r   r   r   visit_problematicvisit_referencevisit_targetrG   r   r   r   rq   rq      s-    -
" 96O3Lr   rq   )rE   
__future__r   __docformat__r#   docutilsr   docutils.transformsr   r   rI   TreeCopyVisitorrq   r   r   r   <module>r      sK   
 #" 
  )1i 1hQ(y Q(h4U** 4r   