
    ͆h/5                       S SK Jr  S SKrS SKrS SKrS SKrS SKJrJr  S SK	J
r
Jr  S SKrS SKJr  S SKrS SKJr  S SKJrJr  S SKJrJrJrJrJr  S S	KJrJr  S S
KJr  S SKJ r   S SKJ!r!  \(       a  S SK"J#r#  \RH                  " \%5      r&  S           SS jjr'            SS jr(            SS jr)SS jr*SSS jjr+  S               S S jjr,SSS.S!S jjr-S"S jr.g)#    )annotationsN)TYPE_CHECKINGSequence)urljoinurlsplit)TemplateNotFound)utils)Abort
BuildError)FileFilesInclusionLevel	get_filesset_exclusions)
Navigationget_navigation)Page)DuplicateFilter)	templates)MkDocsConfigc                   Ub!  [         R                  " SUR                  5      nUR                   Vs/ s H#  n[         R                  " [        U5      X45      PM%     nnUR                   Vs/ s H  n[         R                  " XsU5      PM     nn[        U[        5      (       a  UR                  5       n[        R                  " U UUUU[        R                  [         R                  " 5       UUS9	$ s  snf s  snf )z9Return the template context for a given page or template..)	navpagesbase_url	extra_cssextra_javascriptmkdocs_versionbuild_date_utcconfigpage)r	   get_relative_urlurlr   normalize_urlstrr   
isinstancer   documentation_pagesr   TemplateContextmkdocs__version__get_build_datetime)	r   filesr    r!   r   scriptr   pathr   s	            M/opt/services/DDDS/venv/lib/python3.13/site-packages/mkdocs/commands/build.pyget_contextr0      s     ))#txx8 HNG^G^G^VCK8G^   HNGWGWXGWt$$T:GWIX%))+$$)))//1
 
 Ys   *C2-!C7c                   UR                   R                  XUS9n[        R                  " U 5      (       a)  [	        UR
                  =(       d    S5      R                  nO[        R                  " SU 5      n[        XBX5S9nUR                   R                  X`US9nUR                  U5      nUR                   R                  XpUS9nU$ )z6Return rendered output for given template as a string.)template_namer    /r   )r   )pluginson_pre_templater	   is_error_templater   site_urlr.   r"   r0   on_template_contextrenderon_post_template)nametemplater,   r    r   r   contextoutputs           r/   _build_templater?   =   s    
 ~~--hSY-ZHt$$ FOO2s388))#t4#f@G nn00U[0\G__W%F ^^,,VPV,WFM    c                   [         R                  SU  35         UR                  U 5      n[        XX#U5      nUR                  5       (       Ga  [        R                  R                  UR                  U 5      n[        R                  " UR                  S5      U5        U S:X  a  [         R                  SU  35        U S3n[        US	5       n	[        R                  " UR!                  5        V	s/ s H  oR"                  c  M  U	R"                  PM     sn	S
9n
[$        R&                  " W	US	U
S9 nUR)                  UR                  S5      5        SSS5        SSS5        gg[         R+                  SU  S35        g! [         a    [         R	                  SU  S35         gf = fs  sn	f ! , (       d  f       N`= f! , (       d  f       g= f)z-Build a template using the theme environment.zBuilding theme template: Template skipped: 'z!' not found in theme directories.Nutf-8zsitemap.xmlzGzipping template: z.gzwb)r   )fileobjfilenamemodemtime' generated empty output.)logdebugget_templater   warningr?   striposr.   joinsite_dirr	   
write_fileencodeopenget_build_timestampr'   r!   gzipGzipFilewriteinfo)r2   envr,   r    r   r<   r>   output_pathgz_filenamef	timestampgz_bufs               r/   _build_theme_templater`   [   s    II)-9:##M2
 ]eSIF||~~ggll6??MBw/=M)II+M?;<(M-Kk4(A!55+0+D+D+F]+Fa&&6166+F]	 ]]$iLLw!78	 )( * 	&}o5NOP-  )-8YZ[ ^ 	 )(sM   E= #F<0F&
F&
F<0!F+F<=#F#"F#&F<+
F9	5F<<
G
c                   [         R                  SU  35        UR                  U 5      nUc  [         R                  SU  S35        g [        R
                  " UR                  5      n[        XXU5      nUR                  5       (       a1  [        R                  " UR                  S5      UR                  5        g[         R                  SU  S35        g! [         a%  n[         R                  SU  SU 35         SnAgSnAff = f)	z5Build user templates which are not part of the theme.zBuilding extra template: NrB   z' not found in docs_dir.zError reading template 'z': rC   rI   )rJ   rK   get_file_from_pathrM   jinja2Templatecontent_string	Exceptionr?   rN   r	   rR   rS   abs_dest_pathrY   )r2   r,   r    r   filer<   er>   s           r/   _build_extra_templaterj   |   s    II)-9:##M2D|)-8PQR??4#6#67
 ]eSIF||~~w/1C1CD&}o5NOP  .}oSDEs    C 
DC??DFc                   Xl          U(       a(  U R                  R                  5       (       d	   SUl         gUR                  R	                  XUS9n U R                  U5        U R                  c   eUR                  R                  U R                  XUS9U l        U R                  X5        U R                  c   eUR                  R                  U R                  XUS9U l	         SUl         g! [         aR  nSU R                  R                   S3n[        U[        5      (       d  USU 3-  n[        R!                  U5        e SnAff = f! SUl         f = f)z4Read page content from docs_dir and render Markdown.Nr    r,   )r!   r    r,   zError reading page '': )_current_pagerh   is_modifiedr4   on_pre_pageread_sourcemarkdownon_page_markdownr9   contenton_page_contentrf   src_urir&   r   rJ   error)r!   r    r,   dirtyri   messages         r/   _populate_pager{      sD    $ ..008  $3 ~~))$U)K }}((( 77MM5 8 
 	F"||''' ~~55LLt% 6 
  $  ():):(;2>!Z((1#wG		'  $s*   &C. B.C. .
E
8AEE

E 	Ec                   Xl          U(       a/  U R                  R                  5       (       d   SU l        SUl         g[        R                  SU R                  R                   35        SU l        [        X2X5      nUR                  U R                  R                  SS5      5      nUR                  R                  XpXS9nU(       a  SU R                  =(       d    S	-   U l        UR                  U5      n	UR                  R                  XUS
9n	U	R!                  5       (       a:  ["        R$                  " U	R'                  SSS9U R                  R(                  5        O.[        R+                  SU R                  R                   S35         SU l        SUl         g! [,         aR  n
SU R                  R                   S3n[/        U
[0        5      (       d  USU
 3-  n[        R3                  U5        e Sn
A
ff = f! SU l        SUl         f = f)z;Pass a Page to theme template and write output to site_dir.FNzBuilding page Tr<   z	main.html)r!   r    r   zh<div class="mkdocs-draft-marker" title="This page will not be included into the built site.">DRAFT</div> )r!   r    rC   xmlcharrefreplace)errorszPage skipped: 'z'. Generated empty output.zError building page 'rm   rn   )ro   rh   rp   activerJ   rK   rw   r0   rL   metagetr4   on_page_contextru   r9   on_post_pagerN   r	   rR   rS   rg   rY   rf   r&   r   rx   )r!   r    	doc_filesr   rZ   ry   excludedr=   r<   r>   ri   rz   s               r/   _build_pager      s     2$ ..00Z #Y 			N499#4#4"567 cf; ##DIIMM*k$JK ..00F0\ LL.B0 L ) ,,Vv,N <<>>g.ABDIID[D[ HHtyy'8'8&99STU #  )$))*;*;)<B?!Z((1#wG		' #s<   &F D!F G<  -F G< 
G9'AG44G99G< <H)	serve_urlry   c               F   [         R                  " S5      n[        R                  " 5       nUR	                  [         R
                  5        U R                  (       a%  [         R                  " S5      R                  U5        U(       a  [        R                  O[        R                  n [        R                  " 5       nU R                  R                  U 5      n U R                  R                  U S9  U(       d6  [         R#                  S5        [        R$                  " U R&                  5        O[         R)                  S5        U(       dX  [         R#                  SU R&                   35        U(       a/  [+        U R&                  5      (       a  [         R#                  S5        [-        U 5      nU R.                  R1                  5       nUR3                  X5        U R                  R5                  XpS9n[7        Xp5        [9        Xp5      n	U R                  R;                  XUS9n	[         R=                  S5        / n
UR?                  US	9 H  n[         R=                  S
UR@                   35        URB                  cu  URD                  RG                  5       (       aV  U(       aC  URD                  RI                  5       (       a$  U
RK                  [M        XRN                  5      5        [Q        SX5        URB                  c   e[S        URB                  XU5        M     U
(       a'  [         R#                  SSRU                  U
5      -   5        U R                  RW                  XUS9n[         R=                  S5        URY                  X%S9  U R.                  RZ                   H  n[]        XXpU	5        M     U R^                   H  n[a        XX	5        M     [         R=                  S5        UR?                  US	9nU H@  nURB                  c   e[c        URB                  XXX+RD                  RI                  5       S9  MB     U Rd                  Rf                  Rh                  nU H+  nURB                  c   eURB                  Rk                  X~S9  M-     U R                  Rm                  U S9  URo                  5       =n(       a'  SRU                  S U 5       5      n[q        SU S35      e[         R#                  S[        R                  " 5       U-
  S S35         UR                  U5        g! [r         a]  nU R                  Ru                  US9  [w        U[x        5      (       a)  [         R{                  [}        U5      5        [q        S5      ee SnAff = f! UR                  U5        f = f)zPerform a full site build.r)   )r    zCleaning site directoryzA 'dirty' build is being performed, this will likely lead to inaccurate navigation and other links within your site. This option is designed for site development purposes only.z%Building documentation to directory: z?The directory contains stale files. Use --clean to remove them.rl   zReading markdown pages.)	inclusionz	Reading: NzThe following pages are being built only for the preview but will be excluded from `mkdocs build` per `draft_docs` config:
  - z
  - zCopying static assets.)ry   r   zBuilding markdown pages.)r   )r,   	log_levelz, c              3  R   #    U  H  u  pU S UR                  5        S3v   M     g7f)rn   sN)lower).0kvs      r/   	<genexpr>build.<locals>.<genexpr>^  s%     CFDAqc1779+Q/Fs   %'zAborted with z in strict mode!zDocumentation built in z.2fz seconds)rx   zAborted with a BuildError!)@logging	getLoggerr	   CountHandlersetLevelWARNINGstrict
addHandlerr   is_in_serveis_includedtime	monotonicr4   	on_configon_pre_buildrJ   rY   clean_directoryrQ   rM   #site_directory_contains_stale_filesr   themeget_envadd_files_from_themeon_filesr   r   on_navrK   r'   rw   r!   r   is_not_in_navis_excludedappendr   r#   r   r{   rP   on_envcopy_static_filesstatic_templatesr`   extra_templatesrj   r   
validationlinksanchorsvalidate_anchor_linkson_post_build
get_countsr
   rf   on_build_errorr&   r   rx   r%   removeHandler)r    r   ry   loggerwarning_counterr   startr,   rZ   r   r   rh   r<   r   r   countsmsgri   s                     r/   buildr      sq   x(F ((*OW__-}}(#..?.7**^=W=WIg.  ))&1 	##6#2HH./!!&//2 KKg
 HH<V__<MNO<V__MMZ[ &!ll""$""3/ '''=u%U+ nn##Ce#D		+,--	-BDII	$,,01yy T^^%A%A%C%C!;!;!=!=OOGIxx$@AT4(99(((499fU; C HHZ--)* nn##Ce#D
 			*+eA55H!(D 6 ..H!(6? / 			,---	-B	D99(((		6cHbHbHd  %%++33	D99(((II++%+M 
 	$$F$3$//1161))CFCCC-u,<=>>*4>>+;e+CC*HQR 	_-  %%A%.a$$IIc!f455 	_-s&   )Q'T# #
V
-AVV

V V c                    [        [        R                  R                  U 5      =(       a    [        R                  " U 5      5      $ )zGCheck if the site directory contains stale files from a previous build.)boolrO   r.   existslistdir)site_directorys    r/   r   r   o  s(    ~.M2::n3MNNr@   )Nr}   )r   r   r,   zSequence[File] | Filesr    r   r!   zPage | Noner   r%   returnztemplates.TemplateContext)r;   r%   r<   zjinja2.Templater,   r   r    r   r   r   r   r%   )r2   r%   rZ   jinja2.Environmentr,   r   r    r   r   r   r   None)r2   r%   r,   r   r    r   r   r   )F)
r!   r   r    r   r,   r   ry   r   r   r   )FF)r!   r   r    r   r   zSequence[File]r   r   rZ   r   ry   r   r   r   r   r   )r    r   r   z
str | Nonery   r   r   r   )r   r%   r   r   )/
__future__r   rV   r   rO   r   typingr   r   urllib.parser   r   rc   jinja2.exceptionsr   r)   r	   mkdocs.exceptionsr
   r   mkdocs.structure.filesr   r   r   r   r   mkdocs.structure.navr   r   mkdocs.structure.pagesr   mkdocs.utilsr   r   mkdocs.config.defaultsr   r   __name__rJ   r0   r?   r`   rj   r{   r   r   r    r@   r/   <module>r      s   "   	  * *  .   / Y Y ; ' ( "3 ! 	!  	
  @
(16@LS]<QQ/Q8=QGSQZdQ	QBQ.#$X =$
=$=$ =$ 
	=$
 
=$ =$ =$ 
=$@ <@u s.lOr@   