HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/markdown_it/cli/__pycache__/parse.cpython-310.pyc
o

;jU�@s�dZddlmZddlZddlmZmZddlZddlm	Z	ddl
mZd�e	�Z
d d!dd
�Zd"dd�Zd#dd�Zd$dd�Zd%dd�Zd$dd�Zedkr\eejdd��Ze�e�dSdS)&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__)�
MarkdownItzmarkdown-it-py [version {}]�args�Sequence[str] | None�return�intcCs&t|�}|jrt|j�dSt�dS)Nr)�
parse_args�	filenames�convert�interactive)r�	namespace�r�I/opt/saltstack/salt/lib/python3.10/site-packages/markdown_it/cli/parse.py�mains
�rr�
Iterable[str]�NonecCs|D]}t|�qdS�N)�convert_file)r�filenamerrrr
s
�r
r�strcCs�z+t|dddd��}t��|���}t|dd�Wd�WdS1s$wYWdStyDtj�d|�d	��t�	d
�YdSw)z>
    Parse a Markdown file and dump the output to stdout.
    �r�utf8�ignore)�encoding�errors���endNzCannot open file "z".
�)
�openr�render�read�print�OSError�sys�stderr�write�exit)r�finZrenderedrrrr!s&��rc
Cs�t�g}d}	z|r
dnd\}}|�t|�d�Wn)ty7tdt��d�|��dd�d}g}YntyDtd�Yd	Swq)
zT
    Parse user input, dump to stdout, rinse and repeat.
    Python REPL style.
    FT)z... T)z>>> T�
rrz	
Exiting.N)	�
print_heading�append�input�EOFErrorr%rr#�join�KeyboardInterrupt)�contentsZmore�promptrrrr.s ��r�argparse.NamespacecCsFtjddt�d�tjd�}|jdddtd�|jd	d
dd�|�|�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*
  ...
  <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)�actionr9r�*z,specify an optional list of files to convert)�nargs�help)�argparse�ArgumentParserr�RawDescriptionHelpFormatter�add_argument�version_strr)r�parserrrrrCs���
rcCstd�t��td�dS)Nz{} (interactive)z1Type Ctrl-D to complete input, or Ctrl-C to exit.)r%�formatrBrrrrr-fsr-�__main__r!r)rrr	r
)rrr	r)rrr	r)r	r)rrr	r5)�__doc__�
__future__rr>�collections.abcrrr'Zmarkdown_itrZmarkdown_it.mainrrDrBrr
rrrr-�__name__�argvZ	exit_coder*rrrr�<module>s$

	



#�