
    is              	       V   d dl mZ d dlmZmZ ddlmZmZ ddlm	Z	m
Z
mZmZ dZde	 d	e	 d
e dZde dZde dZde dZdZdZdZdZ ej,                  d       e
 ej.                         ddd       edddd       edd d!d"      fd#ed$ed%efd&       Zdd'd#ed$ed%ed(d)fd*Zy))+    )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                      t        | ||       y)al  
    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      d/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/weasel/cli/document.pyproject_document_clir      s      [+A    r   returnNc          	      |
   t        |      dk(  }t        |       }t        |      j                  t        j                  d             |j                  d      }|j                  d      }j                  j                  dd|rd	| nd
 d             |rj                  |       j                  j                  dt        d             j                  t               |j                  dg       }|D cg c](  }j                  |d         |j                  dd
      f* }	}|	rZj                  j                  ddd             j                  t               j                  j                  |	ddg             |j                  di       j                         }
|
D cg c]0  \  }}j                  |      dj                  fd|D              f2 }	}}|	rZj                  j                  ddd             j                  t               j                  j                  |	ddg             |j                  dg       }g }	|D ]  }|j                  d      rdn|j                  d       rd!nd"}|d#   }j                  |      }|d"k(  r9t!        |       5 }||z  j#                         rj%                  ||      }d d d        |	j'                  |||j                  dd
      f        |	rZj                  j                  dd$d%             j                  t(               j                  j                  |	g d&             j                  t*        j                  d             |rt-        j.                         y j.                  }|j#                         r|j1                  d'd()      5 }|j3                         }d d d        t4        D ]2  }t6        j                  |      v st9        j:                  d*|        y  d+}t4        D ]  }t        j                  |      t*        j                  |      d,}|d-   v s8|d.   |v s@d/}t9        j<                  d0       |j?                  |d-         d1   }|j?                  |d.         d   }| | | } n |st9        j:                  d2       |j1                  d3d()      5 }|jA                  |       d d d        t9        jB                  d4|       y c c}w c c}}w # 1 sw Y   KxY w# 1 sw Y   PxY w# 1 sw Y   ExY w)5Nr   r   r   )tagtitledescriptionr	   zWeasel Projectz:  u   🪐r   u   📋commandsnamer      Commandsu   ⏯CommandDescription	workflowsz &rarr; c              3   @   K   | ]  }j                  |        y w)N)code).0wmds     r   	<genexpr>z#project_document.<locals>.<genexpr>I   s     (A(As   	Workflowsu   ⏭WorkflowStepsassetsgitGiturlURLLocaldestAssetsu   🗂)FileSourcer(   rutf8)encodingz.Found ignore marker in existing file: skippingF)startendr@   rA   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stpr3   asource	dest_pathr9   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HCRWWS[!37762#67HDH
rxx:u-.
~
rxxy-89:
**["
%
+
+
-CQTUvq#RWWQZ(AS(AABUDU
rxx;./

rxxz7345ZZ"%FD 	>%%,QUU5\EwfI	wwy!W[) 4Q	M))+7743D4 	T6155#;<=	> 
rxx8V,-
|
rxx?@AFF:*+bgg''!!#!7 $1668$ * 
 ''J'78CHHH+   %) 
)00Z0@%,,,< 7#x/GENh4N'+$HHVW%^^GG,<=a@F$NN75>:1=E!'	%9G $23cF3 	qGGG	.<A I V4 4$ $4	 	s0   >-T.5T)&TT%T2T"	%T/2T;)pathlibr   wasabir   r   utilr   r   mainr
   r   r   r   DOCS_URLrG   rH   rL   rO   rU   rD   rP   rV   commandcwdboolr   r    r   r   <module>ry      sG    ( 3 - -0<.L> : z'--5J 77:--5J 7))1
 3
 *JF
( Z HDHHJ-mvz  GL  MCT  9E  Fe:KL	BB B 	B B& ?DP=P=$(P=7;P=	P=r   