
    ~,hU                    
   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R                  \	5      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: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[        5         g)Nr   )
parse_args	filenamesconvertinteractive)args	namespaces     7/usr/lib/python3/dist-packages/markdown_it/cli/parse.pymainr      s2    4 I	##$  	    c                ,    U  H  n[        U5        M     g N)convert_file)r
   filenames     r   r   r      s    X r   c                F    [        U S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)z6
Parse a Markdown file and dump the output to stdout.
rutf8ignore)encodingerrors endNzCannot open file "z".
   )
openr   renderreadprintOSErrorsysstderrwriteexit)r   finrendereds      r   r   r   !   s}    (C&Bc!|**388:6H(# CBB  

-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                  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:   r
   *z,specify an optional list of files to convert)nargshelp)argparseArgumentParserr   RawDescriptionHelpFormatteradd_argumentversion_strr	   )r   parsers     r   r	   r	   C   s    $$4 '- (	& !<<1F4 k)[Q
3%S   T""r   c                 V    [        SR                  [        5      5        [        S5        g )Nz{} (interactive)z1Type Ctrl-D to complete input, or Ctrl-C to exit.)r#   formatrC    r   r   r-   r-   f   s    	

#
#K
01	
=>r   __main__r   r   )r   Sequence[str] | Nonereturnint)r
   zIterable[str]rJ   None)r   strrJ   rL   )rJ   rL   )r   rI   rJ   zargparse.Namespace)__doc__
__future__r   r?   collections.abcr   r   r%   markdown_itr   markdown_it.mainr   rF   rC   r   r   r   r   r	   r-   __name__argv	exit_coder(   rG   r   r   <module>rV      s|   
 #  . 
 # '+22;?

* #F?
 zSXXab\"IHHY r   