
    &e	                     t    d dl mZmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ erd dlmZ  G d d          Zd	S )
    )TYPE_CHECKINGOptionalcast)Code)gather_metrics)
clean_text)SupportsStr)DeltaGeneratorc            
       r    e Zd Z ed          	 	 ddedee         deddfd	            Ze	dd
            Z
dS )	CodeMixincodepythonFbodylanguageline_numbersreturnr
   c                     t                      }t          |          |_        |pd|_        ||_        | j                            d|          S )a  Display a code block with optional syntax highlighting.

        Parameters
        ----------
        body : str
            The string to display as code.

        language : str or None
            The language that the code is written in, for syntax highlighting.
            If ``None``, the code will be unstyled. Defaults to ``"python"``.

            For a list of available ``language`` values, see:

            https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD

        line_numbers : bool
            An optional boolean indicating whether to show line numbers to the
            left of the code block. Defaults to ``False``.

        Example
        -------
        >>> import streamlit as st
        >>>
        >>> code = '''def hello():
        ...     print("Hello, Streamlit!")'''
        >>> st.code(code, language='python')

        	plaintextr   )	CodeProtor   	code_textr   show_line_numbersdg_enqueue)selfr   r   r   
code_protos        7lib/python3.11/site-packages/streamlit/elements/code.pyr   zCodeMixin.code   sK    F [[
)$//
&5+
'3
$w
333    c                 "    t          d|           S )zGet our DeltaGenerator.r
   )r   )r   s    r   r   zCodeMixin.dgD   s     $d+++r   N)r   F)r   r
   )__name__
__module____qualname__r   r	   r   strboolr   propertyr    r   r   r   r      s        ^F #+"	&4 &4&4 3-&4 	&4
 
&4 &4 &4 &4P , , , X, , ,r   r   N)typingr   r   r   streamlit.proto.Code_pb2r   r   streamlit.runtime.metrics_utilr   streamlit.string_utilr   streamlit.type_utilr	   streamlit.delta_generatorr
   r   r%   r   r   <module>r,      s    1 0 0 0 0 0 0 0 0 0 6 6 6 6 6 6 9 9 9 9 9 9 , , , , , , + + + + + + 9888888-, -, -, -, -, -, -, -, -, -,r   