ó
    û¦Ög/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	            Ú7/usr/lib/python3/dist-packages/mkdocs/commands/build.pyÚget_contextr0      sè   € ð ÑÜ×)Ò)¨#¨t¯x©xÓ8ˆð HN×G^ÒG^óÚG^¸VŒ×ÒœC ›K¨Ö8ÑG^ð ð ð HN×GWÒGWÓXÒGW¸t”×$Ò$ T°Ö:ÑGW€IÐ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³   € ð
 �~‰~×-Ñ-¨hÐSYÐ-ÐZ€Hä×Ò˜t×$Ñ$ô ˜FŸO™O×2¨sÓ3×8Ñ8‰ä×)Ò)¨#¨tÓ4ˆä˜# fÑ@€Gð �n‰n×0Ñ0°ÐU[Ð0Ð\€Gà�_‰_˜WÓ%€Fð �^‰^×,Ñ,¨VÐPVÐ,ÐW€Fà€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  o™R"                  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‚  € ô ‡I�IÐ)¨-¨Ð9Ô:ðØ×#Ñ# MÓ2ˆô
 ˜]°eÀSÓI€Fà‡|�|‡~‚~Ü—g‘g—l‘l 6§?¡?°MÓBˆÜ×Ò˜Ÿ™ wÓ/°Ô=à˜MÓ)Ü�I‰IÐ+¨M¨?Ð;Ô<Ø(˜M¨Ð-ˆKÜ�k 4Ô(¨AÜ!×5Ò5Ø+0×+DÑ+DÔ+FÓ]Ò+F aÏ&É&›6˜1Ÿ6œ6Ñ+FÑ]ñ�	ô —]’]Ø¨¸$ÀiòàØ—L‘L §¡¨wÓ!7Ô8÷÷	 )Ð(ð *ô 	�‰Ð& } oÐ5NÐ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Þ   € ä‡I�IÐ)¨-¨Ð9Ô:à×#Ñ# MÓ2€DØ�|Ü�‰Ð)¨-¨Ð8PÐQÔRØðÜ—?’? 4×#6Ñ#6Ó7ˆô
 ˜]°eÀSÓI€Fà‡|�|‡~�~Ü×Ò˜Ÿ™ wÓ/°×1CÑ1CÕDä�‰Ð& } oÐ5NÐOÕPøô ó Ü�‰Ð.¨}¨o¸SÀÀÐ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Ø�M‰M ¸5ð 8ð 
ˆŒð 	�‰�FÔ"Ø�|‰|Ñ'Ð'Ð'ð —~‘~×5Ñ5Ø�L‰L˜t¸%ð 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                  X�U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 	�	‰	�N 4§9¡9×#4Ñ#4Ð"5Ð6Ô7ð ˆŒä˜c¨fÓ;ˆð ×#Ñ# D§I¡I§M¡M°*¸kÓ$JÓKˆð —.‘.×0Ñ0°ÈFÐ0Ð\ˆæðà ŸL™L×.¨Bñ0ð ŒLð —‘ Ó)ˆð —‘×,Ñ,¨VÀvÐ,ÐNˆð �<‰<�>‰>Ü×ÒØ—‘˜gÐ.A�ÐBÀDÇIÁI×D[ÑD[õô �H‰H� t§y¡y×'8Ñ'8Ð&9Ð9SÐ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                  X€5        U R                  R5                  XpS9n[7        Xp5        [9        Xp5      n	U R                  R;                  X�U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X°5        URB                  c   e[S        URB                  XU5        MÏ     U
(       a'  [         R#                  SSRU                  U
5      -   5        U R                  RW                  X€US9n[         R=                  S5        URY                  X%S9  U R.                  RZ                   H  n[]        XÈXpU	5        M     U R^                   H  n[a        XÇX	5        M     [         R=                  S5        UR?                  US	9nU H@  nURB                  c   e[c        URB                  XX˜X+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 directoryz°A '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%   é € ÐCºF±D°A˜q˜c  1§7¡7£9 +¨QÕ/ºFùs   ‚%'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Ñ=W€Iðg.Ü—’Ó ˆð —‘×)Ñ)¨&Ó1ˆð 	�‰×#Ñ#¨6Ð#Ñ2æÜ�H‰HÐ.Ô/Ü×!Ò! &§/¡/Õ2ô �K‰Kðgôö
 Ü�H‰HÐ<¸V¿_¹_Ð<MÐNÔOÞÔ<¸V¿_¹_×MÑMÜ—‘ÐZÔ[ô ˜&Ó!ˆØ�l‰l×"Ñ"Ó$ˆØ×"Ñ" 3Ô/ð —‘×'Ñ'¨Ð'Ð=ˆä�uÔ%ä˜UÓ+ˆð �n‰n×#Ñ# C¸eÐ#ÐDˆä�	‰	Ð+Ô,ØˆØ×-Ñ-¸	Ð-ÓBˆDÜ�I‰I˜	 $§,¡, Ð0Ô1Ø�y‰yÑ  T§^¡^×%AÑ%A×%CÑ%CÞ §¡×!;Ñ!;×!=Ñ!=Ø—O‘O¤G¨I·x±xÓ$@ÔAÜ�T˜4Ô(Ø—9‘9Ñ(Ð(Ð(Ü˜4Ÿ9™9 f°UÖ;ñ Cö Ü�H‰HðZà—-‘- Ó)ñ*ôð �n‰n×#Ñ# C¸eÐ#ÐDˆô
 	�	‰	Ð*Ô+Ø×Ñ eÐÑAàŸ™×5Ô5ˆHÜ! (°ÀÖDñ 6ð ×.Ô.ˆHÜ! (°6Ö?ñ /ô 	�	‰	Ð,Ô-Ø×-Ñ-¸	Ð-ÐBˆ	ÛˆDØ—9‘9Ñ(Ð(Ð(ÜØ—	‘	˜6¨c¸ÏÉ×HbÑHbÓHdôñ ð ×%Ñ%×+Ñ+×3Ñ3ˆ	ÛˆDØ—9‘9Ñ(Ð(Ð(Ø�I‰I×+Ñ+°%Ð+ÓMñ ð
 	�‰×$Ñ$¨FÐ$Ñ3à$×/Ñ/Ó1Ð1ˆ6Õ1Ø—)‘)ÑC¹FÓCÓCˆCÜ˜-¨ uÐ,<Ð=Ó>Ð>ä�‰Ð*¬4¯>ª>Ó+;¸eÑ+CÀCÐ*HÈÐQÕRð 	×Ñ˜_Õ-øô ó à�‰×%Ñ%¨AÐ%Ñ.Ü�aœ×$Ñ$Ü�I‰I”c˜!“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(   € ä”—‘—‘˜~Ó.×M´2·:²:¸nÓ3MÓ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@   