Ë òwC!ÉõWãó†—dZdZddlmZddlmZddlmZddl m Z m Z dZ iZ iZ d„Zd „Zd „Zd „Zd „ZGd „d«ZGd„d«Z d3d„Zdej.ie_edej2«edej4«edej6«edej8«edej:«edej<«edej>«edej@« d3d„Z!ede!« d3d„Z"ede"«d3d„Z#d ejHie#_ed!e#« d3d"„Z%d#ejHie%_ed$e%« d3d%„Z&ed&e&« d3d'„Z'ed(e'«ed)e'«ed*e'«ed+e'«ed,e'«ed-e'«ed.e'«ed/e'«ed0e'«d1„Z(d2„Z)y)4a£ This module defines standard interpreted text role functions, a registry for interpreted text roles, and an API for adding to and retrieving from the registry. See also `Creating reStructuredText Interpreted Text Roles`__. __ https://docutils.sourceforge.io/docs/ref/rst/roles.html The interface for interpreted role functions is as follows:: def role_fn(name, rawtext, text, lineno, inliner, options=None, content=None): code... # Set function attributes for customization: role_fn.options = ... role_fn.content = ... Parameters: - ``name`` is the local name of the interpreted text role, the role name actually used in the document. - ``rawtext`` is a string containing the entire interpreted text construct. Return it as a ``problematic`` node linked to a system message if there is a problem. - ``text`` is the interpreted text content, with backslash escapes converted to nulls (````). - ``lineno`` is the line number where the text block containing the interpreted text begins. - ``inliner`` is the Inliner object that called the role function. It defines the following useful attributes: ``reporter``, ``problematic``, ``memo``, ``parent``, ``document``. - ``options``: A dictionary of directive options for customization, to be interpreted by the role function. Used for additional attributes for the generated elements and other functionality. - ``content``: A list of strings, the directive content for customization ("role" directive). To be interpreted by the role function. Function attributes for customization, interpreted by the "role" directive: - ``options``: A dictionary, mapping known option names to conversion functions such as `int` or `float`. ``None`` or an empty dict implies no options to parse. Several directive option conversion functions are defined in the `directives` module. All role functions implicitly support the "class" option, unless disabled with an explicit ``{'class': None}``. - ``content``: A boolean; true if content is allowed. Client code must handle the case where content is required but not supplied (an empty content list will be supplied). Note that unlike directives, the "arguments" function attribute is not supported for role customization. Directive arguments are handled by the "role" directive itself. Interpreted role functions return a tuple of two values: - A list of nodes which will be inserted into the document tree at the point where the interpreted role was encountered (can be an empty list). - A list of system messages, which will be inserted into the document tree immediately after the end of the current inline block (can also be empty). ÚreStructuredTexté)Únodes)Ú directives)Úen)ÚLexerÚ LexerErrorztitle-referencecóŒ—|j«}g}g}|tvr t||fS|rd} |j|}nt}|s( tj|}|j d|z«|r3|jd j|«|¬ «} |j | «|tvrt|} t|| «| |fSd|fS#t$r"}|j d|›d|›d�«Yd}~Œªd}~wt $r%|j d|›d|j ›d�«YŒÚwxYw#t $r|j d |z«|}YŒÕwxYw) a1 Locate and return a role function from its language-dependent name, along with a list of system messages. If the role is not found in the current language, check English. Return a 2-tuple: role function (``None`` if the named role cannot be found) and a list of system messages. Nz3Problem retrieving role entry from language module z: Ú.zNo role entry for "z " in module "z".z%Using English fallback for role "%s".z#Trying "%s" as canonical role name.Ú ©Úline) ÚlowerÚ_rolesÚrolesÚAttributeErrorÚappendÚKeyErrorÚ__name__ÚDEFAULT_INTERPRETED_ROLEÚ_fallback_language_moduleÚinfoÚjoinÚ_role_registryÚregister_local_role) Ú role_nameÚlanguage_moduleÚlinenoÚreporterÚnormnameÚmessagesÚmsg_textÚ canonicalnameÚerrorÚmessageÚrole_fns ú?/usr/lib/python3.12/site-packages/docutils/parsers/rst/roles.pyÚroler'fsn€ð�‰Ó €HØ€HØ€Hà”6ÑÜ�hÑ Ð)Ð)áØˆ ð EØ+×1Ñ1°(Ñ;‰Mô1ˆ ñ ð %Ü5×;Ñ;¸HÑEˆMØ �O‰OÐCØ'ñ(ô )ñØ—-‘- § ¡ ¨(Ó 3¸&�-ÓAˆØ�‰˜Ô ðœÑ&Ü  Ñ/ˆÜ˜H gÔ.Ø˜Ð Ð Ø �ˆ>Ðøô?ò IØ �OŠOÚ0?ÂðH÷ Iñ Iûäò EØ �OŠOÚ(¨/×*BÓ*BðDö Eð Eûôò %Ø �O‰OÐAØ'ñ(ô )ð%ŠMð  %ús/­CÁ'D!à DÃC-Ã-.DÄDÄ!EÅEcóH—t|«|t|j«<y)zÑ Register an interpreted text role by its canonical name. :Parameters: - `name`: The canonical name of the interpreted role. - `role_fn`: The role function. See the module docstring. N)Úset_implicit_optionsrr©Únamer%s r&Úregister_canonical_roler,œs€ô˜Ô!Ø#*„N�4—:‘:“<Ò ócóH—t|«|t|j«<y)zõ Register an interpreted text role by its local or language-dependent name. :Parameters: - `name`: The local or language-dependent name of the interpreted role. - `role_fn`: The role function. See the module docstring. N)r)rrr*s r&rr¨s€ô˜Ô!Ø"„Fˆ4�:‰:‹<Òr-có¼—t|d«r |j€dtji|_yd|jvrtj|jd<yy)z] Add customization options to role functions, unless explicitly set or disabled. ÚoptionsNÚclass)Úhasattrr0rÚ class_option)r%s r&r)r)´sN€ô �7˜IÔ &¨'¯/©/Ð*AØ"¤J×$;Ñ$;Ð<ˆ�Ø ˜Ÿ™Ñ 'Ü#-×#:Ñ#:ˆ�‰˜Ò ð (r-có4—t||«}t||«y)zAFor roles which simply wrap a given `node_class` around the text.N)Ú GenericRoler,)Úcanonical_nameÚ node_classr's r&Úregister_generic_roler8¿s€ä �~ zÓ 2€DܘN¨DÕ1r-có —eZdZdZd„Z dd„Zy)r5zr Generic interpreted text role. The interpreted text is simply wrapped with the provided node class. có —||_||_y©N)r+r7)Úselfrr7s r&Ú__init__zGenericRole.__init__Ìs€ØˆŒ Ø$ˆ�r-NcóF—t|«}|j||fi|¤ŽggfSr;)Únormalized_role_optionsr7)r<r'ÚrawtextÚtextrÚinlinerr0Úcontents r&Ú__call__zGenericRole.__call__Ðs,€ä)¨'Ó2ˆØ�—‘ ¨Ñ9°Ñ9Ð:¸BÐ>Ð>r-©NN©rÚ __module__Ú __qualname__Ú__doc__r=rD©r-r&r5r5Ås„ñò %ð (,ô?r-r5có"—eZdZdZdd„Z dd„Zy)Ú CustomRolez*Wrapper for custom interpreted text roles.Ncó„—||_||_t|dd«|_t|dd«|_||_||_y)Nr0rC)r+Ú base_roleÚgetattrr0rCÚsupplied_optionsÚsupplied_content)r<rrNr0rCs r&r=zCustomRole.__init__Ùs@€ØˆŒ Ø"ˆŒÜ˜y¨)°TÓ:ˆŒ ܘy¨)°TÓ:ˆŒ Ø 'ˆÔØ 'ˆÕr-c óè—t|j«} |j|«|jxsg} |xsg}| r|rdgng} |j ||||||| | z|z¬«S#t$rYŒHwxYw)Nr )r0rC)r?rPÚupdateÚ TypeErrorrQrN) r<r'r@rArrBr0rCÚoptsrQÚ delimiters r&rDzCustomRole.__call__ás’€ä& t×'<Ñ'<Ó=ˆð Ø �K‰K˜Ô ð ×0Ñ0Ò6°BÐØ’-˜RˆÙ.±7�T‘FÀˆ Ø�~‰~˜d G¨T°6¸7Ø&*Ø&6°yÑ&@ÀÑ&HðóJð Jøô ò Ù ð ús—A%Á% A1Á0A1rErFrJr-r&rLrLÖs„Ù4ó(ð(,ô Jr-rLNcóL—t|«}tj||fi|¤ŽggfS)z9Base for custom roles if no other base role is specified.)r?rÚinline)r'r@rArrBr0rCs r&Úgeneric_custom_rolerYñs,€ô & gÓ.€GÜ �L‰L˜ $Ñ 2¨'Ñ 2Ð 3°RÐ 7Ð7r-r1Ú abbreviationÚacronymÚemphasisÚliteralÚstrongÚ subscriptÚ superscriptcóΗt|«} ttj|««}|dks|dkDrt‚ |jjj|jjj|zz} tj|d|zfd| i|¤ŽggfS#t$r<|j j d|z|¬«}|j|||«} | g|gfcYSwxYw)Nri'z} |jj| «} |j||| «} | g| gfcYd} ~ Sd} ~ wwxYw)NÚlanguageÚÚcodeÚclassesT)rˆ)r?ÚgetÚextendrrrrdrgrhÚsyntax_highlightrrrrfr]rXÚText)r'r@rArrBr0rCr…rˆÚtokensr#rmrnrzÚvalues r&Ú code_roler�Us1€ä% gÓ.€GØ�{‰{˜: rÓ*€H؈h€GØ�GÑØ�‰�w˜yÑ)Ô*Ù�H GÑ+Ø�‰�xÔ ðÜ”u—~‘~ d¨DÓ1°8Ø×'Ñ'×0Ñ0×AÑAóCˆô �=‰=˜ "¨gÔ 6€Dó!‰ˆ�Ù Ø ”E—L‘L ¨°wÔ?Ñ ?‰Dð ”E—J‘J˜uÓ%Ñ %‰Dð !ð ˆ6�2ˆ:Ðøô òØ×Ñ×&Ñ& uÓ-ˆØ×!Ñ! '¨7°CÓ8ˆØˆu�s�eˆ|ÕûðúsÁ?C-Ã- D4Ã63D/Ä)D4Ä/D4r…r‡có|—t|«}tj|d«}tj||fi|¤Ž}|ggfS)NT)r?rrdÚmath)r'r@rArrBr0rCrzs r&Ú math_roler’xs=€ä% gÓ.€GÜ �>‰>˜$ Ó %€DÜ �:‰:�g˜tÑ / wÑ /€DØ ˆ6�2ˆ:Ðr-r‘cót—|jjd|z|¬«}|j|||«}|g|gfS)Nz+Interpreted text role "%s" not implemented.r )rr#rf) r'r@rArrBr0rCrmrns r&Úunimplemented_roler”‡sJ€à × Ñ × Ñ Ø5¸Ñ<À6ð !ó K€Cà × Ñ ˜g w°Ó 4€CØ ˆ5�3�%ˆ<Ðr-Úindexznamed-referencezanonymous-referencez uri-referencezfootnote-referencezcitation-referencezsubstitution-referenceÚtargetz#restructuredtext-unimplemented-rolecó6—|rd|vrd|vsJ‚|d|d<|d=yyy)z7Deprecated. Obsoleted by ``normalized_role_options()``.r1rˆNrJ)r0s r&Ú set_classesr˜�s:€ñ �7˜gÑ%Ø Ñ'Ð'Ð'Ø$ WÑ-ˆ� ÑØ �GÑ ð&€wr-cóX—|€iS|j«}d|vrd|vsJ‚|d|d<|d=|S)zš Return normalized dictionary of role options. * ``None`` is replaced by an empty dictionary. * The key 'class' is renamed to 'classes'. r1rˆ)Úcopy)r0Úresults r&r?r?©sI€ð€Øˆ Ø �\‰\‹^€FØ�&ÑØ Ñ&Ð&Ð&Ø" 7™OˆˆyÑØ �7ˆOØ €Mr-rE)*rIÚ __docformat__ÚdocutilsrÚdocutils.parsers.rstrÚdocutils.parsers.rst.languagesrrÚdocutils.utils.code_analyzerrrrrrr'r,rr)r8r5rLrYr3r0rZr[r\r]r^r_r`Útitle_referencerpr{rƒÚ unchangedr�r’r”r˜r?rJr-r&Úr£s"ðñ FðP#€ õÝ+ÝJß:à,Ððð €ðð €ðò3òl +ò #ò;ò2÷ ?ñ?÷"JñJð8/3ó8ð '¨ ×(?Ñ(?Ð@ÐÔñ�n e×&8Ñ&8Ô9Ù�i §¡Ô/Ù�j %§.¡.Ô1Ù�i §¡Ô/Ù�h § ¡ Ô-Ù�k 5§?¡?Ô3Ù�m U×%6Ñ%6Ô7ÙÐ'¨×)>Ñ)>Ô?ð.2óPñ&˜Ð);Ô<ð.2óñ2˜Ð);Ô<óð&˜j×2Ñ2Ð3€ÔᘘxÔ(ð%)óð<  ×!5Ñ!5Ð6€ Ôᘠ Ô*ð%)óñ˜  Ô*ð.2óñ˜Ð!3Ô4ÙÐ)Ð+=Ô>ÙÐ-Ð/AÔBÙ˜Ð);Ô<ÙÐ,Ð.@ÔAÙÐ,Ð.@ÔAÙÐ0Ð2DÔEÙ˜Ð"4Ô5ñÐ=Ø*ô,ò ór-