Ë X!+¥ b¹�ãó.—dZdZddlmZmZddlmZGd„de«ZGd„de«ZGd „d e«Z Gd „d e«Z Gd „de«Z Gd„de«Z Gd„de «ZGd„de«ZGd„de«ZGd„de«ZGd„dej$«Zy)z& Transforms for resolving references. ÚreStructuredTexté)ÚnodesÚutils)Ú Transformcó—eZdZdZdZd„Zy)ÚPropagateTargetsa} Propagate empty internal targets to the next element. Given the following nodes:: This is a test. PropagateTargets propagates the ids and names of the internal targets preceding the paragraph to the paragraph itself:: This is a test. icó¸—|jjtj«D�]-}t |j tj «s3|jd«s"|jd«s|jd«rŒ\t|«dk(sJd«‚|jd¬«}t |tj«r.|jdd¬ «}t |tj«rŒ.|�Dt |tjtjf«rt |tj«s�Œ|d j|d «|d j|d «t|d «si|_t|d «si|_|d D]*}||jj |<||j|<Œ,|d D]}||j|<Œ|jj#t%|d i««|jj#t%|d i««|d d|d<g|d <g|d <|jj'|«�Œ0y)NÚrefidÚrefuriÚrefnamerz&error: block-level target has childrenT)ÚascendF)r ÚdescendÚidsÚnamesÚexpect_referenced_by_nameÚexpect_referenced_by_id)ÚdocumentÚfindallrÚtargetÚ isinstanceÚparentÚ TextElementÚhasattrÚlenÚ next_nodeÚsystem_messageÚ InvisibleÚ TargetableÚextendrrrÚupdateÚgetattrÚ note_refid)ÚselfrrÚidÚnames úC/usr/lib/python3.12/site-packages/docutils/transforms/references.pyÚapplyzPropagateTargets.apply(s€Ø—m‘m×+Ñ+¬E¯L©L×9ˆFä˜6Ÿ=™=¬%×*;Ñ*;Ô<Ø—N‘N 7Ô+¨v¯~©~¸hÔ/GØ—~‘~ iÔ0ØÜ�v“; !Ò#Ð MÐ%MÓ MÐ#Ø×(Ñ(°Ð(Ó5ˆIä˜Y¬×(<Ñ(<Ô=Ø%×/Ñ/°tÀUÐ/ÓK� ô˜Y¬×(<Ñ(<Õ=ðÐ!ܘi¬%¯/©/¼5×;KÑ;KÐ)LÔMÜ" 9¬e¯l©lÔ;ÙØ �eÑ × #Ñ # F¨5¡MÔ 2Ø �gÑ × %Ñ % f¨W¡oÔ 6ä˜9Ð&AÔBØ68� Ô3ܘ9Ð&?Ô@Ø46� Ô1ؘU”m�à(1�— ‘ ×!Ñ! "Ñ%ð9?� ×1Ñ1°"Ò5ð $ð ˜wœ�Øô @ð% U™m¨AÑ.ˆF�7‰OðˆF�5‰MØ ˆF�7‰OØ �M‰M× $Ñ $ VÖ ,ñ[:óN©Ú__name__Ú __module__Ú __qualname__Ú__doc__Údefault_priorityr'©r(r&rrs„ñð*Ðó.-r(rcó—eZdZdZdZd„Zy)ÚAnonymousHyperlinksa¥ Link anonymous references to targets. Given:: internal external Corresponding references are linked via "refid" or resolved via "refuri":: text external i¸có—g}g}|jjtj«D]%}|j d«sŒ|j |«Œ'|jjtj «D]%}|j d«sŒ|j |«Œ't|«t|«k7rÊ|jjjdt|«›dt|«›d�«}|jj|«}|D]k}tj|j|j|¬«}|jj|«}|j|«|j|«Œmyt||«D]v\}} d| _ | j#d«r| d|d<d|_Œ/| ds|jj&| d } ŒD| dd |d <|jj)|«Œxy) NÚ anonymouszAnonymous hyperlink mismatch: z references but z+ targets. See "backrefs" attribute for IDs.©r ér rr r)rrrÚ referenceÚgetÚappendrrÚreporterÚerrorÚset_idÚ problematicÚ rawsourceÚ add_backrefÚ replace_selfÚzipÚ referencedrÚresolvedrr") r#Úanonymous_refsÚanonymous_targetsÚnodeÚmsgÚmsgidÚrefÚprbÚprbidrs r&r'zAnonymousHyperlinks.applyssǀ؈ØÐØ—M‘M×)Ñ)¬%¯/©/Ö:ˆDØ�x‰x˜ Õ$Ø×%Ñ% dÕ+ð;ð—M‘M×)Ñ)¬%¯,©,Ö7ˆDØ�x‰x˜ Õ$Ø!×(Ñ(¨Õ.ð8ô ˆ~Ó ¤#Ð&7Ó"8Ò 8Ø—-‘-×(Ñ(×.Ò.ô˜Õ(¬#Ð.?Õ*@ðBóCˆCð—M‘M×(Ñ(¨Ó-ˆEÛ%�Ü×'Ñ'Ø—m‘m S§]¡]¸%ôA�àŸ ™ ×,Ñ,¨SÓ1�Ø—‘ Ô&Ø× Ñ  Õ%ð &ð ܘ~Ð/@ÖA‰KˆC�Ø !ˆFÔ ØØ—>‘> (Ô+Ø$*¨8Ñ$4�C˜‘MØ#$�C”LØà! %š=à!%§¡×!2Ñ!2°6¸'±?Ñ!C˜Ø Ø#)¨%¡=°Ñ#3�C˜‘LØ—M‘M×,Ñ,¨SÔ1ØñBr(Nr)r/r(r&r1r1Ys„ñð,Ðó$r(r1có8—eZdZdZdZd„Zd„Zd„Zd„Zd„Z d„Z y ) ÚIndirectHyperlinksaN a) Indirect external references:: indirect external The "refuri" attribute is migrated back to all indirect targets from the final direct target (i.e. a target not referring to another indirect target):: indirect external Once the attribute is migrated, the preexisting "refname" attribute is dropped. b) Indirect internal references:: indirect internal Targets which indirectly refer to an internal target become one-hop indirect (their "refid" attributes are directly set to the internal target's "id"). References which indirectly refer to an internal target become direct internal references:: indirect internal iÌcó–—|jjD]0}|js|j|«|j |«Œ2y©N)rÚindirect_targetsrBÚresolve_indirect_targetÚresolve_indirect_references©r#rs r&r'zIndirectHyperlinks.applyÐs9€Ø—m‘m×4Ô4ˆFØ—?’?Ø×,Ñ,¨VÔ4Ø × ,Ñ ,¨VÕ 4ñ5r(cón—|jd«}|€|d}nh|jjj|«}|sA|jjjD] }||«sŒ y|j |«y|jj |}|j|¬«t|tj«rU|jsI|jd«r8t|d«r|j|«yd|_|j|«|`|jd«r|d|d<d|vrq|d=nm|jd«r$|d|d<|jj!|«n8|dr!||d<|jj!|«n|j |«y|�|d=d|_ y)Nr r ©r$Úmultiply_indirectr5r r)r7rÚnameidsÚ transformerÚunknown_reference_resolversÚnonexistent_indirect_targetrÚnote_referenced_byrrrrBrÚcircular_indirect_referencerUrPr")r#rr Ú reftarget_idÚresolver_functionÚ reftargets r&rPz*IndirectHyperlinks.resolve_indirect_targetÖs£€Ø—*‘*˜YÓ'ˆØ ˆ?Ø! '™?‰LàŸ=™=×0Ñ0×4Ñ4°WÓ=ˆLÙ🠙 ×1Ñ1×MÔMð&á(¨Õ0Øðð Nð×4Ñ4°VÔ<ØØ—M‘M×%Ñ% lÑ3ˆ Ø×$Ñ$¨ Ð$Ô5Ü �y¤%§,¡,Ô /Ø×&Ò&Ø×!Ñ! )Ô,Ü�vÐ2Ô3Ø×0Ñ0°Ô8ØØ'(ˆFÔ $Ø × (Ñ (¨Ô 3ØÐ(Ø × Ñ ˜XÔ &Ø(¨Ñ2ˆF�8Ñ Ø˜&Ñ Ø˜7‘OØ × Ñ ˜wÔ 'Ø'¨Ñ0ˆF�7‰OØ �M‰M× $Ñ $ VÕ ,à˜ÒØ".��w‘Ø— ‘ ×(Ñ(¨Õ0à×0Ñ0°Ô8ØØ Ð Ø�yÐ!؈�r(có„—|d|jjvr|j|d«y|j|d«y)Nr z>which is a duplicate, and cannot be used as a unique referencezwhich does not exist)rrVÚindirect_target_errorrRs r&rYz.IndirectHyperlinks.nonexistent_indirect_targetsC€Ø �)Ñ  § ¡ × 5Ñ 5Ñ 5Ø × &Ñ & vð0Nõ Oð × &Ñ & vÐ/EÕ Fr(có(—|j|d«y)Nzforming a circular reference)r`rRs r&r[z.IndirectHyperlinks.circular_indirect_reference s€Ø ×"Ñ" 6Ð+IÕJr(c ó—d}g}|dr d|ddz}|dD]7}|j|jjj|g««Œ9|dD]7}|j|jjj|g««Œ9|dr|d|ddzz }|jj j d|›d|d ›d |›d �|¬ «}|jj|«}tj|«D]k} tj| j| j|¬ «} |jj| «} |j| «| j| «Œmd|_y)NÚrz"%s" rrz (id="%s")zIndirect hyperlink target z refers to target "r z", Ú.©Ú base_noder4r5)rrÚrefnamesr7Úrefidsr9r:r;rÚuniqrr<r=r>r?rB) r#rÚ explanationÚnamingÚreflistr%r$rFrGrHrIrJs r&r`z(IndirectHyperlinks.indirect_target_error sZ€ØˆØˆØ �'Š?ؘv g™¨qÑ1Ñ1ˆFؘ7”OˆDØ �N‰N˜4Ÿ=™=×1Ñ1×5Ñ5°d¸BÓ?Õ @ð$à˜”-ˆBØ �N‰N˜4Ÿ=™=×/Ñ/×3Ñ3°B¸Ó;Õ <ð à �%Š=Ø �k F¨5¡M°!Ñ$4Ñ4Ñ 4ˆFØ�m‰m×$Ñ$×*Ò*☠ Ó*ªKð9ØDJð+óLˆð— ‘ ×$Ñ$ SÓ)ˆÜ—:‘:˜gÖ&ˆCÜ×#Ñ#Ø—-‘- §¡°eô=ˆCà—M‘M×(Ñ(¨Ó-ˆEØ �O‰O˜EÔ "Ø × Ñ ˜SÕ !ð 'ð ˆ�r(có—|jd«rd}|jj}n|jd«rd}d}ny||}|dD]•}|jjj |g«}|r|j |¬«|D]T}|j rŒ|d=|||<|r||«d|_t|tj«sŒD|j|«ŒVŒ—|dD]•}|jjj |g«}|r|j |¬«|D]T}|j rŒ|d=|||<|r||«d|_t|tj«sŒD|j|«ŒVŒ—y) Nr r r©r%r r5rrT) rrr"rgr7rZrBrrrrQrh) r#rÚattnameÚ call_methodÚattvalr%rlrHr$s r&rQz.IndirectHyperlinks.resolve_indirect_references#sf€Ø �>‰>˜'Ô "؈GØŸ-™-×2Ñ2‰KØ �^‰^˜HÔ %؈G؉Kà Ø˜‘ˆØ˜7”OˆDØ—m‘m×,Ñ,×0Ñ0°°rÓ:ˆGÙØ×)Ñ)¨tÐ)Ô4Û�Ø—<’<ØØ˜ �NØ%��G‘ ÙÙ Ô$Ø �” ܘc¤5§<¡<Õ0Ø×4Ñ4°SÕ9ñð $ð˜”-ˆBØ—m‘m×*Ñ*×.Ñ.¨r°2Ó6ˆGÙØ×)Ñ)¨RÐ)Ô0Û�Ø—<’<ØØ˜�LØ%��G‘ ÙÙ Ô$Ø �” ܘc¤5§<¡<Õ0Ø×4Ñ4°SÕ9ññ  r(N) r*r+r,r-r.r'rPrYr[r`rQr/r(r&rLrLšs1„ñ0ðdÐò5ò *òXGòKòó.%:r(rLcó—eZdZdZdZd„Zy)ÚExternalTargetsa¸ Given:: direct external The "refname" attribute is replaced by the direct "refuri" attribute:: direct external i€có\—|jjtj«D]€}|j d«sŒ|d}|dD]_}|jj j |g«}|r|j|¬«|D]}|jrŒ|d=||d<d|_Œ ŒaŒ‚y)Nr rrnr r5) rrrrrrgr7rZrB)r#rr r%rlrHs r&r'zExternalTargets.apply_sž€Ø—m‘m×+Ñ+¬E¯L©LÖ9ˆFØ�~‰~˜hÕ'Ø Ñ)�Ø" 7œO�DØ"Ÿm™m×4Ñ4×8Ñ8¸¸rÓB�GÙØ×1Ñ1°tÐ1Ô<Û&˜ØŸ<š<Ø$Ø  ˜NØ(.˜˜H™ Ø'(˜� ñ 'ñ ,ñ:r(Nr)r/r(r&rsrsKs„ñð Ðó )r(rscó—eZdZdZd„Zd„Zy)ÚInternalTargetsi”cóÊ—|jjtj«D]7}|j d«rŒ|j d«rŒ'|j |«Œ9y)Nr r )rrrrrÚresolve_reference_idsrRs r&r'zInternalTargets.applyssD€Ø—m‘m×+Ñ+¬E¯L©LÖ9ˆFØ—>‘> (Õ+°F·N±NÀ7Õ4KØ×*Ñ*¨6Õ2ñ:r(có —|dD]†}|jjj|«}|jjj|g«}|r|j |¬«|D] }|j rŒ|r|d=||d<d|_Œ"Œˆy)aº Given:: direct internal The "refname" attribute is replaced by "refid" linking to the target's "id":: direct internal rrnr r r5N)rrVr7rgrZrB)r#rr%r rlrHs r&rxz%InternalTargets.resolve_reference_idsxsŠ€ð"˜7”OˆDØ—M‘M×)Ñ)×-Ñ-¨dÓ3ˆEØ—m‘m×,Ñ,×0Ñ0°°rÓ:ˆGÙØ×)Ñ)¨tÐ)Ô4Û�Ø—<’<ØÙؘI˜Ø#(�C˜‘LØ �• ñ ñ $r(N)r*r+r,r.r'rxr/r(r&rvrvos„àÐò3ó !r(rvcóF—eZdZdZdZdZ gd¢Zd„Zd„Zd„Z d„Z d „Z d „Z y) Ú Footnotesaì Assign numbers to autonumbered footnotes, and resolve links to footnotes, citations, and their references. Given the following ``document`` as input:: A labeled autonumbered footnote reference: An unlabeled autonumbered footnote reference: Unlabeled autonumbered footnote. Labeled autonumbered footnote. Auto-numbered footnotes have attribute ``auto="1"`` and no label. Auto-numbered footnote_references have no reference text (they're empty elements). When resolving the numbering, a ``label`` element is added to the beginning of the ``footnote``, and reference text to the ``footnote_reference``. The transformed result will be:: A labeled autonumbered footnote reference: 2 An unlabeled autonumbered footnote reference: 1