【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)
相关推荐
曲幽5 小时前
数据库实战:FastAPI + SQLAlchemy 2.0 + Alembic 从零搭建,踩坑实录
python·fastapi·web·sqlalchemy·db·asyncio·alembic
用户83562907805110 小时前
Python 实现 PowerPoint 形状动画设置
后端·python
ponponon11 小时前
时代的眼泪,nameko 和 eventlet 停止维护后的项目自救,升级和替代之路
python
Flittly11 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(5)Skills (技能加载)
python·agent
敏编程11 小时前
一天一个Python库:pyarrow - 大规模数据处理的利器
python
Flittly13 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(4)Subagents (子智能体)
python·agent
明月_清风20 小时前
Python 装饰器前传:如果不懂“闭包”,你只是在复刻代码
后端·python
明月_清风20 小时前
打破“死亡环联”:深挖 Python 分代回收与垃圾回收(GC)机制
后端·python
ZhengEnCi2 天前
08c. 检索算法与策略-混合检索
后端·python·算法
叶智辽2 天前
Three.js多视口渲染:如何在一个屏幕上同时展示三个视角
webgl·three.js·数据可视化