
    f j"                        d Z ddlmZ ddlZddlmZmZ ddlZddlm	Z	 ddl
mZ de	 dZdddZddZddZd dZddZd!dZddZedk    r* eej        dd                   Z ej        e           dS dS )"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 ]argsSequence[str] | Nonereturnintc                    t          |           }|j        rt          |j                   n$|j        rt	                       nt                       dS )Nr   )
parse_args	filenamesconvertstdinconvert_stdininteractive)r	   	namespaces     iC:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\markdown_it/cli/parse.pymainr      sQ    4  I 	#$$$$	 1    r   Iterable[str]Nonec                .    | D ]}t          |           d S N)convert_file)r   filenames     r   r   r      s,      X r   c                 ,   	 t                                          t          j                                                  } t          | d           dS # t          $ r7 t          j                            d           t          j	        d           Y dS w xY w)>
    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    <<&&sy~~'7'788hB   
KLLLs   AA =BBr   strc                v   	 t          | dd          5 }t                                          |                                          }t	          |d           ddd           dS # 1 swxY w Y   dS # t
          $ r; t          j                            d|  d           t          j	        d	           Y dS w xY w)
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   s   (VH=== 	$!||**388::66H(####	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$    
<h<<<===s6   A3 AA&A3 &A**A3 -A*.A3 3AB87B8c            	     t   t                       g } d}	 	 |rdnd\  }}|                     t          |          dz              nu# t          $ rM t	          dt                                          d                    |                     z   d           d}g } Y nt          $ r t	          d           Y d	S w xY w)
zT
    Parse user input, dump to stdout, rinse and repeat.
    Python REPL style.
    FT)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    
 OOOHD
		-1E>>~LFDOOE&MMD01111 	 	 	$,,TYYx-@-@AAArJJJJDHHH  	 	 	,EE	
s   .A AB6B65B6argparse.Namespacec                   t          j        ddt           dt           j                  }|                    dddt
                     |                    d	d
d           |                    ddd           |                    |           S )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)actionrE   z--stdin
store_truez!read Markdown from standard input)rF   helpr   *z,specify an optional list of files to convert)nargsrH   )argparseArgumentParserr   RawDescriptionHelpFormatteradd_argumentversion_strr   )r	   parsers     r   r   r   R   s    $4 '	  & !<1  F4 k)[QQQ
,-P     3%S     T"""r   c                 R    t          t           d           t          d           d S )Nz (interactive)z1Type Ctrl-D to complete input, or Ctrl-C to exit.)r'   rO    r   r   r7   r7   x   s.    	[
(
(
()))	
=>>>>>r   __main__r#   r   )r	   r
   r   r   )r   r   r   r   )r   r   )r   r-   r   r   )r	   r
   r   r@   )__doc__
__future__r   rK   collections.abcr   r   r%   markdown_itr   markdown_it.mainr   rO   r   r   r   r   r   r   r7   __name__argv	exit_coder+   rR   r   r   <module>r\      s]    # " " " " "  . . . . . . . . 



 # # # # # # ' ' ' ' ' '7777       
	 	 	 	
 
 
 
   *## ## ## ##L? ? ? ?
 z SXabb\""ICHY r   