
    k7i*                        S r SrSSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
JrJr   " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S  S!\5      r " S" S#\5      rg$)%zb
Directives for additional body elements.

See `docutils.parsers.rst.directives` for API details.
reStructuredText    )nodes)	Directive)
directives)normalize_options)Lexer
LexerErrorNumberLinesc                       \ rS rSrSrSr\R                  \R                  S.r	Sr
Sr \R                  \R                  \R                  \R                   \R"                  \R$                  4r S rSrg)BasePseudoSection   z!Base class for Topic and Sidebar.TclassnameNc                 D   [        U R                  R                  U R                  5      (       a  U R	                  SU R
                  -  5      eU R                  5         U R                  (       a  U R                  S   nU R                  R                  XR                  5      u  p#[        R                  " US/UQ76 /nSU R                  ;   az  U R                  R                  U R                  S   U R                  5      u  p%UR                  [        R                  " U R                  S   S/UQ76 5        UR!                  U5        O/ n/ nSR#                  U R$                  5      nU R&                  " U/XC-   Q76 nUS==   U R                  R)                  S/ 5      -  ss'   U R                  R+                  U R                  5      u  Ul        Ul        U R1                  U5        U(       a1  U R                  R3                  U R$                  U R4                  U5        U/$ )NzBThe "%s" directive may not be used within topics or body elements.r    subtitle
classesr   )
isinstancestate_machinenodeinvalid_parentserrorr   assert_has_content	argumentsstateinline_textlinenor   titleoptionsappendr   extendjoincontent
node_classgetget_source_and_linesourcelineadd_namenested_parsecontent_offset)self
title_text	textnodesmessagestitlesmore_messagestextr   s           ^/home/james-whalen/.local/lib/python3.13/site-packages/docutils/parsers/rst/directives/body.pyrunBasePseudoSection.run*   s   d((--t/C/CDD** 8:>))D E E!>>*J"&**"8"8&0++#?Ikk*b=9=>FT\\)+/::+A+ALL,dkk,;(	ennT\\*-Er 9.79 :.FHyy&t:v'8:Y4<<++GR88((<<T[[I		dJJ##DLL$2E2EtLv     )__name__
__module____qualname____firstlineno____doc__final_argument_whitespacer   class_option	unchangedoption_spechas_contentr&   r   SubStructuralBibliographic
DecorativeBodyParttopicr   r6   __static_attributes__r9   r8   r5   r   r      so    + $&33%//1KKJ<**E,?,?''UZZNOr8   r   c                   0    \ rS rSrSr\R                  rSrg)TopicI      r9   N)	r:   r;   r<   r=   required_argumentsr   rI   r&   rJ   r9   r8   r5   rL   rL   I   s    Jr8   rL   c                   l    \ rS rSrSr\R                  r\R                  S\
R                  0-  r	S rSrg)SidebarO   rN   r   c                 2   [        U R                  R                  [        R                  5      (       a  U R                  SU R                  -  5      eSU R                  ;   a"  U R                  (       d  U R                  S5      e[        R                  U 5      $ )Nz<The "%s" directive may not be used within a sidebar element.r   z6The "subtitle" option may not be used without a title.)r   r   r   r   sidebarr   r   r!   r   r   r6   )r.   s    r5   r6   Sidebar.runV   s|    d((--u}}==** 026))< = =%dnn** 0 1 1 !$$T**r8   r9   N)r:   r;   r<   r=   optional_argumentsr   rT   r&   r   rB   r   unchanged_requiredr6   rJ   r9   r8   r5   rQ   rQ   O   s8    J#// *"?"?3A AK+r8   rQ   c                   T    \ rS rSrSr\R                  \R                  S.rSr	S r
Srg)	LineBlocka   zLegacy directive for line blocks.

Use is deprecated in favour of the line block syntax,
cf. `parsers.rst.states.Body.line_block()`.
r   Tc                 R   U R                  5         [        R                  " U R                  R	                  S/ 5      S9nU R
                  R                  U R                  5      u  Ul        Ul	        U R                  U5        U/n[        U R                  5       H  u  p4U R                  R                  UR                  5       U R                  U R                   -   5      u  pV[        R                  " US/UQ76 nUR                  Ul        UR                  U-   Ul	        UR                  5       (       a*  [#        U5      [#        UR%                  5       5      -
  Ul        X-  nUR)                  U5        U =R                   S-  sl        M     U R                  R+                  U5        U$ )Nr   r   r   rN   )r   r   
line_blockr!   r'   r   r(   r   r)   r*   r+   	enumerater%   r   r   stripr-   lenlstripindentr#   nest_line_block_lines)r.   block	node_listi	line_text
text_nodesr1   r*   s           r5   r6   LineBlock.runl   sJ   !  )9)9'2)FG))==dkkJ		eG	%dll3LA#'::#9#9!4;;1D1D#D$F J::i9j9D,,DK

QDI  !)ns93C3C3E/FFMEX&1$ 4 	

((/r8   r9   N)r:   r;   r<   r=   r>   r   r@   rA   rB   rC   r6   rJ   r9   r8   r5   rY   rY   a   s,     '33%//1KKr8   rY   c                   P    \ rS rSr\R
                  \R                  S.rSrS r	Sr
g)ParsedLiteral   r   Tc                 \   [        U R                  5      nU R                  5         SR                  U R                  5      nU R
                  R                  X R                  5      u  p4[        R                  " US/UQ70 UD6nU R                  S-   Ul        U R                  U5        U/U-   $ )Nr   r   rN   )r   r!   r   r$   r%   r   r   r   r   literal_blockr-   r*   r+   )r.   r!   r4   rh   r1   r   s         r5   r6   ParsedLiteral.run   s    #DLL1!yy&#zz55dKKH
""4DjDGD''!+	dv  r8   r9   Nr:   r;   r<   r=   r   r@   rA   rB   rC   r6   rJ   r9   r8   r5   rk   rk      s%    &33%//1KK!r8   rk   c                   n    \ rS rSrSrSr\R                  \R                  \R                  S.r	Sr
S rSrg)		CodeBlock   zParse and mark up content of a code block.

Configuration setting: syntax_highlight
   Highlight Code content with Pygments?
   Possible values: ('long', 'short', 'none')

rN   )r   r   number-linesTc                    U R                  5         U R                  (       a  U R                  S   nOSn[        U R                  5      nS/nU(       a  UR	                  U5        SU;   a  UR                  US   5         [        SR                  U R                  5      UU R                  R                  R                  R                  5      nSU;   a<   [!        US   =(       d    S	5      nU['        U R                  5      -   n[)        XFU5      n[*        R,                  " SR                  U R                  5      US9nU R/                  U5        SU;   a  US   UR0                  S'   U H?  u  p9U(       a  U[*        R2                  " XUS9-  nM&  U[*        R4                  " U	5      -  nMA     U/$ ! [         ap  nU R                  R                  R                  R                  S:  a,  [        SR                  U R                  5      US5      n S nAGNEU R                  U5      eS nAff = f! ["         a    U R%                  S
5      ef = f)Nr   r   coder   r      nonert   rN   z+:number-lines: with non-integer start valuer\   r)   )r   r   r   r!   r"   r#   r   r$   r%   r   documentsettingssyntax_highlightr	   report_levelwarningint
ValueErrorr   r`   r
   r   rn   r+   
attributesinlineText)
r.   languager!   r   tokensr   	startlineendliner   values
             r5   r6   CodeBlock.run   s   !>>~~a(HH#DLL1(NN8$NN79-.	*499T\\2H::..77HHJF W$P 7 <1=	  #dll"33G G<F""499T\\#:GLdw(/(9DOOH%$NGU7CC 

5)) % v=  	*zz""++881<tyy6&Ill5))	*  Pjj!NOOPs,   ?AF. H+ .
H(8AH#H##H(+Ir9   N)r:   r;   r<   r=   r>   rV   r   r@   rA   rB   rC   r6   rJ   r9   r8   r5   rr   rr      s=     &33%//#-#7#7K K/r8   rr   c                   P    \ rS rSr\R
                  \R                  S.rSrS r	Sr
g)	MathBlock   r   Tc                    [        U R                  5      nU R                  5         SR                  U R                  5      R                  S5      n/ nU H  nU(       d  M  [        R                  " U R                  U40 UD6nU R                  R                  U R                  5      u  Ul        Ul        U R                  U5        UR                  U5        M     U$ )Nr   z

)r   r!   r   r$   r%   splitr   
math_block
block_textr   r(   r   r)   r*   r+   r"   )r.   r!   r%   _nodesrd   r   s         r5   r6   MathBlock.run   s    #DLL1!))DLL)//7E##DOOUFgFD,,@@MT[YMM$MM$  r8   r9   Nrp   r9   r8   r5   r   r      s'    &33%//K
 Kr8   r   c                   X    \ rS rSrSrSrSr\R                  \R                  S.r
S rSrg)	Rubric   rN   r   Tr   c                     [        U R                  5      nU R                  S   nU R                  R	                  X R
                  5      u  p4[        R                  " US/UQ70 UD6nU R                  U5        U/U-   $ )Nr   r   )	r   r!   r   r   r   r   r   rubricr+   )r.   r!   rubric_textr0   r1   r   s         r5   r6   
Rubric.run   sl    #DLL1nnQ'"jj44[++N	k2E	EWEfx(""r8   r9   N)r:   r;   r<   r=   rO   rV   r?   r   r@   rA   rB   r6   rJ   r9   r8   r5   r   r      s2     $&33%//1K#r8   r   c                   "    \ rS rSrSr/ rS rSrg)
BlockQuote   Tc                    U R                  5         U R                  R                  U R                  U R                  5      nU H;  n[        U[        R                  5      (       d  M$  US==   U R                  -  ss'   M=     U$ )Nr   )r   r   block_quoter%   r-   r   r   r   )r.   elementselements      r5   r6   BlockQuote.run  sf    !::))$,,8K8KLG'5#4#455	"dll2"   r8   r9   N)r:   r;   r<   r=   rC   r   r6   rJ   r9   r8   r5   r   r      s    KGr8   r   c                       \ rS rSrS/rSrg)Epigraphi  epigraphr9   Nr:   r;   r<   r=   r   rJ   r9   r8   r5   r   r     s	    lGr8   r   c                       \ rS rSrS/rSrg)
Highlightsi  
highlightsr9   Nr   r9   r8   r5   r   r     	    nGr8   r   c                       \ rS rSrS/rSrg)	PullQuotei  z
pull-quoter9   Nr   r9   r8   r5   r   r     r   r8   r   c                   P    \ rS rSr\R
                  \R                  S.rSrS r	Sr
g)Compoundi  r   Tc                    U R                  5         SR                  U R                  5      n[        R                  " U5      nUS==   U R
                  R                  S/ 5      -  ss'   U R                  R                  U R                  5      u  Ul
        Ul        U R                  U5        U R                  R                  U R                  U R                  U5        U/$ )Nr   r   r   )r   r$   r%   r   compoundr!   r'   r   r(   r   r)   r*   r+   r   r,   r-   )r.   r4   r   s      r5   r6   Compound.run"  s    !yy&~~d#Y4<<++GR88((<<T[[I		d

d.A.A4Hvr8   r9   Nrp   r9   r8   r5   r   r     s%    &33%//1KK	r8   r   c                   B    \ rS rSrSrSrS\R                  0rSr	S r
Srg)	Containeri.  rN   Tr   c                    U R                  5         SR                  U R                  5      n U R                  (       a$  [        R
                  " U R                  S   5      nO/ n [        R                  " U5      nUS   R                  U5        U R                  R                  U R                  5      u  Ul        Ul        U R#                  U5        U R$                  R'                  U R                  U R(                  U5        U/$ ! [         a2    U R                  SU R                  < SU R                  S   < S35      ef = f)Nr   r   z#Invalid class attribute value for "z" directive: "z".r   )r   r$   r%   r   r   r@   r   r   r   r   	containerr#   r   r(   r   r)   r*   r+   r   r,   r-   )r.   r4   r   r   s       r5   r6   Container.run5  s    !yy&	2~~$11$..2CD
 t$Yw'((<<T[[I		d

d.A.A4Hv  	2**99dnnQ/12 2	2s   4D "D <Er9   N)r:   r;   r<   r=   rV   r?   r   rA   rB   rC   r6   rJ   r9   r8   r5   r   r   .  s(     $://0KKr8   r   N)r>   __docformat__docutilsr   docutils.parsers.rstr   r   docutils.parsers.rst.rolesr   docutils.utils.code_analyzerr   r	   r
   r   rL   rQ   rY   rk   rr   r   r   r   r   r   r   r   r   r9   r8   r5   <module>r      s   
 #  * + 8 G G1	 1h + +$	 B!I !">	 >B	 4#Y #" z 
 

 
y $	 r8   