【Dash】Markdown

Markdown

While Dash exposes HTML through Dash HTML Components (dash.html ), it can be tedious to write your copy in HTML. For writing blocks of text, you can use the Markdown component in Dash Core Components (dash.dcc).

Dash apps can be written in Markdown. Dash uses the CommonMarkspecification of Markdown.

python 复制代码
from dash import Dash, html, dcc

app = Dash(__name__)

markdown_text = '''
### Dash and Markdown

Dash apps can be written in Markdown.
Dash uses the [ComonMark](http://commonmark.org/)
specification of Markdown.
Check out their [60 Second Markdown Tutorial](http://commonmark.org/help/)
if this is your first introduction to Markdown!
'''


app.layout = html.Div([
    dcc.Markdown(children=markdown_text)
])

if __name__ == '__main__':
    app.run(debug=True)
相关推荐
Zane199438 分钟前
闭包到底"闭"住了什么?一文讲透 LEGB 规则与循环里的闭包陷阱
后端·python
Lumi_Peak1 小时前
Claude思考了42秒,我的代码质量直接提升了一个档次
python·claude
m沐沐1 小时前
【机器学习】DBSCAN聚类算法——原理、参数调优与实战
人工智能·python·深度学习·算法·机器学习·聚类·dbscan
梅孔立2 小时前
推荐一个 Python 开源项目:AI 模板填充 + Markdown 转 Word,面向 Aspose 模板引擎的效率神器
人工智能·python·开源
码农小韩2 小时前
AIAgent应用开发——大模型理论基础与应用(七)
python·学习·ai·大模型·agent
CodeLinghu2 小时前
LangSmith Evaluate实战评估Agent
人工智能·python·语言模型·llm
起司喵喵2 小时前
推荐一款基于 Python 和 Rust 开发的跨平台 GUI 自动化库!
python·rust·自动化
过期的秋刀鱼!3 小时前
学习曲线-过拟合和欠拟合要做什么以及原因
人工智能·python·深度学习·算法·机器学习·模型评估
Yolanda_20223 小时前
Python学习-第九部分-错误处理与异常处理
开发语言·python·学习
这个人懒得名字都没写4 小时前
Flask + PyArmor Gunicorn启动报错:RuntimeError: unauthorised use of script
python·flask·gunicorn·pyarmor