
    F j"                        S r SSKJr  SSKrSSKJrJr  SSKrSSKJ	r	  SSK
Jr  S\	 S3rSSS	 jjrSS
 jrSS jrSS jrSS jrSS jrSS jr\S:X  a(  \" \R*                  SS 5      r\R.                  " \5        gg)zo
CLI interface to markdown-it-py

Parse one or more markdown files, convert each to HTML, and print to stdout.
    )annotationsN)IterableSequence)__version__)
MarkdownItzmarkdown-it-py [version ]c                    [        U 5      nUR                  (       a  [        UR                  5        gUR                  (       a  [	        5         g[        5         g)Nr   )
parse_args	filenamesconvertstdinconvert_stdininteractive)args	namespaces     f/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/markdown_it/cli/parse.pymainr      sE    4 I	##$
 	 
  	    c                ,    U  H  n[        U5        M     g N)convert_file)r   filenames     r   r   r      s    X r   c                     [        5       R                  [        R                  R	                  5       5      n [        U SS9  g! [         a8    [        R                  R                  S5        [        R                  " S5         gf = f)6
Parse a Markdown file and dump the output to stdout.
 endz/Cannot parse Markdown from the standard input.
   N)
r   rendersysr   readprintOSErrorstderrwriteexit)rendereds    r   r   r   $   s[    <&&syy~~'78hB 

KLs   ?A ?BBc                D    [        U SSS9 n[        5       R                  UR                  5       5      n[	        USS9  SSS5        g! , (       d  f       g= f! [
         a<    [        R                  R                  SU  S35        [        R                  " S	5         gf = f)
r   utf8ignore)encodingerrorsr   r   NzCannot open file "z".
r   )
openr   r   r!   r"   r#   r    r$   r%   r&   )r   finr'   s      r   r   r   0   sz    (VH=!|**388:6H(# >==  

-hZt<=s.   A 2AA 
AA A ABBc            	     4   [        5         / n Sn  U(       a  SOSu  p!U R                  [        U5      S-   5        M-  ! [         a:    [	        S[        5       R                  SR                  U 5      5      -   SS9  Sn/ n  NE[         a    [	        S5         gf = f)	zH
Parse user input, dump to stdout, rinse and repeat.
Python REPL style.
F)z... T)z>>> T
r   r   z	
Exiting.N)	print_headingappendinputEOFErrorr"   r   r   joinKeyboardInterrupt)contentsmoreprompts      r   r   r   =   s    
 OHD
		-1>~LFOOE&MD01   	$,,TYYx-@AArJDH  	,	s   *= AB BBc                    [         R                  " SS[         S3[         R                  S9nUR	                  SSS[
        S9  UR	                  S	S
SS9  UR	                  SSSS9  UR                  U 5      $ )zParse input CLI arguments.zKParse one or more markdown files, convert each to HTML, and print to stdoutz9
Interactive:

  $ markdown-it
  markdown-it-py [version a  ] (interactive)
  Type Ctrl-D to complete input, or Ctrl-C to exit.
  >>> # Example
  ... > markdown *input*
  ...
  <h1>Example</h1>
  <blockquote>
  <p>markdown <em>input</em></p>
  </blockquote>

Batch:

  $ markdown-it README.md README.footer.md > index.html
)descriptionepilogformatter_classz-vz	--versionversion)actionr>   z--stdin
store_truez!read Markdown from standard input)r?   helpr   *z,specify an optional list of files to convert)nargsrA   )argparseArgumentParserr   RawDescriptionHelpFormatteradd_argumentversion_strr
   )r   parsers     r   r
   r
   R   s    $$4 '- (	& !<<1F4 k)[Q
,-P   3%S   T""r   c                 >    [        [         S35        [        S5        g )Nz (interactive)z1Type Ctrl-D to complete input, or Ctrl-C to exit.)r"   rH    r   r   r1   r1   x   s    	[M
()	
=>r   __main__r   r   )r   Sequence[str] | Nonereturnint)r   zIterable[str]rN   None)rN   rP   )r   strrN   rP   )r   rM   rN   zargparse.Namespace)__doc__
__future__r   rD   collections.abcr   r   r    markdown_itr   markdown_it.mainr   rH   r   r   r   r   r   r
   r1   __name__argv	exit_coder&   rK   r   r   <module>rZ      s    #  . 
 # '(Q7
	
*##L?
 zSXXab\"IHHY r   