We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
List supported languages for syntax highlighting with `st.code`
**Link to doc page in question (if any):** https://docs.streamlit.io/library/api-reference/text/st.code

**Name of the Streamlit feature whose docs need improvement:** `st.code`

**What you think the docs should say:** The docs should provide a list of all supported languages for syntax highlighting.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lib/streamlit/elements/markdown.py`
Content:
```
1 # Copyright 2018-2022 Streamlit Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #    http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 from typing import cast, Optional, TYPE_CHECKING, Union
16 
17 from streamlit import type_util
18 from streamlit.proto.Markdown_pb2 import Markdown as MarkdownProto
19 from .utils import clean_text
20 
21 if TYPE_CHECKING:
22     import sympy
23 
24     from streamlit.delta_generator import DeltaGenerator
25 
26 
27 class MarkdownMixin:
28     def markdown(self, body: str, unsafe_allow_html: bool = False) -> "DeltaGenerator":
29         """Display string formatted as Markdown.
30 
31         Parameters
32         ----------
33         body : str
34             The string to display as Github-flavored Markdown. Syntax
35             information can be found at: https://github.github.com/gfm.
36 
37             This also supports:
38 
39             * Emoji shortcodes, such as `:+1:`  and `:sunglasses:`.
40               For a list of all supported codes,
41               see https://share.streamlit.io/streamlit/emoji-shortcodes.
42 
43             * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
44               must be on their own lines). Supported LaTeX functions are listed
45               at https://katex.org/docs/supported.html.
46 
47         unsafe_allow_html : bool
48             By default, any HTML tags found in the body will be escaped and
49             therefore treated as pure text. This behavior may be turned off by
50             setting this argument to True.
51 
52             That said, we *strongly advise against it*. It is hard to write
53             secure HTML, so by using this argument you may be compromising your
54             users' security. For more information, see:
55 
56             https://github.com/streamlit/streamlit/issues/152
57 
58             *Also note that `unsafe_allow_html` is a temporary measure and may
59             be removed from Streamlit at any time.*
60 
61             If you decide to turn on HTML anyway, we ask you to please tell us
62             your exact use case here:
63 
64             https://discuss.streamlit.io/t/96
65 
66             This will help us come up with safe APIs that allow you to do what
67             you want.
68 
69         Example
70         -------
71         >>> st.markdown('Streamlit is **_really_ cool**.')
72 
73         """
74         markdown_proto = MarkdownProto()
75 
76         markdown_proto.body = clean_text(body)
77         markdown_proto.allow_html = unsafe_allow_html
78 
79         return self.dg._enqueue("markdown", markdown_proto)
80 
81     def header(self, body: str, anchor: Optional[str] = None) -> "DeltaGenerator":
82         """Display text in header formatting.
83 
84         Parameters
85         ----------
86         body : str
87             The text to display.
88 
89         anchor : str
90             The anchor name of the header that can be accessed with #anchor
91             in the URL. If omitted, it generates an anchor using the body.
92 
93         Example
94         -------
95         >>> st.header('This is a header')
96 
97         """
98         header_proto = MarkdownProto()
99         if anchor is None:
100             header_proto.body = f"## {clean_text(body)}"
101         else:
102             header_proto.body = f'<h2 data-anchor="{anchor}">{clean_text(body)}</h2>'
103             header_proto.allow_html = True
104         return self.dg._enqueue("markdown", header_proto)
105 
106     def subheader(self, body: str, anchor: Optional[str] = None) -> "DeltaGenerator":
107         """Display text in subheader formatting.
108 
109         Parameters
110         ----------
111         body : str
112             The text to display.
113 
114         anchor : str
115             The anchor name of the header that can be accessed with #anchor
116             in the URL. If omitted, it generates an anchor using the body.
117 
118         Example
119         -------
120         >>> st.subheader('This is a subheader')
121 
122         """
123         subheader_proto = MarkdownProto()
124         if anchor is None:
125             subheader_proto.body = f"### {clean_text(body)}"
126         else:
127             subheader_proto.body = f'<h3 data-anchor="{anchor}">{clean_text(body)}</h3>'
128             subheader_proto.allow_html = True
129 
130         return self.dg._enqueue("markdown", subheader_proto)
131 
132     def code(self, body: str, language: Optional[str] = "python") -> "DeltaGenerator":
133         """Display a code block with optional syntax highlighting.
134 
135         (This is a convenience wrapper around `st.markdown()`)
136 
137         Parameters
138         ----------
139         body : str
140             The string to display as code.
141 
142         language : str
143             The language that the code is written in, for syntax highlighting.
144             If omitted, the code will be unstyled.
145 
146         Example
147         -------
148         >>> code = '''def hello():
149         ...     print("Hello, Streamlit!")'''
150         >>> st.code(code, language='python')
151 
152         """
153         code_proto = MarkdownProto()
154         markdown = "```%(language)s\n%(body)s\n```" % {
155             "language": language or "",
156             "body": body,
157         }
158         code_proto.body = clean_text(markdown)
159         return self.dg._enqueue("markdown", code_proto)
160 
161     def title(self, body: str, anchor: Optional[str] = None) -> "DeltaGenerator":
162         """Display text in title formatting.
163 
164         Each document should have a single `st.title()`, although this is not
165         enforced.
166 
167         Parameters
168         ----------
169         body : str
170             The text to display.
171 
172         anchor : str
173             The anchor name of the header that can be accessed with #anchor
174             in the URL. If omitted, it generates an anchor using the body.
175 
176         Example
177         -------
178         >>> st.title('This is a title')
179 
180         """
181         title_proto = MarkdownProto()
182         if anchor is None:
183             title_proto.body = f"# {clean_text(body)}"
184         else:
185             title_proto.body = f'<h1 data-anchor="{anchor}">{clean_text(body)}</h1>'
186             title_proto.allow_html = True
187         return self.dg._enqueue("markdown", title_proto)
188 
189     def caption(self, body: str, unsafe_allow_html: bool = False) -> "DeltaGenerator":
190         """Display text in small font.
191 
192         This should be used for captions, asides, footnotes, sidenotes, and
193         other explanatory text.
194 
195         Parameters
196         ----------
197         body : str
198             The text to display.
199 
200         unsafe_allow_html : bool
201             By default, any HTML tags found in strings will be escaped and
202             therefore treated as pure text. This behavior may be turned off by
203             setting this argument to True.
204 
205             That said, *we strongly advise against it*. It is hard to write secure
206             HTML, so by using this argument you may be compromising your users'
207             security. For more information, see:
208 
209             https://github.com/streamlit/streamlit/issues/152
210 
211             **Also note that `unsafe_allow_html` is a temporary measure and may be
212             removed from Streamlit at any time.**
213 
214             If you decide to turn on HTML anyway, we ask you to please tell us your
215             exact use case here:
216             https://discuss.streamlit.io/t/96 .
217 
218             This will help us come up with safe APIs that allow you to do what you
219             want.
220 
221         Example
222         -------
223         >>> st.caption('This is a string that explains something above.')
224 
225         """
226         caption_proto = MarkdownProto()
227         caption_proto.body = clean_text(body)
228         caption_proto.allow_html = unsafe_allow_html
229         caption_proto.is_caption = True
230         return self.dg._enqueue("markdown", caption_proto)
231 
232     def latex(self, body: Union[str, "sympy.Expr"]) -> "DeltaGenerator":
233         # This docstring needs to be "raw" because of the backslashes in the
234         # example below.
235         r"""Display mathematical expressions formatted as LaTeX.
236 
237         Supported LaTeX functions are listed at
238         https://katex.org/docs/supported.html.
239 
240         Parameters
241         ----------
242         body : str or SymPy expression
243             The string or SymPy expression to display as LaTeX. If str, it's
244             a good idea to use raw Python strings since LaTeX uses backslashes
245             a lot.
246 
247 
248         Example
249         -------
250         >>> st.latex(r'''
251         ...     a + ar + a r^2 + a r^3 + \cdots + a r^{n-1} =
252         ...     \sum_{k=0}^{n-1} ar^k =
253         ...     a \left(\frac{1-r^{n}}{1-r}\right)
254         ...     ''')
255 
256         """
257         if type_util.is_sympy_expession(body):
258             import sympy
259 
260             body = sympy.latex(body)
261 
262         latex_proto = MarkdownProto()
263         latex_proto.body = "$$\n%s\n$$" % clean_text(body)
264         return self.dg._enqueue("markdown", latex_proto)
265 
266     @property
267     def dg(self) -> "DeltaGenerator":
268         """Get our DeltaGenerator."""
269         return cast("DeltaGenerator", self)
270
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/lib/streamlit/elements/markdown.py b/lib/streamlit/elements/markdown.py
--- a/lib/streamlit/elements/markdown.py
+++ b/lib/streamlit/elements/markdown.py
@@ -36,7 +36,7 @@
 
             This also supports:
 
-            * Emoji shortcodes, such as `:+1:`  and `:sunglasses:`.
+            * Emoji shortcodes, such as ``:+1:``  and ``:sunglasses:``.
               For a list of all supported codes,
               see https://share.streamlit.io/streamlit/emoji-shortcodes.
 
@@ -55,7 +55,7 @@
 
             https://github.com/streamlit/streamlit/issues/152
 
-            *Also note that `unsafe_allow_html` is a temporary measure and may
+            *Also note that ``unsafe_allow_html`` is a temporary measure and may
             be removed from Streamlit at any time.*
 
             If you decide to turn on HTML anyway, we ask you to please tell us
@@ -143,6 +143,10 @@
             The language that the code is written in, for syntax highlighting.
             If omitted, the code will be unstyled.
 
+            For a list of available ``language`` imports, see:
+
+            https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD
+
         Example
         -------
         >>> code = '''def hello():

{"golden_diff": "diff --git a/lib/streamlit/elements/markdown.py b/lib/streamlit/elements/markdown.py\n--- a/lib/streamlit/elements/markdown.py\n+++ b/lib/streamlit/elements/markdown.py\n@@ -36,7 +36,7 @@\n \n             This also supports:\n \n-            * Emoji shortcodes, such as `:+1:`  and `:sunglasses:`.\n+            * Emoji shortcodes, such as ``:+1:``  and ``:sunglasses:``.\n               For a list of all supported codes,\n               see https://share.streamlit.io/streamlit/emoji-shortcodes.\n \n@@ -55,7 +55,7 @@\n \n             https://github.com/streamlit/streamlit/issues/152\n \n-            *Also note that `unsafe_allow_html` is a temporary measure and may\n+            *Also note that ``unsafe_allow_html`` is a temporary measure and may\n             be removed from Streamlit at any time.*\n \n             If you decide to turn on HTML anyway, we ask you to please tell us\n@@ -143,6 +143,10 @@\n             The language that the code is written in, for syntax highlighting.\n             If omitted, the code will be unstyled.\n \n+            For a list of available ``language`` imports, see:\n+\n+            https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD\n+\n         Example\n         -------\n         >>> code = '''def hello():\n", "issue": "List supported languages for syntax highlighting with `st.code`\n**Link to doc page in question (if any):** https://docs.streamlit.io/library/api-reference/text/st.code\r\n\r\n**Name of the Streamlit feature whose docs need improvement:** `st.code`\r\n\r\n**What you think the docs should say:** The docs should provide a list of all supported languages for syntax highlighting.\r\n\n", "before_files": [{"content": "# Copyright 2018-2022 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import cast, Optional, TYPE_CHECKING, Union\n\nfrom streamlit import type_util\nfrom streamlit.proto.Markdown_pb2 import Markdown as MarkdownProto\nfrom .utils import clean_text\n\nif TYPE_CHECKING:\n    import sympy\n\n    from streamlit.delta_generator import DeltaGenerator\n\n\nclass MarkdownMixin:\n    def markdown(self, body: str, unsafe_allow_html: bool = False) -> \"DeltaGenerator\":\n        \"\"\"Display string formatted as Markdown.\n\n        Parameters\n        ----------\n        body : str\n            The string to display as Github-flavored Markdown. Syntax\n            information can be found at: https://github.github.com/gfm.\n\n            This also supports:\n\n            * Emoji shortcodes, such as `:+1:`  and `:sunglasses:`.\n              For a list of all supported codes,\n              see https://share.streamlit.io/streamlit/emoji-shortcodes.\n\n            * LaTeX expressions, by wrapping them in \"$\" or \"$$\" (the \"$$\"\n              must be on their own lines). Supported LaTeX functions are listed\n              at https://katex.org/docs/supported.html.\n\n        unsafe_allow_html : bool\n            By default, any HTML tags found in the body will be escaped and\n            therefore treated as pure text. This behavior may be turned off by\n            setting this argument to True.\n\n            That said, we *strongly advise against it*. It is hard to write\n            secure HTML, so by using this argument you may be compromising your\n            users' security. For more information, see:\n\n            https://github.com/streamlit/streamlit/issues/152\n\n            *Also note that `unsafe_allow_html` is a temporary measure and may\n            be removed from Streamlit at any time.*\n\n            If you decide to turn on HTML anyway, we ask you to please tell us\n            your exact use case here:\n\n            https://discuss.streamlit.io/t/96\n\n            This will help us come up with safe APIs that allow you to do what\n            you want.\n\n        Example\n        -------\n        >>> st.markdown('Streamlit is **_really_ cool**.')\n\n        \"\"\"\n        markdown_proto = MarkdownProto()\n\n        markdown_proto.body = clean_text(body)\n        markdown_proto.allow_html = unsafe_allow_html\n\n        return self.dg._enqueue(\"markdown\", markdown_proto)\n\n    def header(self, body: str, anchor: Optional[str] = None) -> \"DeltaGenerator\":\n        \"\"\"Display text in header formatting.\n\n        Parameters\n        ----------\n        body : str\n            The text to display.\n\n        anchor : str\n            The anchor name of the header that can be accessed with #anchor\n            in the URL. If omitted, it generates an anchor using the body.\n\n        Example\n        -------\n        >>> st.header('This is a header')\n\n        \"\"\"\n        header_proto = MarkdownProto()\n        if anchor is None:\n            header_proto.body = f\"## {clean_text(body)}\"\n        else:\n            header_proto.body = f'<h2 data-anchor=\"{anchor}\">{clean_text(body)}</h2>'\n            header_proto.allow_html = True\n        return self.dg._enqueue(\"markdown\", header_proto)\n\n    def subheader(self, body: str, anchor: Optional[str] = None) -> \"DeltaGenerator\":\n        \"\"\"Display text in subheader formatting.\n\n        Parameters\n        ----------\n        body : str\n            The text to display.\n\n        anchor : str\n            The anchor name of the header that can be accessed with #anchor\n            in the URL. If omitted, it generates an anchor using the body.\n\n        Example\n        -------\n        >>> st.subheader('This is a subheader')\n\n        \"\"\"\n        subheader_proto = MarkdownProto()\n        if anchor is None:\n            subheader_proto.body = f\"### {clean_text(body)}\"\n        else:\n            subheader_proto.body = f'<h3 data-anchor=\"{anchor}\">{clean_text(body)}</h3>'\n            subheader_proto.allow_html = True\n\n        return self.dg._enqueue(\"markdown\", subheader_proto)\n\n    def code(self, body: str, language: Optional[str] = \"python\") -> \"DeltaGenerator\":\n        \"\"\"Display a code block with optional syntax highlighting.\n\n        (This is a convenience wrapper around `st.markdown()`)\n\n        Parameters\n        ----------\n        body : str\n            The string to display as code.\n\n        language : str\n            The language that the code is written in, for syntax highlighting.\n            If omitted, the code will be unstyled.\n\n        Example\n        -------\n        >>> code = '''def hello():\n        ...     print(\"Hello, Streamlit!\")'''\n        >>> st.code(code, language='python')\n\n        \"\"\"\n        code_proto = MarkdownProto()\n        markdown = \"```%(language)s\\n%(body)s\\n```\" % {\n            \"language\": language or \"\",\n            \"body\": body,\n        }\n        code_proto.body = clean_text(markdown)\n        return self.dg._enqueue(\"markdown\", code_proto)\n\n    def title(self, body: str, anchor: Optional[str] = None) -> \"DeltaGenerator\":\n        \"\"\"Display text in title formatting.\n\n        Each document should have a single `st.title()`, although this is not\n        enforced.\n\n        Parameters\n        ----------\n        body : str\n            The text to display.\n\n        anchor : str\n            The anchor name of the header that can be accessed with #anchor\n            in the URL. If omitted, it generates an anchor using the body.\n\n        Example\n        -------\n        >>> st.title('This is a title')\n\n        \"\"\"\n        title_proto = MarkdownProto()\n        if anchor is None:\n            title_proto.body = f\"# {clean_text(body)}\"\n        else:\n            title_proto.body = f'<h1 data-anchor=\"{anchor}\">{clean_text(body)}</h1>'\n            title_proto.allow_html = True\n        return self.dg._enqueue(\"markdown\", title_proto)\n\n    def caption(self, body: str, unsafe_allow_html: bool = False) -> \"DeltaGenerator\":\n        \"\"\"Display text in small font.\n\n        This should be used for captions, asides, footnotes, sidenotes, and\n        other explanatory text.\n\n        Parameters\n        ----------\n        body : str\n            The text to display.\n\n        unsafe_allow_html : bool\n            By default, any HTML tags found in strings will be escaped and\n            therefore treated as pure text. This behavior may be turned off by\n            setting this argument to True.\n\n            That said, *we strongly advise against it*. It is hard to write secure\n            HTML, so by using this argument you may be compromising your users'\n            security. For more information, see:\n\n            https://github.com/streamlit/streamlit/issues/152\n\n            **Also note that `unsafe_allow_html` is a temporary measure and may be\n            removed from Streamlit at any time.**\n\n            If you decide to turn on HTML anyway, we ask you to please tell us your\n            exact use case here:\n            https://discuss.streamlit.io/t/96 .\n\n            This will help us come up with safe APIs that allow you to do what you\n            want.\n\n        Example\n        -------\n        >>> st.caption('This is a string that explains something above.')\n\n        \"\"\"\n        caption_proto = MarkdownProto()\n        caption_proto.body = clean_text(body)\n        caption_proto.allow_html = unsafe_allow_html\n        caption_proto.is_caption = True\n        return self.dg._enqueue(\"markdown\", caption_proto)\n\n    def latex(self, body: Union[str, \"sympy.Expr\"]) -> \"DeltaGenerator\":\n        # This docstring needs to be \"raw\" because of the backslashes in the\n        # example below.\n        r\"\"\"Display mathematical expressions formatted as LaTeX.\n\n        Supported LaTeX functions are listed at\n        https://katex.org/docs/supported.html.\n\n        Parameters\n        ----------\n        body : str or SymPy expression\n            The string or SymPy expression to display as LaTeX. If str, it's\n            a good idea to use raw Python strings since LaTeX uses backslashes\n            a lot.\n\n\n        Example\n        -------\n        >>> st.latex(r'''\n        ...     a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n        ...     \\sum_{k=0}^{n-1} ar^k =\n        ...     a \\left(\\frac{1-r^{n}}{1-r}\\right)\n        ...     ''')\n\n        \"\"\"\n        if type_util.is_sympy_expession(body):\n            import sympy\n\n            body = sympy.latex(body)\n\n        latex_proto = MarkdownProto()\n        latex_proto.body = \"$$\\n%s\\n$$\" % clean_text(body)\n        return self.dg._enqueue(\"markdown\", latex_proto)\n\n    @property\n    def dg(self) -> \"DeltaGenerator\":\n        \"\"\"Get our DeltaGenerator.\"\"\"\n        return cast(\"DeltaGenerator\", self)\n", "path": "lib/streamlit/elements/markdown.py"}], "after_files": [{"content": "# Copyright 2018-2022 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import cast, Optional, TYPE_CHECKING, Union\n\nfrom streamlit import type_util\nfrom streamlit.proto.Markdown_pb2 import Markdown as MarkdownProto\nfrom .utils import clean_text\n\nif TYPE_CHECKING:\n    import sympy\n\n    from streamlit.delta_generator import DeltaGenerator\n\n\nclass MarkdownMixin:\n    def markdown(self, body: str, unsafe_allow_html: bool = False) -> \"DeltaGenerator\":\n        \"\"\"Display string formatted as Markdown.\n\n        Parameters\n        ----------\n        body : str\n            The string to display as Github-flavored Markdown. Syntax\n            information can be found at: https://github.github.com/gfm.\n\n            This also supports:\n\n            * Emoji shortcodes, such as ``:+1:``  and ``:sunglasses:``.\n              For a list of all supported codes,\n              see https://share.streamlit.io/streamlit/emoji-shortcodes.\n\n            * LaTeX expressions, by wrapping them in \"$\" or \"$$\" (the \"$$\"\n              must be on their own lines). Supported LaTeX functions are listed\n              at https://katex.org/docs/supported.html.\n\n        unsafe_allow_html : bool\n            By default, any HTML tags found in the body will be escaped and\n            therefore treated as pure text. This behavior may be turned off by\n            setting this argument to True.\n\n            That said, we *strongly advise against it*. It is hard to write\n            secure HTML, so by using this argument you may be compromising your\n            users' security. For more information, see:\n\n            https://github.com/streamlit/streamlit/issues/152\n\n            *Also note that ``unsafe_allow_html`` is a temporary measure and may\n            be removed from Streamlit at any time.*\n\n            If you decide to turn on HTML anyway, we ask you to please tell us\n            your exact use case here:\n\n            https://discuss.streamlit.io/t/96\n\n            This will help us come up with safe APIs that allow you to do what\n            you want.\n\n        Example\n        -------\n        >>> st.markdown('Streamlit is **_really_ cool**.')\n\n        \"\"\"\n        markdown_proto = MarkdownProto()\n\n        markdown_proto.body = clean_text(body)\n        markdown_proto.allow_html = unsafe_allow_html\n\n        return self.dg._enqueue(\"markdown\", markdown_proto)\n\n    def header(self, body: str, anchor: Optional[str] = None) -> \"DeltaGenerator\":\n        \"\"\"Display text in header formatting.\n\n        Parameters\n        ----------\n        body : str\n            The text to display.\n\n        anchor : str\n            The anchor name of the header that can be accessed with #anchor\n            in the URL. If omitted, it generates an anchor using the body.\n\n        Example\n        -------\n        >>> st.header('This is a header')\n\n        \"\"\"\n        header_proto = MarkdownProto()\n        if anchor is None:\n            header_proto.body = f\"## {clean_text(body)}\"\n        else:\n            header_proto.body = f'<h2 data-anchor=\"{anchor}\">{clean_text(body)}</h2>'\n            header_proto.allow_html = True\n        return self.dg._enqueue(\"markdown\", header_proto)\n\n    def subheader(self, body: str, anchor: Optional[str] = None) -> \"DeltaGenerator\":\n        \"\"\"Display text in subheader formatting.\n\n        Parameters\n        ----------\n        body : str\n            The text to display.\n\n        anchor : str\n            The anchor name of the header that can be accessed with #anchor\n            in the URL. If omitted, it generates an anchor using the body.\n\n        Example\n        -------\n        >>> st.subheader('This is a subheader')\n\n        \"\"\"\n        subheader_proto = MarkdownProto()\n        if anchor is None:\n            subheader_proto.body = f\"### {clean_text(body)}\"\n        else:\n            subheader_proto.body = f'<h3 data-anchor=\"{anchor}\">{clean_text(body)}</h3>'\n            subheader_proto.allow_html = True\n\n        return self.dg._enqueue(\"markdown\", subheader_proto)\n\n    def code(self, body: str, language: Optional[str] = \"python\") -> \"DeltaGenerator\":\n        \"\"\"Display a code block with optional syntax highlighting.\n\n        (This is a convenience wrapper around `st.markdown()`)\n\n        Parameters\n        ----------\n        body : str\n            The string to display as code.\n\n        language : str\n            The language that the code is written in, for syntax highlighting.\n            If omitted, the code will be unstyled.\n\n            For a list of available ``language`` imports, see:\n\n            https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_PRISM.MD\n\n        Example\n        -------\n        >>> code = '''def hello():\n        ...     print(\"Hello, Streamlit!\")'''\n        >>> st.code(code, language='python')\n\n        \"\"\"\n        code_proto = MarkdownProto()\n        markdown = \"```%(language)s\\n%(body)s\\n```\" % {\n            \"language\": language or \"\",\n            \"body\": body,\n        }\n        code_proto.body = clean_text(markdown)\n        return self.dg._enqueue(\"markdown\", code_proto)\n\n    def title(self, body: str, anchor: Optional[str] = None) -> \"DeltaGenerator\":\n        \"\"\"Display text in title formatting.\n\n        Each document should have a single `st.title()`, although this is not\n        enforced.\n\n        Parameters\n        ----------\n        body : str\n            The text to display.\n\n        anchor : str\n            The anchor name of the header that can be accessed with #anchor\n            in the URL. If omitted, it generates an anchor using the body.\n\n        Example\n        -------\n        >>> st.title('This is a title')\n\n        \"\"\"\n        title_proto = MarkdownProto()\n        if anchor is None:\n            title_proto.body = f\"# {clean_text(body)}\"\n        else:\n            title_proto.body = f'<h1 data-anchor=\"{anchor}\">{clean_text(body)}</h1>'\n            title_proto.allow_html = True\n        return self.dg._enqueue(\"markdown\", title_proto)\n\n    def caption(self, body: str, unsafe_allow_html: bool = False) -> \"DeltaGenerator\":\n        \"\"\"Display text in small font.\n\n        This should be used for captions, asides, footnotes, sidenotes, and\n        other explanatory text.\n\n        Parameters\n        ----------\n        body : str\n            The text to display.\n\n        unsafe_allow_html : bool\n            By default, any HTML tags found in strings will be escaped and\n            therefore treated as pure text. This behavior may be turned off by\n            setting this argument to True.\n\n            That said, *we strongly advise against it*. It is hard to write secure\n            HTML, so by using this argument you may be compromising your users'\n            security. For more information, see:\n\n            https://github.com/streamlit/streamlit/issues/152\n\n            **Also note that `unsafe_allow_html` is a temporary measure and may be\n            removed from Streamlit at any time.**\n\n            If you decide to turn on HTML anyway, we ask you to please tell us your\n            exact use case here:\n            https://discuss.streamlit.io/t/96 .\n\n            This will help us come up with safe APIs that allow you to do what you\n            want.\n\n        Example\n        -------\n        >>> st.caption('This is a string that explains something above.')\n\n        \"\"\"\n        caption_proto = MarkdownProto()\n        caption_proto.body = clean_text(body)\n        caption_proto.allow_html = unsafe_allow_html\n        caption_proto.is_caption = True\n        return self.dg._enqueue(\"markdown\", caption_proto)\n\n    def latex(self, body: Union[str, \"sympy.Expr\"]) -> \"DeltaGenerator\":\n        # This docstring needs to be \"raw\" because of the backslashes in the\n        # example below.\n        r\"\"\"Display mathematical expressions formatted as LaTeX.\n\n        Supported LaTeX functions are listed at\n        https://katex.org/docs/supported.html.\n\n        Parameters\n        ----------\n        body : str or SymPy expression\n            The string or SymPy expression to display as LaTeX. If str, it's\n            a good idea to use raw Python strings since LaTeX uses backslashes\n            a lot.\n\n\n        Example\n        -------\n        >>> st.latex(r'''\n        ...     a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n        ...     \\sum_{k=0}^{n-1} ar^k =\n        ...     a \\left(\\frac{1-r^{n}}{1-r}\\right)\n        ...     ''')\n\n        \"\"\"\n        if type_util.is_sympy_expession(body):\n            import sympy\n\n            body = sympy.latex(body)\n\n        latex_proto = MarkdownProto()\n        latex_proto.body = \"$$\\n%s\\n$$\" % clean_text(body)\n        return self.dg._enqueue(\"markdown\", latex_proto)\n\n    @property\n    def dg(self) -> \"DeltaGenerator\":\n        \"\"\"Get our DeltaGenerator.\"\"\"\n        return cast(\"DeltaGenerator\", self)\n", "path": "lib/streamlit/elements/markdown.py"}]}