'WdU dZddlmZddlZddlmZmZddlZddlm Z ddl m Z dje Z dddZdd Zdd Zdd Zdd Zdd Zedk(r(eej*ddZej.eyy)zo CLI interface to markdown-it-py Parse one or more markdown files, convert each to HTML, and print to stdout. ) annotationsN)IterableSequence) __version__) MarkdownItzmarkdown-it-py [version {}]crt|}|jrt|jyty)Nr) parse_args filenamesconvert interactive)args namespaces 7/usr/lib/python3/dist-packages/markdown_it/cli/parse.pymainrs24 I ##$   c(|D] }t|yN) convert_file)r filenames rr r sXrcD t|ddd5}tj|j}t |ddddy#1swYyxYw#t $r;t jjd|d t jd YywxYw) z> Parse a Markdown file and dump the output to stdout. rutf8ignore)encodingerrorsendNzCannot open file "z". ) openrrenderreadprintOSErrorsysstderrwriteexit)rfinrendereds rrr!s (C& B $c!|**388:6H ( # $ $ $  -hZt<=  s/A5AAAAAABBc ,tg}d} |rdnd\}}|jt|dz(#t$r=t dt j dj|zdd}g}YFt$rt dYywxYw) zT Parse user input, dump to stdout, rinse and repeat. Python REPL style. F)z... T)z>>> T rrz Exiting.N) print_headingappendinputEOFErrorr#rr!joinKeyboardInterrupt)contentsmoreprompts rr r .s OH D  -1>~LFD OOE&MD0 1   $,,TYYx-@AAr JDH   ,   s&8AB=BBctjddtdtj}|j dddt |j d d d |j |S) zParse 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* ...

Example

markdown input

Batch: $ markdown-it README.md README.footer.md > index.html ) descriptionepilogformatter_classz-vz --versionversion)actionr:r *z,specify an optional list of files to convert)nargshelp)argparseArgumentParserrRawDescriptionHelpFormatter add_argument version_strr )r parsers rr r Cs  $ $4'- (  &!<<1F4 k)[Q 3%S   T ""rcVtdjttdy)Nz{} (interactive)z1Type Ctrl-D to complete input, or Ctrl-C to exit.)r#formatrCrrr-r-fs  # #K 01 =>r__main__rr)r Sequence[str] | Nonereturnint)r z Iterable[str]rJNone)rstrrJrL)rJrL)r rIrJzargparse.Namespace)__doc__ __future__rr?collections.abcrrr% markdown_itrmarkdown_it.mainrrFrCrr rr r r-__name__argv exit_coder(rGrrrVs~ #. #'+22;?   * #F?  zSXXab\"I CHHYr