markdown语法typora(中)

简介: markdown语法typora(中)

避免特殊字符的错误


文字里用引号避免一些特殊字符的错误。比如矩形节点里有 () 时就无法渲染,所以加上引号。此后yf就指的是This is the (text) in the box


graph LR
    yf["This is the (text) in the box"]


效果图:


image.png


时序图


sequenceDiagram
    participant Alice
    participant Bob
    Alice->John: Hello John, how are you?
    loop Healthcheck
        John->John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail...
    John-->Alice: Great!
    John->Bob: How about you?
    Bob-->John: Jolly good!


image.png


image.png


参与者顺序


如果不显示声明,参与者将根据第一次出现的顺序排列,如:


sequenceDiagram
    Alice->>John: Hello John, how are you?
    John-->>Alice: Great!


image.png


第一条语句出现了两个参与者角色,而在这条语句中,Alice 在 John 之前,所以图中也是这个顺序。如果不想根据第一次出现的顺序来排,可以主动声明以定义顺序:


sequenceDiagramDiagram
    participant John
    participant Alice
    Alice->>John: Hello John, how are you?
    John-->>Alice: Great!


image.png


角色别名


可以给角色写一个简短的别名以方便书写。


sequenceDiagram
    participant A as Alice
    participant J as John
    A->>J: Hello John, how are you?
    J->>A: Great!


image.png


消息


消息连线有六种样式。

一个-是实线,两个-是虚线。


sequenceDiagram
    A->B: 无箭头实线
    A-->B: 无箭头虚线(点线)
    A->>B: 有箭头实线
    A-->>B: 有箭头实线
    A-x B: 有箭头实线,加上叉
    A--x B: 有箭头虚线,加上叉


image.png


flow图


image.png


甘特图


        gantt
        dateFormat  YYYY-MM-DD
        title Adding GANTT diagram functionality to mermaid
        section A section
        Completed task            :done,    des1, 2014-01-06,2014-01-08
        Active task               :active,  des2, 2014-01-09, 3d
        Future task               :         des3, after des2, 5d
        Future task2               :         des4, after des3, 5d
        section Critical tasks
        Completed task in the critical line :crit, done, 2014-01-06,24h
        Implement parser and jison          :crit, done, after des1, 2d
        Create tests for parser             :crit, active, 3d
        Future task in critical line        :crit, 5d
        Create tests for renderer           :2d
        Add to mermaid                      :1d
        section Documentation
        Describe gantt syntax               :active, a1, after des1, 3d
        Add gantt diagram to demo page      :after a1  , 20h
        Add another diagram to demo page    :doc1, after a1  , 48h
        section Last section
        Describe gantt syntax               :after doc1, 3d
        Add gantt diagram to demo page      : 20h
        Add another diagram to demo page    : 48h


%% Example with slection of syntaxes
        gantt
        dateFormat  YYYY-MM-DD
        title Adding GANTT diagram functionality to mermaid
        section A section
        Completed task            :done,    des1, 2014-01-06,2014-01-08
        Active task               :active,  des2, 2014-01-09, 3d
        Future task               :         des3, after des2, 5d
        Future task2               :         des4, after des3, 5d
        section Critical tasks
        Completed task in the critical line :crit, done, 2014-01-06,24h
        Implement parser and jison          :crit, done, after des1, 2d
        Create tests for parser             :crit, active, 3d
        Future task in critical line        :crit, 5d
        Create tests for renderer           :2d
        Add to mermaid                      :1d
        section Documentation
        Describe gantt syntax               :active, a1, after des1, 3d
        Add gantt diagram to demo page      :after a1  , 20h
        Add another diagram to demo page    :doc1, after a1  , 48h
        section Last section
        Describe gantt syntax               :after doc1, 3d
        Add gantt diagram to demo page      : 20h
        Add another diagram to demo page    : 48h


image.png

相关文章
|
23天前
【Typora】markdown神器之Typora无限使用安装与基本操作教程
【Typora】markdown神器之Typora无限使用安装与基本操作教程
50 3
|
26天前
|
程序员 Linux iOS开发
一款比Typora更简洁优雅的Markdown编辑器神器(完全开源免费)
一款比Typora更简洁优雅的Markdown编辑器神器(完全开源免费)
|
2月前
markdown常用语法--花括号(超详细)
markdown常用语法--花括号(超详细)
|
2月前
|
IDE 数据可视化 数据挖掘
Jupyter Notebook使用教程——从Anaconda环境构建到Markdown、LaTex语法介绍
Jupyter Notebook使用教程——从Anaconda环境构建到Markdown、LaTex语法介绍
64 2
|
2月前
Markdown的基本语法(一)
Markdown的基本语法(一)
|
3月前
|
开发者
阿里云开发者社区Markdown语法
【2月更文挑战第1篇】
147 0
阿里云开发者社区Markdown语法
|
4月前
|
数据可视化 iOS开发 MacOS
如何在Typora中以可视化或源码的方式使用markdown
如何在Typora中以可视化或源码的方式使用markdown
60 0
|
4月前
|
前端开发 API
MarkDown基础语法
MarkDown基础语法
86 0
|
4月前
|
缓存 iOS开发 MacOS
R沟通|​markdown编辑器—Typora
R沟通|​markdown编辑器—Typora
59 0
|
5月前
|
Dart Shell pouch
markdown中快速插入Emoji表情包语法速查表!!!
markdown中快速插入Emoji表情包语法速查表!!!