U
    ç¥¡cô  ã                   @   sR   d dl mZmZ d dlmZ d dlmZmZ d dlm	Z	 d dl
mZ d
dd„Zd	S )é    )Úabsolute_importÚunicode_literals)ÚParser)ÚdumpASTÚdumpJSON)ÚHtmlRenderer)ÚReStructuredTextRendererÚhtmlc                 C   st   t ƒ }| | ¡}|dkr tdƒ‚|dkr8tƒ }| |¡S |dkrHt|ƒS |dkrXt|ƒS |dkrptƒ }| |¡S dS )z½Render CommonMark into HTML, JSON or AST
    Optional keyword arguments:
    format:     'html' (default), 'json' or 'ast'

    >>> commonmark("*hello!*")
    '<p><em>hello</em></p>\n'
    )r	   ÚjsonÚastÚrstz&format must be 'html', 'json' or 'ast'r	   r
   r   r   N)r   ÚparseÚ
ValueErrorr   Úrenderr   r   r   )ÚtextÚformatÚparserr   Zrenderer© r   ú3/tmp/pip-unpacked-wheel-4s07asnf/commonmark/main.pyÚ
commonmark   s    

r   N)r	   )Ú
__future__r   r   Zcommonmark.blocksr   Zcommonmark.dumpr   r   Zcommonmark.render.htmlr   Zcommonmark.render.rstr   r   r   r   r   r   Ú<module>   s
   