
    ch                        S SK Jr  S SKrS SKJrJr  S SKJrJrJ	r	J
r
Jr  S SKJr  S SKJr  \(       a  S SKJr  S SKJr   " S	 S
5      rg)    )annotationsN)TYPE_CHECKINGcast)HeightLayoutConfigWidthvalidate_heightvalidate_width)Code)gather_metrics)DeltaGenerator)SupportsStrc                  v    \ rS rSr\" S5       SSSSSS.             SS jjj5       r\SS j5       rS	rg
)	CodeMixin#   codeFcontentstretch)line_numbers
wrap_linesheightwidthc               @   [        5       n[        R                  " SS[        R                  " SS[        U5      5      5      Ul        U=(       d    SUl        X7l        XGl        Uc  SnO
[        USS9  [        USS9  [        XVS9nU R                  R                  S	XxS
9$ )a  Display a code block with optional syntax highlighting.

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

language : str or None
    The language that the code is written in, for syntax highlighting.
    This defaults to ``"python"``. If this is ``None``, the code will
    be plain, monospace text.

    For a list of available ``language`` values, see
    `react-syntax-highlighter
    <https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD>`_
    on GitHub.

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

wrap_lines : bool
    An optional boolean indicating whether to wrap lines. This defaults
    to ``False``.

height : "content", "stretch", or int
    The height of the code block element. This can be one of the following:

    - ``"content"`` (default): The height of the element matches the
      height of its content.
    - ``"stretch"``: The height of the element matches the height of
      its content or the height of the parent container, whichever is
      larger. If the element is not in a parent container, the height
      of the element matches the height of its content.
    - An integer specifying the height in pixels: The element has a
      fixed height. If the content is larger than the specified
      height, scrolling is enabled.

    .. note::
        Use scrolling containers sparingly. If you use scrolling
        containers, avoid heights that exceed 500 pixels. Otherwise,
        the scroll surface of the container might cover the majority of
        the screen on mobile devices, which makes it hard to scroll the
        rest of the app.

width : "stretch", "content", or int
    The width of the code block element. This can be one of the following:

    - ``"stretch"`` (default): The width of the element matches the
      width of the parent container.
    - ``"content"``: The width of the element matches the width of its
      content, but doesn't exceed the width of the parent container.
    - An integer specifying the width in pixels: The element has a
      fixed width. If the specified width is greater than the width of
      the parent container, the width of the element matches the width
      of the parent container.

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

.. output ::
    https://doc-code.streamlit.app/
    height: 220px

>>> import streamlit as st
>>> code = '''Is it a crown or boat?
...                         ii
...                       iiiiii
... WWw                 .iiiiiiii.                ...:
...  WWWWWWw          .iiiiiiiiiiii.         ........
...   WWWWWWWWWWw    iiiiiiiiiiiiiiii    ...........
...    WWWWWWWWWWWWWWwiiiiiiiiiiiiiiiii............
...     WWWWWWWWWWWWWWWWWWwiiiiiiiiiiiiii.........
...      WWWWWWWWWWWWWWWWWWWWWWwiiiiiiiiii.......
...       WWWWWWWWWWWWWWWWWWWWWWWWWWwiiiiiii....
...        WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWwiiii.
...           -MMMWWWWWWWWWWWWWWWWWWWWWWMMM-
... '''
>>> st.code(code, language=None)

.. output ::
    https://doc-code-ascii.streamlit.app/
    height: 380px
z\n\Z z\A\n	plaintextr   T)allow_content)r   r   r   )layout_config)	CodeProtoresubstr	code_textlanguageshow_line_numbersr   r	   r
   r   dg_enqueue)	selfbodyr#   r   r   r   r   
code_protor   s	            jC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\streamlit/elements/code.pyr   CodeMixin.code$   s    H [
!vvgr266'2s4y3QR
&5+
'3$ *>FF$7uD1$F@ww
PP    c                    [        SU 5      $ )zGet our DeltaGenerator.r   )r   )r'   s    r*   r%   CodeMixin.dg   s     $d++r,    N)python)r(   r   r#   z
str | Noner   boolr   r1   r   zHeight | Noner   r   returnr   )r2   r   )	__name__
__module____qualname____firstlineno__r   r   propertyr%   __static_attributes__r/   r,   r*   r   r   #   s    F  (pQ
 #  ) pQpQ pQ
 pQ pQ pQ pQ 
pQ pQd , ,r,   r   )
__future__r   r   typingr   r   #streamlit.elements.lib.layout_utilsr   r   r   r	   r
   streamlit.proto.Code_pb2r   r   streamlit.runtime.metrics_utilr   streamlit.delta_generatorr   streamlit.type_utilr   r   r/   r,   r*   <module>r@      s7    # 	 &  7 98/w, w,r,   