
    k7i<                       S r SSKJr  SrSSKrSSKrSSKJr  SSKJ	r	J
r
  SSKJrJr  SSKJr  S	r\(       a  SS
KJrJr  0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS _S!S"_S#S$_S%S&_S'S(_S)S*_S+S,_0 S-S._S/S0_S1S2_S3S4_S5S6_S7S8_S9S:_S;S<_S=S>_S?S@_SASB_SCSD_SESF_SGSH_SISJ_SKSL_SMSN_ESOSPSQSRSSSTSUSVSWSX.	Er 0 r SY rSrSZ jrSsS[ jrStS\ jrStS] jrStS^ jrStS_ jrSuS` jrSuSa jrSbr  / \ Qr! Sc r"StSd jr#SvSe jr$SwSf jr%\RL                  " Sg\RN                  5      r(Sh r)StSi jr*StSj jr+SuSk jr,SxSl jr-StSm jr.Sn r/SySo jr0SzSp jr1S{Sq jr2g)|z9
This package contains directive implementation modules.
    )annotationsreStructuredTextN)import_module)nodesparsers)split_escaped_whitespaceescape2null)enF)CallableSequence	attention)admonitions	Attentioncaution)r   Cautioncode)body	CodeBlockdanger)r   Dangererror)r   Error	important)r   	Importantnote)r   Notetip)r   Tiphint)r   Hintwarning)r   Warning
admonition)r   
Admonitionsidebar)r   Sidebartopic)r   Topicz
line-block)r   	LineBlockzparsed-literal)r   ParsedLiteralmath)r   	MathBlockrubric)r   Rubricepigraph)r   Epigraph
highlights)r   
Highlightsz
pull-quote)r   	PullQuotecompound)r   Compound	container)r   	Containertable)tablesRSTTablez	csv-table)r9   CSVTablez
list-table)r9   	ListTableimage)imagesImagefigure)r>   Figurecontents)partsContentssectnum)rC   Sectnumheader)rC   Headerfooter)rC   Footerztarget-notes)
referencesTargetNotesmeta)miscMetaraw)rN   Raw)rN   Include)rN   Replace)rN   Unicode)rN   Class)rN   Role)rN   DefaultRole)rN   Title)rN   Date)rN   TestDirective)	includereplaceunicodeclassrolezdefault-roletitledatezrestructuredtext-test-directivec                f   U R                  5       n/ n/ nU[        ;   a  [        U   U4$ Sn UR                  U   nU(       d(   [        R                  U   nUR	                  SU -  5        U(       aD  UR                  R                  S
R                  U5      UR                  S9nUR	                  U5         [        U   u  p [        SU	-   5      n [!        X5      nU[        U'   X4$ ! [         a$  nUR	                  SU< SU< S35         SnANSnAf[
         a(    UR	                  SU < SUR                  < S35         GN
f = f! [
         a    UR	                  S	U -  5        Un GNf = f! [
         a    SU4s $ f = f! [         aM  nUR	                  UR                  R                  SU	< SU < SU< 3UR                  S95        SU4s SnA$ SnAff = f! [         aG    UR	                  UR                  R                  SU
< SU	< SU < S3UR                  S95        SU4s $ f = f)z
Locate and return a directive function from its language-dependent name.
If not found in the current language, check English.  Return None if the
named directive cannot be found.
Nz8Problem retrieving directive entry from language module z: .zNo directive entry for "z" in module "z".z*Using English fallback for directive "%s".z(Trying "%s" as canonical directive name.
)linez docutils.parsers.rst.directives.z"Error importing directive module "z" (directive "z"):
zNo directive class "z").)lower_directives
directivesAttributeErrorappendKeyError__name___fallback_language_modulereporterinfojoincurrent_line_directive_registryr   ImportErrorr   getattr)directive_namelanguage_moduledocumentnormnamemessagesmsg_textcanonicalnamer   message
modulename	classnamemoduledetail	directives                 b/home/james-whalen/.local/lib/python3.13/site-packages/docutils/parsers/rst/directives/__init__.pyr   r   S   sX    ##%HHH;8$h..MF'228< 	%5@@JMOOH,- . ##((IIhh&;&; ) =  3M B
A*LMF.	 )H U  E,;UD 	E 	E F)?+C+CE 	FF  	%OOF,- . %M		%  X~
  ))//>63&& 0 ( 	) X~  ))//*n6&& 0 ( 	) X~ss   C) 'E
 7E1 F G )
E3D1EE
 E.-E.1FF
GAGGGAH0/H0c                    U[         U '   g)zt
Register a nonstandard application-defined directive function.
Language lookups are not needed for such functions.
N)rg   )namer   s     r   register_directiver      s    
 "K    c                X    U (       a#  U R                  5       (       a  [        SU -  5      eg)z
Check for a valid flag option (no argument) and return ``None``.
(Directive option conversion function.)

Raise ``ValueError`` if an argument is found.
z%no argument is allowed; "%s" suppliedN)strip
ValueErrorarguments    r   flagr      s'     HNN$$@8KLLr   c                "    U c  [        S5      eU $ )z
Return the argument text, unchanged.

Directive option conversion function for options that require a value.

Raise ``ValueError`` if no argument is found.
#argument required but none supplied)r   r   s    r   unchanged_requiredr      s     >??r   c                    U c  gU $ )zv
Return the argument text, unchanged.
(Directive option conversion function.)

No argument implies empty string ("").
  r   s    r   	unchangedr      s     r   c                j    U c  [        S5      eSR                  S U R                  5        5       5      $ )z
Return the path argument unwrapped (with newlines removed).
(Directive option conversion function.)

Raise ``ValueError`` if no argument is found.
r   r   c              3  @   #    U  H  oR                  5       v   M     g 7fN)r   .0ss     r   	<genexpr>path.<locals>.<genexpr>   s     @*?Qwwyy*?s   )r   rp   
splitlinesr   s    r   pathr      s4     >??ww@(*=*=*?@@@r   c                v    U c  [        S5      e[        [        U 5      5      nSR                  S U 5       5      $ )z
Return the URI argument with unescaped whitespace removed.
(Directive option conversion function.)

Raise ``ValueError`` if no argument is found.
r    c              3     #    U  H8  nS R                  [        R                  " U5      R                  5       5      v   M:     g7f)r   N)rp   r   unescapesplit)r   parts     r   r   uri.<locals>.<genexpr>   s5      +$)D t 4 : : <==$)s   A A)r   r   r	   rp   )r   rC   s     r   urir      sC     >??(X)>?xx +$)+ + 	+r   c                >    [        U 5      nUS:  a  [        S5      eU$ )zp
Check for a nonnegative integer argument; raise ``ValueError`` if not.
(Directive option conversion function.)
r   z(negative value; must be positive or zerointr   r   values     r   nonnegative_intr      %    
 MEqyCDDLr   c                \     U R                  S5      n [        U 5      $ ! [         a     Nf = f)zk
Check for an integer percentage value with optional percent sign.
(Directive option conversion function.)
z %)rstripri   r   r   s    r   
percentager      s6    
??4( 8$$  s    
++)emexchremvwvhvminvmaxcmmmQinptpcpxc                    [         R                  " U 5      u  p#US:  d  X1;  a$  [        SSR                  S U 5       5      -   5      eU U 3$ )z
Check for a positive argument of one of the `units`.

Return a normalized string of the form "<value><unit>"
(without space inbetween).

To be called from directive option conversion functions.
r   z@not a positive number or measure of one of the following units:
, c              3  6   #    U  H  o(       d  M  Uv   M     g 7fr   r   )r   us     r   r   get_measure.<locals>.<genexpr>  s     .5aA5s   
	)r   parse_measurer   rp   )r   unitsr   units       r   get_measurer     sZ     %%h/KEqyD%Oii.5../0 	0 WTFr   c                (    [        U [        S-   5      $ )Nr   )r   CSS3_LENGTH_UNITSr   s    r   length_or_unitlessr     s    x!2U!:;;r   c                     [        U [        S-   5      $ ! [         a+  n [        U S/5      U-   s SnA$ ! [         a    Uef = fSnAff = f)a  
Return normalized string of a length or percentage unit.
(Directive option conversion function.)

Add <default> if there is no unit. Raise ValueError if the argument is not
a positive measure of one of the valid CSS units (or without unit).

>>> length_or_percentage_or_unitless('3 pt')
'3pt'
>>> length_or_percentage_or_unitless('3%', 'em')
'3%'
>>> length_or_percentage_or_unitless('3')
'3'
>>> length_or_percentage_or_unitless('3', 'px')
'3px'
)%r   N)r   r   r   )r   defaultr   s      r    length_or_percentage_or_unitlessr     sV    "8%6%?@@ 	x".88 	K	s#    
A
5A
AAA
c                    U c  [        S5      eU R                  5       n/ nU H?  n[        R                  " U5      nU(       d  [        SU-  5      eUR	                  U5        MA     U$ )z
Convert the argument into a list of ID-compatible strings and return it.
(Directive option conversion function.)

Raise ``ValueError`` if no argument is found.
r   z"cannot make "%s" into a class name)r   r   r   make_idrj   )r   namesclass_namesr   
class_names        r   class_optionr   3  si     >??NNEK]]4(
ADHII:&	 
 r   z2(?:0x|x|\\x|U\+?|\\u)([0-9a-f]+)$|&#x([0-9a-f]+);$c                N    U R                  5       (       a  [        [        U 5      5      $ [        R	                  U 5      nU(       a>  UR                  S5      =(       d    UR                  S5      n[        [        US5      5      $ U $ ! [         a  n[        SU-  5      eSnAff = f)ap  
Convert a Unicode character code to a Unicode character.
(Directive option conversion function.)

Codes may be decimal numbers, hexadecimal numbers (prefixed by ``0x``,
``x``, ``\x``, ``U+``, ``u``, or ``\u``; e.g. ``U+262E``), or XML-style
numeric character entities (e.g. ``&#x262E;``).  Other text remains as-is.

Raise ValueError for illegal Unicode code values.
         zcode too large (%s)N)isdigitchrr   unicode_patternmatchgroupOverflowErrorr   )r   r   r   r   s       r   unicode_coder   J  s    9<<>>s4y>!#))$/EA8%++a.3ub>** 9.7889s#   (B AB B 
B$BB$c                V    [        U 5      n[        U5      S:  a  [        SU-  5      eU$ )z
A single character is returned as-is.  Unicode character codes are
converted as in `unicode_code`.  (Directive option conversion function.)
r   z8%r invalid; must be a single character or a Unicode code)r   lenr   r   chars     r   single_char_or_unicoder   c  s8    
 !D
4y1} *,01 2 	2Kr   c                D    U S:X  a  SnU$ U S:X  a  SnU$ [        U 5      nU$ )zu
As with `single_char_or_unicode`, but "tab" and "space" are also supported.
(Directive option conversion function.)
tab	spacer   )r   r   s     r   $single_char_or_whitespace_or_unicoder   o  s?    
 5
 K	 
W	 K &h/Kr   c                >    [        U 5      nUS:  a  [        S5      eU$ )z
Converts the argument into an integer.  Raises ValueError for negative,
zero, or non-integer values.  (Directive option conversion function.)
r   z(negative or zero value; must be positiver   r   s     r   positive_intr   }  r   r   c                    SU ;   a  U R                  S5      nOU R                  5       nU Vs/ s H  n[        U5      PM     sn$ s  snf )z
Converts a space- or comma-separated list of values into a Python list
of integers.
(Directive option conversion function.)

Raises ValueError for non-positive-integer values.
,)r   r   )r   entriesentrys      r   positive_int_listr     sB     h..%.."-45WELW555s   Ac                l     [         R                  " U 5        U $ ! [         a    [        SU -  5      ef = f)z}
Verifies the encoding argument by lookup.
(Directive option conversion function.)

Raises ValueError for unknown encodings.
zunknown encoding: "%s")codecslookupLookupErrorr   r   s    r   encodingr     s<    >h O  >1H<==>s    3c                     U R                  5       R                  5       nX!;   a  U$ [        SU < S[	        U5      < 35      e! [         a    [        S[	        U5      -  5      ef = f)a  
Directive option utility function, supplied to enable options whose
argument must be a member of a finite set of possible values (must be
lower case).  A custom conversion function must be written to use it.  For
example::

    from docutils.parsers.rst import directives

    def yesno(argument: str):
        return directives.choice(argument, ('yes', 'no'))

Raise ``ValueError`` if no argument is found or if the argument's value is
not valid (not an entry in the supplied list).
z'must supply an argument; choose from %s"z" unknown; choose from )rf   r   ri   r   format_values)r   valuesr   s      r   choicer     sr    2 &&( $mF&;= > 	>  2B(01 2 	22s   A "A%c                N    SR                  S U S S  5       5      < SU S   < S3$ )Nr   c              3  ,   #    U  H
  nS U-  v   M     g7f)z"%s"Nr   r   s     r   r    format_values.<locals>.<genexpr>  s     %F+Qfqj+s   z, or "r   )rp   )r   s    r   r   r     s+     II%F&"+%FF"2J( (r   c                   ^ ^ SUU 4S jjnU$ )z`
Directive option conversion function.

The argument can be any of `values` or `argument_type`.
c                $   > U T;   a  U $ T" U 5      $ r   r   )r   otherr   s    r   auto_or_othervalue_or.<locals>.auto_or_other  s    vO?"r   )r   strr   )r   r  r  s   `` r   value_orr    s    # #
 r   c                    U (       d  g [         R                  " U 5      $ ! [         a  n[        [	        U5      5      eSnAff = f)z
Return a docutils parser whose name matches the argument.
(Directive option conversion function.)

Return `None`, if the argument evaluates to `False`.
Raise `ValueError` if importing the parser module fails.
N)r   get_parser_classrs   r   r  )r   errs     r   parser_namer
    s?     #''11 #S""#s     
A>A)returnNone)r   r  r  r  )r   r  r  r  )r   r  r  r   r   )r   r  r  z	list[str])r   r  r  z	list[int])r  r  )r   zSequence[str]r  typer  r   )r   r  r  ztype[parsers.Parser])3__doc__
__future__r   __docformat__rer   	importlibr   docutilsr   r   docutils.utilsr   r	   docutils.parsers.rst.languagesr
   rm   TYPE_CHECKINGcollections.abcr   r   rr   rg   r   r   r   r   r   r   r   r   r   r   length_unitsr   r   r   r   compile
IGNORECASEr   r   r   r   r   r   r   r   r   r  r
  r   r   r   <module>r     s  
 #" 	  # # @ J20/0+0 #0 )	0
 '0 /0 %0 #0 %0 +0 10 $0  0 )0 10  #!0" "#0$ &%0& *'0( ))0* &+0, (-00 %102 )304 +506 "708 $90: ';0< %=0> #?0@ #A0F 3G0H I0L _M0N %$$ - )B_0 b5  #8v"


A+	%>  $"# A"<4& **92==J92	6>6(
#r   