Current File : /home/inlingua/miniconda3/lib/python3.1/site-packages/rich/__pycache__/markdown.cpython-312.pyc
�

~�Egqe���ddlmZddlZddlmZmZddlmZddlm	Z	ejdk\rddlmZnddlmZddl
mZd	d
lmZd	dlmZd	dlmZd	d
lmZmZmZmZd	dlmZd	dlmZd	dlmZd	dl m!Z!d	dl"m#Z#d	dl$m%Z%m&Z&d	dl'm(Z(d	dl)m*Z*m+Z+Gd�d�Z,Gd�de,�Z-Gd�de,�Z.Gd�de.�Z/Gd�de.�Z0Gd �d!e.�Z1Gd"�d#e.�Z2Gd$�d%e,�Z3Gd&�d'e,�Z4Gd(�d)e,�Z5Gd*�d+e,�Z6Gd,�d-e,�Z7Gd.�d/e,�Z8Gd0�d1e,�Z9Gd2�d3e.�Z:Gd4�d5e.�Z;Gd6�d7e.�Z<Gd8�d9�Z=Gd:�d;e�Z>e?d<k(�rddl@Z@ddlZe@j�d=�>�ZBeBj�d?d@dA�B�eBj�dCdDdEdFddG�H�eBj�dIdJdKdLdM�N�eBj�dOdPdQddQ�N�eBj�dRdSdTdFdU�V�eBj�dWdXeDdYddZ�[�eBj�d\d]d^dFd_�V�eBj�d`dadbdFdc�V�eBj��ZFdddlGmZeFj�dek(rej�j��ZKn-eLeFj�df�g�5ZMeMj��ZKddd�e>eKeFj�rdhndieFj�eFj�eFj��j�ZReFj�rjddlTZTddlUZUeTj��ZWeeWeFj�eFj��k�Zej�eR�eUj�eWj���yeeFj�eFj�dl�m�Zej�eR�yy#1swY��xYw)n�)�annotationsN)�ClassVar�Iterable)�
MarkdownIt)�Token)��)�get_args)�Table���box)�
loop_first)�Stack)�Console�ConsoleOptions�
JustifyMethod�RenderResult)�Renderables)�JupyterMixin)�Panel)�Rule)�Segment)�Style�
StyleStack)�Syntax)�Text�TextTypec�b�eZdZUdZded<edd��Zdd�Zd
d�Zdd�Z	dd�Z
						dd	�Zy
)�MarkdownElementTzClassVar[bool]�new_linec��|�S)z�Factory to create markdown element,

        Args:
            markdown (Markdown): The parent Markdown object.
            token (Token): A node from markdown-it.

        Returns:
            MarkdownElement: A new markdown element
        ���cls�markdown�tokens   �-lib/python3.12/site-packages/rich/markdown.py�createzMarkdownElement.create!s���u��c��y)zuCalled when the node is entered.

        Args:
            context (MarkdownContext): The markdown context.
        Nr#��self�contexts  r(�on_enterzMarkdownElement.on_enter.��r*c��y)zpCalled when text is parsed.

        Args:
            context (MarkdownContext): The markdown context.
        Nr#�r-r.�texts   r(�on_textzMarkdownElement.on_text5r0r*c��y)zwCalled when the parser leaves the element.

        Args:
            context (MarkdownContext): [description]
        Nr#r,s  r(�on_leavezMarkdownElement.on_leave<r0r*c��y)a|Called when a child element is closed.

        This method allows a parent element to take over rendering of its children.

        Args:
            context (MarkdownContext): The markdown context.
            child (MarkdownElement): The child markdown element.

        Returns:
            bool: Return True to render the element, or False to not render the element.
        Tr#�r-r.�childs   r(�on_child_closezMarkdownElement.on_child_closeCs��r*c��y)Nr#r#�r-�console�optionss   r(�__rich_console__z MarkdownElement.__rich_console__Qs��r*N�r&�Markdownr'r�returnr �r.�MarkdownContextrB�None�r.rDr3rrBrE�r.rDr9r rB�bool�r=rr>rrBr)�__name__�
__module__�__qualname__r!�__annotations__�classmethodr)r/r4r6r:r?r#r*r(r r sO��#�H�n�#��
��
��������)7��	�r*r c��eZdZdZy)�UnknownElementz�An unknown element.

    Hopefully there will be no unknown elements, and we will have a MarkdownElement for
    everything in the document.

    N)rJrKrL�__doc__r#r*r(rPrPWs��r*rPc�,�eZdZdZdZdd�Zdd�Zdd�Zy)	�TextElementz)Base class for elements that render text.�nonec�f�|j|j�|_td��|_y�N�left��justify)�enter_style�
style_name�stylerr3r,s  r(r/zTextElement.on_enteres$���(�(����9��
���(��	r*c�~�|jj|t|t�r|j�yd�y�N)r3�append�
isinstance�str�
current_styler2s   r(r4zTextElement.on_textis+���	�	����
�4��8M�w�4�4�X�SW�Xr*c�$�|j�yr^)�leave_styler,s  r(r6zTextElement.on_leavels�����r*NrCrF)rJrKrLrQr[r/r4r6r#r*r(rSrS`s��3��J�)�Y�r*rSc�N�eZdZUdZdZded<ed	d��Zd
d�Z						dd�Z	y)�	ParagraphzA Paragraph.zmarkdown.paragraphrrYc�0�||jxsd��SrVrXr$s   r(r)zParagraph.createvs���8�+�+�5�v�6�6r*c��||_yr^rX�r-rYs  r(�__init__zParagraph.__init__zs	����r*c#�^K�|j|j_|j��y�wr^)rYr3r<s   r(r?zParagraph.__rich_console__}s!����!�L�L��	�	���i�i��s�+-N)r&rAr'rrBrf�rYrrBrErI)
rJrKrLrQr[rMrNr)rjr?r#r*r(rfrfpsD���%�J�
���7��7�����)7��	�r*rfc�R��eZdZdZedd��Zdd�Zd�fd�Z						d	d�Z�xZ	S)
�Headingz
A heading.c�&�||j�Sr^)�tagr$s   r(r)zHeading.create�s���5�9�9�~�r*c�X�t�|_|j|j�yr^)rr3rZr[r,s  r(r/zHeading.on_enter�s���F��	����D�O�O�,r*c�D��||_d|��|_t�|�
�y)N�	markdown.)rpr[�superrj)r-rp�	__class__s  �r(rjzHeading.__init__�s#������%�c�U�+���
���r*c#��K�|j}d|_|jdk(rt|tj
d����y|jdk(r
t
d���|��y�w)N�center�h1zmarkdown.h1.border)rr\�h2�)r3rYrprr�HEAVYr)r-r=r>r3s    r(r?zHeading.__rich_console__�sZ�����y�y������8�8�t�����I�I�*��
��x�x�4���2�h���J�s�A#A%)r&rAr'rrBrnrC)rprarBrErI)
rJrKrLrQrNr)r/rjr?�
__classcell__�rus@r(rnrn�s?��������-��
���)7��	�r*rnc�B�eZdZdZdZedd��Zdd�Z						d	d�Zy)
�	CodeBlockz&A code block with syntax highlighting.zmarkdown.code_blockc�x�|jxsd}|jd�d}||xsd|j�S)Nrz� rr3)�info�	partition�
code_theme)r%r&r'�	node_info�
lexer_names     r(r)zCodeBlock.create�s=���J�J�$�"�	��(�(��-�a�0�
��:�'���)<�)<�=�=r*c� �||_||_yr^)r��theme)r-r�r�s   r(rjzCodeBlock.__init__�s��$�����
r*c#�K�t|j�j�}t||j|j
dd��}|��y�w)NTr)r��	word_wrap�padding)rar3�rstriprr�r�)r-r=r>�code�syntaxs     r(r?zCodeBlock.__rich_console__�sB�����4�9�9�~�$�$�&����$�/�/����t�Q�
����s�A
AN)r&rAr'rrBr)r�rar�rarBrErI)	rJrKrLrQr[rNr)rjr?r#r*r(rr�s>��0�&�J��>��>�
����)7��	�r*rc�8�eZdZdZdZdd�Zdd�Z						d	d�Zy)
�
BlockQuotezA block quote.zmarkdown.block_quotec�"�t�|_yr^�r�elements�r-s r(rjzBlockQuote.__init__����%0�]��
r*c�:�|jj|�y�NF�r�r_r8s   r(r:zBlockQuote.on_child_close�����
�
���U�#�r*c#�K�|j|jdz
��}|j|j||j��}|j}td�}td|�}|D]}|��|Ed{���|���y7��w)N���width�r\�
u▌ )�update�	max_width�render_linesr�r\r)	r-r=r>�render_options�linesr\r!r��lines	         r(r?zBlockQuote.__rich_console__�s~����!���g�.?�.?�!�.C��D���$�$�T�]�]�N�$�*�*�$�U���
�
���4�=���&�%�(���D��M��O�O��N���s�A9B	�;B�<B	N�rBrErGrI)rJrKrLrQr[rjr:r?r#r*r(r�r��s1���'�J�3�����)7��	�r*r�c�(�eZdZdZdZ						dd�Zy)�HorizontalRulez%A horizontal rule to divide sections.Fc#�NK�|jdd��}t|����y�w)Nzmarkdown.hrrT��defaultr�)�	get_styler)r-r=r>r\s    r(r?zHorizontalRule.__rich_console__�s(�����!�!�-��!�@������s�#%NrI)rJrKrLrQr!r?r#r*r(r�r��s'��/��H� �� �)7� �	� r*r�c�4�eZdZdZdd�Zdd�Z						dd�Zy)	�TableElementz.MarkdownElement corresponding to `table_open`.c� �d|_d|_yr^)�header�bodyr�s r(rjzTableElement.__init__�s��15���-1��	r*c�x�t|t�r||_yt|t�r||_ytd��)Nz Couldn't process markdown table.F)r`�TableHeaderElementr��TableBodyElementr��RuntimeErrorr8s   r(r:zTableElement.on_child_close�s@���e�/�0��D�K�
�	��/�
0��D�I���A�B�Br*c#��K�ttj��}|j�V|jj�@|jjj
D]}|j
|j��|j�M|jjD]4}|j
D�cgc]}|j��}}|j|��6|��ycc}w�w)Nr
)rr�SIMPLE_HEAVYr��row�cells�
add_column�contentr��rows�add_row)r-r=r>�table�columnr��element�row_contents        r(r?zTableElement.__rich_console__�s������#�*�*�+���;�;�"�t�{�{���'B��+�+�/�/�/�/��� � ����0�0��9�9� ��y�y�~�~��>A�i�i�H�i�7�w���i��H���
�
�{�+�&����I�s�B0C"�2C�C"Nr�rGrI)rJrKrLrQrjr:r?r#r*r(r�r��s,��8�2�����)7��	�r*r�c� �eZdZdZdd�Zdd�Zy)r�z@MarkdownElement corresponding to `thead_open` and `thead_close`.c��d|_yr^)r�r�s r(rjzTableHeaderElement.__init__
s	��+/��r*c�6�t|t�sJ�||_yr�)r`�TableRowElementr�r8s   r(r:z!TableHeaderElement.on_child_close
s���%��1�1�1����r*Nr�rG�rJrKrLrQrjr:r#r*r(r�r�s��J�0�r*r�c� �eZdZdZdd�Zdd�Zy)r�z@MarkdownElement corresponding to `tbody_open` and `tbody_close`.c��g|_yr^)r�r�s r(rjzTableBodyElement.__init__s	��+-��	r*c�^�t|t�sJ�|jj|�yr�)r`r�r�r_r8s   r(r:zTableBodyElement.on_child_closes'���%��1�1�1��	�	�����r*Nr�rGr�r#r*r(r�r�s��J�.�r*r�c� �eZdZdZdd�Zdd�Zy)r�z:MarkdownElement corresponding to `tr_open` and `tr_close`.c��g|_yr^)r�r�s r(rjzTableRowElement.__init__"s	��-/��
r*c�^�t|t�sJ�|jj|�yr�)r`�TableDataElementr�r_r8s   r(r:zTableRowElement.on_child_close%s(���%�!1�2�2�2��
�
���%� �r*Nr�rGr�r#r*r(r�r�s��D�0�r*r�c�2�eZdZdZedd��Zdd�Zdd�Zy)	r�z[MarkdownElement corresponding to `td_open` and `td_close`
    and `th_open` and `th_close`.c��t|jjd��xsd}d|vrd}nd|vrd}n	d|vrd}nd	}|tt�vsJ�||�
�S)Nr\rzztext-align:right�rightztext-align:centerrwztext-align:leftrWr�rX)ra�attrs�getr
r)r%r&r'r\rYs     r(r)zTableDataElement.create/sj���E�K�K�O�O�G�,�-�3�����&��G�
 �E�
)��G�
�%�
'��G��G��(�=�1�1�1�1��7�#�#r*c�6�td|��|_||_y)NrzrX)rr�rYris  r(rjzTableDataElement.__init__@s��!�"�g�6�����r*c��t|t�rt|�n|}|j|j�|j
j
|�yr^)r`rar�stylizerbr��append_textr2s   r(r4zTableDataElement.on_textDs:��'��c�2�t�D�z������W�*�*�+���� � ��&r*Nr@rlrF)rJrKrLrQrNr)rjr4r#r*r(r�r�+s%��%��$��$� �'r*r�c�F�eZdZdZedd��Zdd�Zd	d�Z						d
d�Zy)�ListElementzA list element.c	�n�||jt|jjdd���S)N�startr)�type�intr�r�r$s   r(r)zListElement.createMs'���5�:�:�s�5�;�;�?�?�7�A�#>�?�@�@r*c�.�g|_||_||_yr^)�items�	list_type�
list_start)r-r�r�s   r(rjzListElement.__init__Qs��%'��
�"���$��r*c�^�t|t�sJ�|jj|�yr�)r`�ListItemr�r_r8s   r(r:zListElement.on_child_closeVs'���%��*�*�*��
�
���%� �r*c#�fK�|jdk(r,|jD]}|j||�Ed{����y|j�dn|j}|t	|j�z}t|j�D]$\}}|j
||||z|�Ed{����&y7�v7�	�w)N�bullet_list_openr)r�r��
render_bulletr��len�	enumerate�
render_number)r-r=r>�item�number�last_number�indexs       r(r?zListElement.__rich_console__[s������>�>�/�/��
�
���-�-�g�w�?�?�?�#��/�/�1�Q�t���F� �3�t�z�z�?�2�K�(����4���t��-�-��W�f�u�n�k���� 5�	@��
�s"�4B1�B-�A.B1�%B/�&B1�/B1N)r&rAr'rrBr�)r�rar�z
int | NonerBrErGrI)	rJrKrLrQrNr)rjr:r?r#r*r(r�r�Js@����A��A�%�
�
���)7��	�r*r�c�H�eZdZdZdZdd�Zd	d�Zd
d�Z										dd�Zy)r�zAn item in a list.z
markdown.itemc�"�t�|_yr^r�r�s r(rjzListItem.__init__or�r*c�:�|jj|�yr�r�r8s   r(r:zListItem.on_child_closerr�r*c#�\K�|j|jdz
��}|j|j||j��}|jdd��}t
d|�}t
d|�}t
d	�}t|�D]\}	}
|	r|n|��|
Ed{���|���y7��w)
Nrr�r�zmarkdown.item.bulletrTr�u • z   r�)r�r�r�r�r\r�rr)r-r=r>r�r��bullet_style�bulletr�r!�firstr�s           r(r�zListItem.render_bulletvs����� ���g�.?�.?�!�.C��D���$�$�T�]�]�N�$�*�*�$�U���(�(�)?��(�P����,�/���'�<�0���4�=��%�e�,�K�E�4�!�&�w�.��O�O��N�-��s�BB,�B*�B,c#�K�tt|��dz}|j|j|z
��}|j	|j
||j��}|jdd��}td�}	td|z|�}
t|�j|d	z
�dz|�}t|�D]\}}
|r|n|
��|
Ed{���|	���y7��w)
N�r�r�zmarkdown.item.numberrTr�r�r�r)r�rar�r�r�r�r\r�r�rjustr)r-r=r>r�r��number_widthr�r��number_styler!r��numeralr�r�s              r(r�zListItem.render_number�s������3�{�+�,�q�0�� ���g�.?�.?�,�.N��O���$�$�T�]�]�N�$�*�*�$�U���(�(�)?��(�P���4�=���#��,�l�;���V�H�+�+�L�1�,<�=��C�\�R��%�e�,�K�E�4�"�'��/��O�O��N�-��s�CC�C�CNr�rGrI)
r=rr>rr�r�r�r�rBr)	rJrKrLrQr[rjr:r�r�r#r*r(r�r�jsF��� �J�3������)7��AD��SV��	�r*r�c�&�eZdZedd��Zdd�Zy)�Linkc�r�|jjdd�}||jt|��S)N�href�#)r�r�r�ra)r%r&r'�urls    r(r)zLink.create�s+���k�k�o�o�f�c�*���5�=�=�#�c�(�+�+r*c�2�t|�|_||_yr^)rr3r�)r-r3r�s   r(rjz
Link.__init__�s����J��	���	r*Nr@)r3rar�ra)rJrKrLrNr)rjr#r*r(r�r��s���,��,�r*r�c�Z��eZdZdZdZedd��Zd�fd�Zd	�fd�Z						d
d�Z	�xZ
S)�	ImageItemz#Renders a placeholder for an image.Fc�n�|t|jjdd��|j�S)z�Factory to create markdown element,

        Args:
            markdown (Markdown): The parent Markdown object.
            token (Any): A token from markdown-it.

        Returns:
            MarkdownElement: A new markdown element
        �srcrz)rar�r��
hyperlinksr$s   r(r)zImageItem.create�s+���3�u�{�{���u�b�1�2�H�4G�4G�H�Hr*c�L��||_||_d|_t�|��yr^)�destinationr�linkrtrj)r-rrrus   �r(rjzImageItem.__init__�s$���&���$��� $��	�
���r*c�|��|jj|_td��|_t�|�|�yrV)rbrrr3rtr/)r-r.rus  �r(r/zImageItem.on_enter�s/����)�)�.�.��	���(��	�
����!r*c#�ZK�t|jxs|jxsd��}|jxs7t	|jjd�j
dd�d�}|jr|j|�t	jd|dd��}|��y�w)	N�r�/r���u🌆 r�rz)�end)
rrrr3r�strip�rsplitrr��assemble)r-r=r>�
link_style�titler3s      r(r?zImageItem.__rich_console__�s�������	�	� E�T�-=�-=� E��F�
��	�	�Q�T�$�"2�"2�"8�"8��"=�"D�"D�S�!�"L�R�"P�Q���?�?��M�M�*�%��}�}�W�e�S�b�9���
�s�B)B+r@)rrarrHrBrErCrI)rJrKrLrQr!rNr)rjr/r?r|r}s@r(rr�sF���-��H��
I��
I��"�
���)7��	�r*rc�^�eZdZdZ		d											d	d�Zed
d��Zdd�Zdd�Zd
d�Z	y)
rDz!Manages the console render state.Nc��||_||_t|�|_t	�|_d|_|�td||��|_yy)Nrz)r�)r=r>r�style_stackr�stack�_syntaxr)r-r=r>r\�inline_code_lexer�inline_code_themes      r(rjzMarkdownContext.__init__�sL��������'1�%�'8���-2�W��
�&*����(�!�"�&7�?P�Q�D�L�)r*c�.�|jjS)z>Current style which is the product of all styles on the stack.)r�currentr�s r(rbzMarkdownContext.current_style�s�����'�'�'r*c�f�|dvr�|j�{|jj|�}|j�|jjj|t
j||jj���y|jjj||�y)z#Called when the parser visits text.>�fence�code_inlineNr�)
r�	highlightr�r�topr4rrrr)r-r3�	node_type�highlight_texts    r(r4zMarkdownContext.on_text�s����0�0�T�\�\�5M�!�\�\�3�3�D�9�N��!�!�#��J�J�N�N�"�"��d�m�m�N�$�:J�:J�:R�:R�S�
�
�J�J�N�N�"�"�4��.r*c��|jj|d��}|jj|�|jS)zEnter a style context.rTr�)r=r�r�pushrb)r-r[r\s   r(rZzMarkdownContext.enter_style�s;�����&�&�z�6�&�B�������e�$��!�!�!r*c�:�|jj�}|S)zLeave a style context.)r�pop)r-r\s  r(rdzMarkdownContext.leave_style�s��� � �$�$�&���r*)N�monokai)r=rr>rr\rr�
str | NonerrarBrE)rBr)r3rar"rarBrE)r[�str | StylerBr)
rJrKrLrQrj�propertyrbr4rZrdr#r*r(rDrD�sv��+�)-�!*�
R��R� �R��	R�
&�R��
R�
�R�"�(��(�	/�"�r*rDc���eZdZUdZide�de�de�de�de�de�de	�d	e	�d
e
�de�de�d
e
�de�de�de�de�Zded<hd�Z						d															dd�Zdd�Z						dd�Zy)rAa�A Markdown renderable.

    Args:
        markup (str): A string containing markdown.
        code_theme (str, optional): Pygments theme for code blocks. Defaults to "monokai". See https://pygments.org/styles/ for code themes.
        justify (JustifyMethod, optional): Justify value for paragraphs. Defaults to None.
        style (Union[str, Style], optional): Optional style to apply to markdown.
        hyperlinks (bool, optional): Enable hyperlinks. Defaults to ``True``.
        inline_code_lexer: (str, optional): Lexer to use if inline code highlighting is
            enabled. Defaults to None.
        inline_code_theme: (Optional[str], optional): Pygments theme for inline code
            highlighting, or None for no highlighting. Defaults to None.
    �paragraph_open�heading_openr�
code_block�blockquote_open�hrr��ordered_list_open�list_item_open�image�
table_open�
tbody_open�
thead_open�tr_open�td_open�th_openz*ClassVar[dict[str, type[MarkdownElement]]]r�>�s�emr��strongNc���t�jd�jd�}||_|j|�|_||_||_||_||_||_	|xs||_
y)N�
strikethroughr�)r�enable�markup�parse�parsedr�rYr\rrr)	r-rAr�rYr\rrr�parsers	         r(rjzMarkdown.__init__si����$�$�_�5�<�<�W�E������l�l�6�*���$���-4�����
�$���!2���!2�!@�j��r*c#��K�|D]X}|jdk(}|jdk(}|jr(|s&|s$|j|j�Ed{����U|���Zy7��w)zFlattens the token stream.r�imgN)r�rp�children�_flatten_tokens)r-�tokensr'�is_fence�is_images     r(rHzMarkdown._flatten_tokens/sZ�����E��z�z�W�,�H��y�y�E�)�H��~�~�x�8��/�/����?�?�?���
�@�s�AA#�A!�
A#c#�
K�|j|jd��}|jd��}t||||j|j
��}|j}|j}d}tj�}|j|�D�]�}	|	j}
|	j}|	jdk(}|	jdk(}
|	jd	k(}|
d
k(r|j|	j|
��k|
dk(r|jd|
���|
d
k(r|jd|
���|
dk(r�t!|	j"j%dd��}|j&r5|jdd��}|t)|��z
}|j+|���|j,j/t0j3||	����7|
dk(�r|j&r|j5���[|j,j7�}t9|t0�sJ�|jdd��}|j+|�|j|j:j<|
�|j5�|jd|
�|jdd��}|j+|�|j|j>|
�|j5�|jd|
���W||vr�|
dk7r|
dk7rz|r|j+d|�����}|
r|j5����|j+d|���|	jr|j|	j|
�|j5����|j@j%|	j�xstB}|j3||	�}|s|r,|j,j/|�|jE|�|
r�|j,j7�}|j,xs4|j,xr&|j,jFjI||�}|r�|r|��|jK||jL�Ed{���n�|r�|j,j7�|	j}|�|j||�|j,xs4|j,xr&|j,jFjI||�}|r/|r	|
dk7r|��|jK||jL�Ed{���|
s|s���|jO|�|jP}���y7��7�-�w)zRender markdown to the console.rTr�N)�height)rrFrr
rr3�	hardbreakr��	softbreakr��	link_openr�rzzmarkdown.link_urlr�
link_closez
markdown.linkz (�)rr/rs�inline))r�r\r�rDrrrC�inlinesrr�rHr�rp�nestingr4r�rar�r�rrrZrr%r�r)rdr'r`r3�plainr�r�rPr/r!r:�renderr>r6r!)r-r=r>r\r.rI�inline_style_tagsr!�_new_line_segmentr'r"rp�entering�exiting�self_closingr�rr��link_url_style�
element_class�
should_renderr3s                      r(r?zMarkdown.__rich_console__9s������!�!�$�*�*�f�!�=���.�.��.�-��!����"�4�4�"�4�4�
������ �L�L����#�L�L�N���)�)�&�1�E��
�
�I��)�)�C��}�}��)�H��m�m�r�)�G� �=�=�A�-�L��F�"�����
�
�y�9��k�)�����i�0��k�)�����Y�/��k�)��5�;�;�?�?�6�2�6�7���?�?�!(�!2�!2�3F�PV�!2�!W�J��%�T�"2�2�J��'�'�
�3��M�M�&�&�t�{�{�4��'?�@��l�*��?�?��'�'�)�%�m�m�/�/�1�G�%�g�t�4�4�4�!(�!2�!2�?�F�!2�!S�J��'�'�
�3��O�O�G�L�L�$6�$6�	�B��'�'�)��O�O�D�)�4�%,�%6�%6�+�V�&7�&�N��'�'��7��O�O�G�L�L�)�<��'�'�)��O�O�C��3��(�(���(���-���'�'�)�C�5�(9�:���'�'�)��'�'�)�C�5�(9�:��}�}�����
�
�y�A��'�'�)�!%�
�
� 1� 1�%�*�*� =� O��
�'�.�.�t�U�;���|��M�M�&�&�w�/��$�$�W�-��%�m�m�/�/�1�G�(/�
�
�$5�%��
�
�O�#�M�M�-�-�<�<�W�g�N�"�
%�#�"3�3�#*�>�>�'�7�?�?�#K�K�K�!��M�M�%�%�'� �=�=�D��'������6�$�M�M�)�O�"�=�=�O�#�M�M�-�-�<�<�W�g�N�"�
%�#�	�X�(=�"3�3�#*�>�>�'�7�?�?�#K�K�K��l��$�$�W�-�&�/�/�H�G2�`L��L�s+�Q'U
�)U�*B0U
�U�U
�%"U
�U
)r(NrTTNN)rArar�rarYzJustifyMethod | Noner\r*rrHrr)rr)rBrE)rI�Iterable[Token]rBr`rI)rJrKrLrQrfrnrr�r�r�r�rr�r�r�r�r�r�rMrTrjrHr?r#r*r(rArA�ss���<��)�<���<�	��<�	�i�	<�
	�:�<�	
�n�
<�	�K�<�	�[�<�	�(�<�	��<�	�l�<�	�&�<�	�(�<�	�?�<�	�#�<� 	�#�!<�H�8��&,�G�
$�(,�#��(,�(,�A��A��A�&�	A�
�A��
A�&�A�&�A�
�A�(�u0��u0�)7�u0�	�u0r*rA�__main__z(Render Markdown to the console with Rich)�description�path�PATHz%path to markdown file, or - for stdin)�metavar�helpz-cz
--force-color�force_color�
store_truezforce color for non-terminals)�dest�actionr�rfz-tz--code-themer�r(zpygments code theme)rir�rfz-iz--inline-code-lexerrz-yz--hyperlinksrzenable hyperlinks)rirjrfz-wz--widthr�z*width of output (default will auto-detect))r�rir�rfz-jz	--justifyrYzenable full text justifyz-pz--page�pagezuse pager to scroll output)r�-zutf-8)�encoding�fullrW)rYr�rr)�file�force_terminalr�T)rpr��record)]�
__future__r�sys�typingrr�markdown_itr�markdown_it.tokenr�version_infor
�typing_extensions�
rich.tablerrzr�_loopr�_stackrr=rrrr�
containersr�jupyterr�panelr�ruler�segmentrr\rrr�rr3rrr rPrSrfrnrr�r�r�r�r�r�r�r�r�r�rrDrArJ�argparse�ArgumentParserrD�add_argumentr��
parse_args�args�rich.consolerc�stdin�read�
markdown_body�open�
markdown_filerYr�rrr&rk�io�pydoc�StringIO�fileiorgr��print�pager�getvaluer#r*r(�<module>r�s���"�
�%�"�#����v���*�����I�I�#�!����$�� �6�6�r�_��
�/�
� ���( �k� �F���2���4	 �_�	 ��?��B	��	�	��	�	�o�	�'��'�>�/��@'�{�'�T�;��%��%�P-�-�`w0�|�w0�t�z����
$�X�
$�
$�>��F������
4���
�����
���
,�
�������
��
"��������
 ��
 ��������
��
 ��������
�
��
9�
�������
��
'��������
��
)�������D�$��y�y�C���	�	���(�
�
�$�)�)�g�
.�-�)�.�.�0�M�/����,�,��F��?�?��?�?��0�0��H��y�y������������(8�(8��
�
�
��	�
�
�h������F�O�O�%�&���+�+�4�:�:�d�
��	�
�
�h���L/�
.�s�N�N