We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix wrong Streamlit static app for st.caption() doc
**Link to doc page in question (if any):**

[[click here]](https://docs.streamlit.io/library/api-reference/text/st.caption)

**Name of the Streamlit feature whose docs need improvement:**
`st.caption()`

**What you think the docs should say:**
The Streamlit static app below should show how `st.caption()` works - it currently shows how `st.title()` work

<img src="https://user-images.githubusercontent.com/7164864/137554438-77380317-1267-4840-9521-36f86e32b456.png" width="300px">

➡️  Code is [here](https://github.com/streamlit/streamlit/blob/267bf98d9a8f8d94cf6d3e9f0ea8866233d4836e/lib/streamlit/elements/markdown.py#L221) but I have no idea how to replace that URL with a correct one

--- 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-2021 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
16 
17 import streamlit
18 from streamlit import type_util
19 from streamlit.proto.Markdown_pb2 import Markdown as MarkdownProto
20 from .utils import clean_text
21 
22 
23 class MarkdownMixin:
24     def markdown(self, body, unsafe_allow_html=False):
25         """Display string formatted as Markdown.
26 
27         Parameters
28         ----------
29         body : str
30             The string to display as Github-flavored Markdown. Syntax
31             information can be found at: https://github.github.com/gfm.
32 
33             This also supports:
34 
35             * Emoji shortcodes, such as `:+1:`  and `:sunglasses:`.
36               For a list of all supported codes,
37               see https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.
38 
39             * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
40               must be on their own lines). Supported LaTeX functions are listed
41               at https://katex.org/docs/supported.html.
42 
43         unsafe_allow_html : bool
44             By default, any HTML tags found in the body will be escaped and
45             therefore treated as pure text. This behavior may be turned off by
46             setting this argument to True.
47 
48             That said, we *strongly advise against it*. It is hard to write
49             secure HTML, so by using this argument you may be compromising your
50             users' security. For more information, see:
51 
52             https://github.com/streamlit/streamlit/issues/152
53 
54             *Also note that `unsafe_allow_html` is a temporary measure and may
55             be removed from Streamlit at any time.*
56 
57             If you decide to turn on HTML anyway, we ask you to please tell us
58             your exact use case here:
59 
60             https://discuss.streamlit.io/t/96
61 
62             This will help us come up with safe APIs that allow you to do what
63             you want.
64 
65         Example
66         -------
67         >>> st.markdown('Streamlit is **_really_ cool**.')
68 
69         .. output::
70            https://static.streamlit.io/0.25.0-2JkNY/index.html?id=PXz9xgY8aB88eziDVEZLyS
71            height: 50px
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, anchor=None):
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         .. output::
98            https://static.streamlit.io/0.25.0-2JkNY/index.html?id=AnfQVFgSCQtGv6yMUMUYjj
99            height: 100px
100 
101         """
102         header_proto = MarkdownProto()
103         if anchor is None:
104             header_proto.body = f"## {clean_text(body)}"
105         else:
106             header_proto.body = f'<h2 data-anchor="{anchor}">{clean_text(body)}</h2>'
107             header_proto.allow_html = True
108         return self.dg._enqueue("markdown", header_proto)
109 
110     def subheader(self, body, anchor=None):
111         """Display text in subheader formatting.
112 
113         Parameters
114         ----------
115         body : str
116             The text to display.
117 
118         anchor : str
119             The anchor name of the header that can be accessed with #anchor
120             in the URL. If omitted, it generates an anchor using the body.
121 
122         Example
123         -------
124         >>> st.subheader('This is a subheader')
125 
126         .. output::
127            https://static.streamlit.io/0.25.0-2JkNY/index.html?id=LBKJTfFUwudrbWENSHV6cJ
128            height: 100px
129 
130         """
131         subheader_proto = MarkdownProto()
132         if anchor is None:
133             subheader_proto.body = f"### {clean_text(body)}"
134         else:
135             subheader_proto.body = f'<h3 data-anchor="{anchor}">{clean_text(body)}</h3>'
136             subheader_proto.allow_html = True
137 
138         return self.dg._enqueue("markdown", subheader_proto)
139 
140     def code(self, body, language="python"):
141         """Display a code block with optional syntax highlighting.
142 
143         (This is a convenience wrapper around `st.markdown()`)
144 
145         Parameters
146         ----------
147         body : str
148             The string to display as code.
149 
150         language : str
151             The language that the code is written in, for syntax highlighting.
152             If omitted, the code will be unstyled.
153 
154         Example
155         -------
156         >>> code = '''def hello():
157         ...     print("Hello, Streamlit!")'''
158         >>> st.code(code, language='python')
159 
160         .. output::
161            https://static.streamlit.io/0.27.0-kBtt/index.html?id=VDRnaCEZWSBCNUd5gNQZv2
162            height: 100px
163 
164         """
165         code_proto = MarkdownProto()
166         markdown = "```%(language)s\n%(body)s\n```" % {
167             "language": language or "",
168             "body": body,
169         }
170         code_proto.body = clean_text(markdown)
171         return self.dg._enqueue("markdown", code_proto)
172 
173     def title(self, body, anchor=None):
174         """Display text in title formatting.
175 
176         Each document should have a single `st.title()`, although this is not
177         enforced.
178 
179         Parameters
180         ----------
181         body : str
182             The text to display.
183 
184         anchor : str
185             The anchor name of the header that can be accessed with #anchor
186             in the URL. If omitted, it generates an anchor using the body.
187 
188         Example
189         -------
190         >>> st.title('This is a title')
191 
192         .. output::
193            https://static.streamlit.io/0.25.0-2JkNY/index.html?id=SFcBGANWd8kWXF28XnaEZj
194            height: 100px
195 
196         """
197         title_proto = MarkdownProto()
198         if anchor is None:
199             title_proto.body = f"# {clean_text(body)}"
200         else:
201             title_proto.body = f'<h1 data-anchor="{anchor}">{clean_text(body)}</h1>'
202             title_proto.allow_html = True
203         return self.dg._enqueue("markdown", title_proto)
204 
205     def caption(self, body):
206         """Display text in small font.
207 
208         This should be used for captions, asides, footnotes, sidenotes, and
209         other explanatory text.
210 
211         Parameters
212         ----------
213         body : str
214             The text to display.
215 
216         Example
217         -------
218         >>> st.caption('This is a string that explains something above.')
219 
220         .. output::
221            https://static.streamlit.io/0.25.0-2JkNY/index.html?id=SFcBGANWd8kWXF28XnaEZj
222            height: 100px
223 
224         """
225         caption_proto = MarkdownProto()
226         caption_proto.body = body
227         caption_proto.allow_html = False
228         caption_proto.is_caption = True
229         return self.dg._enqueue("markdown", caption_proto)
230 
231     def latex(self, body):
232         # This docstring needs to be "raw" because of the backslashes in the
233         # example below.
234         r"""Display mathematical expressions formatted as LaTeX.
235 
236         Supported LaTeX functions are listed at
237         https://katex.org/docs/supported.html.
238 
239         Parameters
240         ----------
241         body : str or SymPy expression
242             The string or SymPy expression to display as LaTeX. If str, it's
243             a good idea to use raw Python strings since LaTeX uses backslashes
244             a lot.
245 
246 
247         Example
248         -------
249         >>> st.latex(r'''
250         ...     a + ar + a r^2 + a r^3 + \cdots + a r^{n-1} =
251         ...     \sum_{k=0}^{n-1} ar^k =
252         ...     a \left(\frac{1-r^{n}}{1-r}\right)
253         ...     ''')
254 
255         .. output::
256            https://static.streamlit.io/0.50.0-td2L/index.html?id=NJFsy6NbGTsH2RF9W6ioQ4
257            height: 75px
258 
259         """
260         if type_util.is_sympy_expession(body):
261             import sympy
262 
263             body = sympy.latex(body)
264 
265         latex_proto = MarkdownProto()
266         latex_proto.body = "$$\n%s\n$$" % clean_text(body)
267         return self.dg._enqueue("markdown", latex_proto)
268 
269     @property
270     def dg(self) -> "streamlit.delta_generator.DeltaGenerator":
271         """Get our DeltaGenerator."""
272         return cast("streamlit.delta_generator.DeltaGenerator", self)
273
```
--- 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
@@ -218,8 +218,8 @@
         >>> st.caption('This is a string that explains something above.')
 
         .. output::
-           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=SFcBGANWd8kWXF28XnaEZj
-           height: 100px
+           https://static.streamlit.io/1.1.0-eQCi/index.html?id=SVQb16b2UDZX4W8VLkEJLJ
+           height: 175px
 
         """
         caption_proto = MarkdownProto()

{"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@@ -218,8 +218,8 @@\n         >>> st.caption('This is a string that explains something above.')\n \n         .. output::\n-           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=SFcBGANWd8kWXF28XnaEZj\n-           height: 100px\n+           https://static.streamlit.io/1.1.0-eQCi/index.html?id=SVQb16b2UDZX4W8VLkEJLJ\n+           height: 175px\n \n         \"\"\"\n         caption_proto = MarkdownProto()\n", "issue": "Fix wrong Streamlit static app for st.caption() doc\n**Link to doc page in question (if any):**\r\n\r\n[[click here]](https://docs.streamlit.io/library/api-reference/text/st.caption)\r\n\r\n**Name of the Streamlit feature whose docs need improvement:**\r\n`st.caption()`\r\n\r\n**What you think the docs should say:**\r\nThe Streamlit static app below should show how `st.caption()` works - it currently shows how `st.title()` work\r\n\r\n<img src=\"https://user-images.githubusercontent.com/7164864/137554438-77380317-1267-4840-9521-36f86e32b456.png\" width=\"300px\">\r\n\r\n\u27a1\ufe0f  Code is [here](https://github.com/streamlit/streamlit/blob/267bf98d9a8f8d94cf6d3e9f0ea8866233d4836e/lib/streamlit/elements/markdown.py#L221) but I have no idea how to replace that URL with a correct one\n", "before_files": [{"content": "# Copyright 2018-2021 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\n\nimport streamlit\nfrom streamlit import type_util\nfrom streamlit.proto.Markdown_pb2 import Markdown as MarkdownProto\nfrom .utils import clean_text\n\n\nclass MarkdownMixin:\n    def markdown(self, body, unsafe_allow_html=False):\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://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.\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        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=PXz9xgY8aB88eziDVEZLyS\n           height: 50px\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, anchor=None):\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        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=AnfQVFgSCQtGv6yMUMUYjj\n           height: 100px\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, anchor=None):\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        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=LBKJTfFUwudrbWENSHV6cJ\n           height: 100px\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, language=\"python\"):\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        .. output::\n           https://static.streamlit.io/0.27.0-kBtt/index.html?id=VDRnaCEZWSBCNUd5gNQZv2\n           height: 100px\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, anchor=None):\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        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=SFcBGANWd8kWXF28XnaEZj\n           height: 100px\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):\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        Example\n        -------\n        >>> st.caption('This is a string that explains something above.')\n\n        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=SFcBGANWd8kWXF28XnaEZj\n           height: 100px\n\n        \"\"\"\n        caption_proto = MarkdownProto()\n        caption_proto.body = body\n        caption_proto.allow_html = False\n        caption_proto.is_caption = True\n        return self.dg._enqueue(\"markdown\", caption_proto)\n\n    def latex(self, body):\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        .. output::\n           https://static.streamlit.io/0.50.0-td2L/index.html?id=NJFsy6NbGTsH2RF9W6ioQ4\n           height: 75px\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) -> \"streamlit.delta_generator.DeltaGenerator\":\n        \"\"\"Get our DeltaGenerator.\"\"\"\n        return cast(\"streamlit.delta_generator.DeltaGenerator\", self)\n", "path": "lib/streamlit/elements/markdown.py"}], "after_files": [{"content": "# Copyright 2018-2021 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\n\nimport streamlit\nfrom streamlit import type_util\nfrom streamlit.proto.Markdown_pb2 import Markdown as MarkdownProto\nfrom .utils import clean_text\n\n\nclass MarkdownMixin:\n    def markdown(self, body, unsafe_allow_html=False):\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://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json.\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        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=PXz9xgY8aB88eziDVEZLyS\n           height: 50px\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, anchor=None):\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        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=AnfQVFgSCQtGv6yMUMUYjj\n           height: 100px\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, anchor=None):\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        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=LBKJTfFUwudrbWENSHV6cJ\n           height: 100px\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, language=\"python\"):\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        .. output::\n           https://static.streamlit.io/0.27.0-kBtt/index.html?id=VDRnaCEZWSBCNUd5gNQZv2\n           height: 100px\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, anchor=None):\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        .. output::\n           https://static.streamlit.io/0.25.0-2JkNY/index.html?id=SFcBGANWd8kWXF28XnaEZj\n           height: 100px\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):\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        Example\n        -------\n        >>> st.caption('This is a string that explains something above.')\n\n        .. output::\n           https://static.streamlit.io/1.1.0-eQCi/index.html?id=SVQb16b2UDZX4W8VLkEJLJ\n           height: 175px\n\n        \"\"\"\n        caption_proto = MarkdownProto()\n        caption_proto.body = body\n        caption_proto.allow_html = False\n        caption_proto.is_caption = True\n        return self.dg._enqueue(\"markdown\", caption_proto)\n\n    def latex(self, body):\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        .. output::\n           https://static.streamlit.io/0.50.0-td2L/index.html?id=NJFsy6NbGTsH2RF9W6ioQ4\n           height: 75px\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) -> \"streamlit.delta_generator.DeltaGenerator\":\n        \"\"\"Get our DeltaGenerator.\"\"\"\n        return cast(\"streamlit.delta_generator.DeltaGenerator\", self)\n", "path": "lib/streamlit/elements/markdown.py"}]}