
    2yiI#                    0   d dl mZ d dlZd dlmZmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZmZ d d	lmZ erd d
lmZ d dlmZ  ej.                  e      Z G d d      Z G d de      Z G d de      ZddZddZ ed      ZddZ ddZ!ddZ"y)    )annotationsN)TYPE_CHECKINGIteratorTypeVar)urlsplit)
BuildError)StructureItem)file_sort_key)Page_AbsoluteLinksValidationValue)
nest_paths)MkDocsConfig)Filesc                  F    e Zd ZU d
dZded<   	 ded<   	 ddZddZddZy	)
Navigationpages
list[Page]c                f    || _         || _        d | _        |D ]  }|j                  s|| _         y  y N)itemsr   homepageis_homepage)selfr   r   pages       V/var/www/html/content_weaver/venv/lib/python3.12/site-packages/mkdocs/structure/nav.py__init__zNavigation.__init__   s9    

 	D $	    zPage | Noner   c                2    dj                  d | D              S )N
c              3  <   K   | ]  }|j                           y wr   )_indent_print).0items     r   	<genexpr>z%Navigation.__str__.<locals>.<genexpr>'   s     ?$++-?s   )joinr   s    r   __str__zNavigation.__str__&   s    yy?$???r   c                ,    t        | j                        S r   )iterr   r&   s    r   __iter__zNavigation.__iter__)   s    DJJr   c                ,    t        | j                        S r   )lenr   r&   s    r   __len__zNavigation.__len__,   s    4::r   N)r   listr   r   returnNone)r/   str)r/   r   )r/   int)__name__
__module____qualname__r   __annotations__r'   r*   r-    r   r   r   r      s+     Ve@ r   r   c                       e Zd ZU ddZd Zded<   	 ded<   	 edd       Zej                  dd	       Zd
Z	ded<   	 dZ
ded<   	 dZded<   	 dd fdZ xZS )Sectiontitler1   childrenlist[StructureItem]c                .    || _         || _        d| _        y )NF)r:   r;   active)r   r:   r;   s      r   r   zSection.__init__1   s    
 r   c                R    | j                   j                  }| d| j                  dS )N(title=))	__class__r3   r:   )r   names     r   __repr__zSection.__repr__7   s(    ~~&&wtzznA..r   boolc                    | j                   S )z
        When `True`, indicates that a child page of this section is the current page and
        can be used to highlight the section as the currently viewed section. Defaults
        to `False`.
        )_Section__activer&   s    r   r>   zSection.activeA   s     }}r   c                r    t        |      | _        | j                  t        |      | j                  _        yy)z+Set active status of section and ancestors.N)rE   rG   parentr>   )r   values     r   r>   zSection.activeJ   s.     U;;"!%eDKK #r   T
is_sectionFis_pageis_linkc                    t         |   |      g}| j                  D ]%  }|j                  |j                  |dz                ' dj	                  |      S )N   r   )superr!   r;   appendr%   )r   depthretr#   rB   s       r   r!   zSection._indent_printZ   sQ    w$U+,MM 	6DJJt))%!)45	6yy~r   )r:   r1   r;   r<   r/   r0   )r/   rE   )rJ   rE   )r   )rR   r2   r/   r1   )r3   r4   r5   r   rD   r6   propertyr>   setterrK   rL   rM   r!   __classcell__)rB   s   @r   r9   r9   0   s}    / J#!!m  ]]- - JhGTfGTf r   r9   c                      e Zd ZU ddZd Zded<   	 ded<   	 dZded<   	 d	Zd
ed<   	 d	Zd
ed<   	 d	Z	d
ed<   	 dZ
d
ed<   y)Linkr:   r1   urlc                     || _         || _        y r   )r:   rY   )r   r:   rY   s      r   r   zLink.__init__b   s    
r   c                    | j                   j                  }| j                  | j                  nd}| d| d| j                  dS )Nz[blank]r@   z, url=rA   )rB   r3   r:   rY   )r   rC   r:   s      r   rD   zLink.__repr__f   sD    ~~&&%)ZZ%;4::.wugVDHH<q99r   Nr0   r;   FrE   r>   rK   rL   TrM   )r:   r1   rY   r1   )r3   r4   r5   r   rD   r6   r;   r>   rK   rL   rM   r7   r   r   rX   rX   a   sc    :
 JW	H5 HdKFDPJfGTcGTbr   rX   c                   | j                         }|d   }|#t        |t              }t        d |D              }t	        || |      }t        |t              s|g}t        |t              }t        |       t        |       g }|D ]R  }|j                  t        d||       |j                  j                         s8|j                  |j                         T |rFt         j!                  |j"                  j$                  j&                  ddj)                  |      z          t        |t*              }|D ]  }	t-        |	j.                        \  }
}}}}|
s|r$t         j1                  d|	j.                   d       G|	j.                  j3                  d	      rs|j"                  j$                  j4                  t6        j8                  urCt         j!                  |j"                  j$                  j4                  d
|	j.                   d       t         j!                  |j"                  j$                  j:                  d|	j.                   d        t=        ||      S )z,Build site navigation from config and files.navN)keyc              3  j   K   | ]+  }|j                   j                         s|j                   - y wr   )	inclusion	is_in_navsrc_uri)r"   fs     r   r$   z!get_navigation.<locals>.<genexpr>   s#     ba!++J_J_Ja		bs   33zfThe following pages exist in the docs directory, but are not included in the "nav" configuration:
  - z
  - zAn external link to 'z)' is included in the 'nav' configuration./zAn absolute path to 'zZ' is included in the 'nav' configuration, which presumably points to an external resource.A reference to 'zX' is included in the 'nav' configuration, which is not found in the documentation files.)documentation_pagessortedr
   r   _data_to_navigation
isinstancer.   _get_by_typer   _add_previous_and_next_links_add_parent_linksr   r`   ra   rQ   src_pathlog
validationr]   omitted_filesr%   rX   r   rY   debug
startswithabsolute_linksr   RELATIVE_TO_DOCS	not_foundr   )filesconfigrf   
nav_configr   r   missing_from_configfilelinkslinkschemenetlocpathqueryfragments                  r   get_navigationr      s   335J$%8mLb3Fbb

E6:EeT" %E !'e# :99 tV$~~'')#**4==9: !!//9;C==I\;]^	
 %E 080B-eXVII-dhhZ7`abHH$!!%%440AAB GG!!%%44'z 2R R GG!!%%//"488* -P P( eU##r   c                
   t        | t              rX| j                         D cg c]<  \  }}t        |t              rt	        ||f||      nt        |t	        |||            > c}}S t        | t              rI| D cg c]=  }t        |t              rt        |      dk(  rt	        |||      d   nt	        |||      ? c}S t        | t              r| nd | f\  }}|}|j                  d      rA|j                  j                  j                  t        j                  u r|j                  d      }|j!                  |      x}	r|	j"                  j%                         rZt&        j'                  t)        t*        j,                  |j                  j                  j.                        d|	j0                   d       |	j2                  }
|
t        |
t4              st7        d      |
S t5        ||	|      S t9        ||      S c c}}w c c}w )N)r:   r;   rO   r   rd   re   zX' is included in the 'nav' configuration, but this file is excluded from the built site.z5A plugin has set File.page to a type other than Page.)ri   dictr   r1   rh   r9   r.   r,   tuplerr   ro   r]   rs   r   rt   lstripget_file_from_pathr`   is_excludedrn   minloggingINFOru   rm   r   r   r   rX   )datarv   rw   r^   rJ   r#   r:   r   lookup_pathrz   r   s              r   rh   rh      s   $
 #jjl	
 U %%  eeV<s-@v-VWX
 	
 
D$	
 	
  $%#d)q.  eV4Q7$T5&9:
 	
 %T51$d|KE4Ks#!!004Q4b4bb!((-''44t4>>%%'GGGLL&"3"3"7"7"A"AB"4==/ 2P P
 yydD) !XYYKE4((tC

s   AG:=AH Tc                    g }| D ]Q  }t        ||      r|j                  |       |j                  s-|j                  t	        |j                  |             S |S r   )ri   rQ   r;   extendrj   )r]   trS   r#   s       r   rj   rj      sQ    
C 7dAJJt==JJ|DMM156	7
 Jr   c                    | D ]<  }|j                   s|j                  D ]	  }||_         t        |j                         > y r   )rK   r;   rI   rl   )r]   r#   childs      r   rl   rl      s>     -?? $#$dmm,	-r   c                l    d g| d }t        |d d | |dd        }|D ]  \  }}}||c|_        |_         y )N   )zipprevious_page	next_page)r   	bookendedzippedpage0page1page2s         r   rk   rk      sU    $$t$I3B	!"6F% <ue/4e,U_<r   )rv   r   rw   r   r/   r   )rv   r   rw   r   )r   ztype[T]r/   zlist[T])r/   r0   )r   r   r/   r0   )#
__future__r   r   typingr   r   r   urllib.parser   mkdocs.exceptionsr   mkdocs.structurer	   mkdocs.structure.filesr
   mkdocs.structure.pagesr   r   mkdocs.utilsr   mkdocs.config.defaultsr   r   	getLoggerr3   rn   r   r9   rX   r   rh   r   rj   rl   rk   r7   r   r   <module>r      s    "  3 3 ! ( * 0 F #3, g! 6.m .bc= cB7$t#L CL-<r   