
    hs              
       L   S SK Jr  S SKJrJr  SSKJrJr  SSKJ	r	J
r
JrJr  SrS\	 S	\	 S
\ S3rS\ S3rS\ S3rS\ S3rSrSrSrSr\R,                  " S5      \
" \R.                  " 5       SSSS9\" SSSSS9\" SS S!S"S94S#\S$\S%\4S& jj5       rSS'.S#\S$\S%\S(S)4S* jjrg))+    )Path)MarkdownRenderermsg   )load_project_configworking_dir   )PROJECT_FILEArgOptappz#https://github.com/explosion/weaselzThe [`z`](z) defines the data assets required by the
project, as well as the available commands and workflows. For details, see the
[Weasel documentation](z).zdThe following commands are defined by the project. They
can be executed using [`weasel run [name]`](zZ/tree/main/docs/cli.md#rocket-run).
Commands are only re-run if their inputs have changed.zeThe following workflows are defined by the project. They
can be executed using [`weasel run [name]`](z/tree/main/docs/cli.md#rocket-run)
and will run the specified commands in order. Commands are only re-run if their
inputs have changed.zbThe following assets are defined by the project. They can
be fetched by running [`weasel assets`](zI/tree/main/docs/cli.md#open_file_folder-assets)
in the project directory.)WEASELzSPACY PROJECTz9<!-- {tag}: AUTO-GENERATED DOCS START (do not remove) -->z7<!-- {tag}: AUTO-GENERATED DOCS END (do not remove) -->z<!-- {tag}: IGNORE -->documentz>Path to cloned project. Defaults to current working directory.TF)helpexists	file_okay-z--outputz-ozJPath to output Markdown file for output. Defaults to - for standard output)r   z
--no-emojiz-NEzDon't use emojiproject_diroutput_fileno_emojic                     [        XUS9  g)aT  
Auto-generate a README.md for a project. If the content is saved to a file,
hidden markers are added so you can add custom content before or after the
auto-generated section and only the auto-generated docs will be replaced
when you re-run the command.

DOCS: https://github.com/explosion/weasel/tree/main/docs/cli.md#closed_book-document
r   N)project_document)r   r   r   s      M/home/james-whalen/.local/lib/python3.13/site-packages/weasel/cli/document.pyproject_document_clir      s      [A    r   returnNc          	        ^ [        U5      S:H  n[        U 5      n[        US9mTR                  [        R                  SS95        UR                  S5      nUR                  S5      nTR                  TR                  SSU(       a  S	U 3OS
 3S5      5        U(       a  TR                  U5        TR                  TR                  S[        S5      5        TR                  [        5        UR                  S/ 5      nU Vs/ s H)  nTR                  US   5      UR                  SS
5      4PM+     n	nU	(       aZ  TR                  TR                  SSS5      5        TR                  [        5        TR                  TR                  U	SS/5      5        UR                  S0 5      R                  5       n
U
 VVs/ s H1  u  pTR                  U5      SR                  U4S jU 5       5      4PM3     n	nnU	(       aZ  TR                  TR                  SSS5      5        TR                  [        5        TR                  TR                  U	SS/5      5        UR                  S/ 5      n/ n	U H  nUR                  S5      (       a  SOUR                  S 5      (       a  S!OS"nUS#   nTR                  U5      nUS":X  a>  [!        U 5       nUU-  R#                  5       (       a  TR%                  UU5      nS S S 5        U	R'                  UXR                  SS
5      45        M     U	(       aZ  TR                  TR                  SS$S%5      5        TR                  [(        5        TR                  TR                  U	/ S&Q5      5        TR                  [*        R                  SS95        U(       a  [-        TR.                  5        g TR.                  nUR#                  5       (       Ga  UR1                  S'S(S)9 nUR3                  5       nS S S 5        [4         H3  n[6        R                  US9W;   d  M  [8        R:                  " S*U5          g    S+n[4         H  n[        R                  US9[*        R                  US9S,.nUS-   W;   d  M5  US.   U;   d  M@  S/n[8        R<                  " S05        UR?                  US-   5      S1   nUR?                  US.   5      S   nU U U 3n  O   U(       d  [8        R:                  " S25        UR1                  S3S(S)9 nURA                  U5        S S S 5        [8        RB                  " S4U5        g s  snf s  snnf ! , (       d  f       GNb= f! , (       d  f       GNb= f! , (       d  f       NU= f)5Nr   r   r   )tagtitledescriptionr	   zWeasel Projectz:  u   🪐r   u   📋commandsnamer      Commandsu   ⏯CommandDescription	workflowsz &rarr; c              3   F   >#    U  H  nTR                  U5      v   M     g 7f)N)code).0wmds     r   	<genexpr>#project_document.<locals>.<genexpr>I   s     (ASSs   !	Workflowsu   ⏭WorkflowStepsassetsgitGiturlURLLocaldestAssetsu   🗂)FileSourcer(   rutf8)encodingz.Found ignore marker in existing file: skippingF)startendrA   rB   Tz7Found existing file: only replacing auto-generated docsr   zReplacing existing filer-   zSaved project documentation)"strr   r   addMARKER_STARTformatgetr    r
   INTRO_PROJECTr+   INTRO_COMMANDStableitemsjoinINTRO_WORKFLOWSr   r   linkappendINTRO_ASSETS
MARKER_ENDprinttextopenreadMARKER_TAGSMARKER_IGNOREr   warninfosplitwritegood)r   r   r   	is_stdoutconfigr    r!   cmdscmddatawfsnstpr4   asource	dest_pathr:   pcontentfexisting
marker_tagmarker_tag_foundmarkersbeforeafterr.   s                              @r   r   r   2   s|    K C'I -F	8	,BFF<8,-JJwE**]+KFF288A"UG2'FGPQ
{FF288A|V,-FF=::j"%DCGH4CRWWS[!37762#674DH
rxx:u-.
~
rxxy-89:
**["
%
+
+
-CQTUQTvqRWWQZ(AS(AABQTDU
rxx;./

rxxz7345ZZ"%FD%%,,QUU5\\EwfI	wwy!W[)Q	M))++7743D * 	T655#;<=  
rxx8V,-
|
rxx?@AFF:*+bgg''!!#!71668 8 *
 ''J'78CHHH+  *  %)
)00Z0@%,,,< 7#x/GENh4N'+$HHVW%^^GG,<=a@F$NN75>:1=E!'	%9G * $23cF3qGGG 4.<A I V *) 874 43s0   0U:8U+U4U U2
U	 
U/2
V )pathlibr   wasabir   r   utilr   r   mainr
   r   r   r   DOCS_URLrH   rI   rM   rP   rV   rE   rQ   rW   commandcwdboolr   r    r   r   <module>rz      sC    ( 3 - -0<.L> : z'--5J 77:--5J 7))1
 3
 *JF
( Z DHHJ-mvz  GL  MCT  9E  Fe:KL	BB B 	B B& ?DP=P=$(P=7;P=	P=r   