
    f*                     r    d dl Z d dlZddlmZ ddlmZ ddlmZmZ	 d Z
d ZdZd	 Zd
 Zedk(  r e        yy)    N   )RSTRenderer)MarkdownRenderer)create_markdown__version__c                    | j                   r| j                   }ng d}| j                  dk(  rt               }n&| j                  dk(  rt               }n| j                  }t	        | j
                  | j                  ||      S )N)strikethrough	footnotestablespeeduprstmarkdown)escape	hard_wraprendererplugins)pluginr   r   r   r   r   hardwrap)argsr   r   s      K/var/www/cvtools/html/venv/lib/python3.12/site-packages/mistune/__main__.py_mdr      sk    {{++ E}}=	*	$#%=={{--	     c                     |j                   r1t        |j                   d      5 }|j                  |        d d d        y t        |        y # 1 sw Y   y xY w)Nw)outputopenwriteprint)textr   fs      r   _outputr!       sG    {{$++s# 	qGGDM	 	 	d	 	s   A

Aa  Mistune, a sane and fast python markdown parser.

Here are some use cases of the command line tool:

    $ python -m mistune -m "Hi **Markdown**"
    <p>Hi <strong>Markdown</strong></p>

    $ python -m mistune -f README.md
    <p>...

    $ cat README.md | python -m mistune
    <p>...
c                     t        j                  dt        t         j                        } | j	                  ddd       | j	                  ddd	       | j	                  d
ddddd       | j	                  ddd       | j	                  ddd       | j	                  ddd       | j	                  dddd       | j	                  dd d!t
        z   "       | j                         }|j                  }|s|j                  s
t               }|r t        |      } ||      }t        ||       y |j                  r6t        |      }|j                  |j                        d#   }t        ||       y t        d$       t        j                  d%      S )&Nzpython -m mistune)progdescriptionformatter_classz-mz	--messagezthe markdown message to convert)helpz-fz--filezthe markdown file to convertz-pz--pluginNAMEextend+zspecifiy a plugin to use)metavaractionnargsr&   z--escape
store_truezturn on escape option)r+   r&   z
--hardwrapzturn on hardwrap optionz-oz--outputz#write the rendered result into filez-rz
--rendererhtmlzspecify the output renderer)defaultr&   z	--versionversionzmistune )r+   r0   r   z"You MUST specify a message or filer   )argparseArgumentParserCMD_HELPRawDescriptionHelpFormatteradd_argumentr0   
parse_argsmessagefile
read_stdinr   r!   readr   sysexit)parserr   r7   mdr   s        r   clir?   7   s   $$  <<F
 k.   h+   j'   $  
 &  
 j2   l*  
 IzG?STDllG499,Y'{d	Ywwtyy!!$d23xx{r   c                      t         j                  j                          } | rt         j                  j                         S y )N)r;   stdinisattyr:   )is_stdin_pipes    r   r9   r9   s   s.    		((**Myy~~r   __main__)r;   r1   renderers.rstr   renderers.markdownr    r   r   r0   r   r!   r3   r?   r9   __name__ r   r   <module>rJ      sF    
  & 0*9x zE r   