顯示格式為 Markdown 的字符串。
函數簽名
st.markdown(body, unsafe_allow_html=False)
參數 | 說明 |
---|---|
body (str) | 要顯示為 Github-flavored Markdown 的字符串。可以在以下位置找到語法信息:https://github.github.com/gfm。 這也支持:
|
unsafe_allow_html (bool) | 默認情況下,在正文中找到的任何 HTML 標記都將被轉義,因此被視為純文本。通過將此參數設置為 True,可以關閉此行為。 也就是說,我們 https://github.com/streamlit/streamlit/issues/152
如果您仍然決定啟用 HTML,請在此處告訴我們您的確切用例: https://discuss.streamlit.io/t/96 這將幫助我們提供安全的 API,讓您可以隨心所欲。 |
示例
st.markdown('Streamlit is **_really_ cool**.')

相關用法
- Python Streamlit st.map用法及代碼示例
- Python Streamlit st.metric用法及代碼示例
- Python Streamlit st.multiselect用法及代碼示例
- Python Streamlit st.experimental_singleton.clear用法及代碼示例
- Python Streamlit st.bokeh_chart用法及代碼示例
- Python Streamlit st.caption用法及代碼示例
- Python Streamlit st.text_input用法及代碼示例
- Python Streamlit st.area_chart用法及代碼示例
- Python Streamlit st.title用法及代碼示例
- Python Streamlit st.cache用法及代碼示例
- Python Streamlit st.experimental_singleton用法及代碼示例
- Python Streamlit st.empty用法及代碼示例
- Python Streamlit st.error用法及代碼示例
- Python Streamlit st.video用法及代碼示例
- Python Streamlit st.vega_lite_chart用法及代碼示例
- Python Streamlit st.slider用法及代碼示例
- Python Streamlit st.header用法及代碼示例
- Python Streamlit st.container用法及代碼示例
- Python Streamlit st.form_submit_button用法及代碼示例
- Python Streamlit st.form用法及代碼示例
- Python Streamlit st.plotly_chart用法及代碼示例
- Python Streamlit st.bar_chart用法及代碼示例
- Python Streamlit st.code用法及代碼示例
- Python Streamlit st.experimental_memo.clear用法及代碼示例
- Python Streamlit st.warning用法及代碼示例
注:本文由純淨天空篩選整理自streamlit.io大神的英文原創作品 st.markdown。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。