使用typora绘制精美流程图/Typora tutorial: exquisite graph

in utopian-io •  7 years ago  (edited)

DQmbgzru4YUCtQnwiZkMBQHEzTxCUTzbUn5tSytrWUeukos_副本.jpg

Summary:
Typora supports the insert flow chart, the Gantt chart, the time sequence diagram. It's not just a simple insert chart, but you can use statements to make the charts beautifully. Today I'll show you how to use typora to insert exquisite graph.
之前简单介绍了typora可以插入流程图,其实我们可以借助于语句来实现精美的流程图,而且语法很简单,这里我们使用的是mermaid语句,下面我将展示如何使用该语句输出精美的流程图。

1.对typora进行设置,让它支持我们即将使用的mermaid语句

typora集成了很多模块,因此其实不仅仅可以绘制流程图,在我们绘制流程图之前,先确认下识别flow语句的引擎有没有打开,不然没办法绘制流程图。点击“file”文件菜单,选择“preferences”个人选项。在弹出的窗口,找到Syntax support(语法支持),勾选 Diagrams(图表).

360截图20180101093230032.jpg

2.语法讲解

在typora输入的时候,都是按下面这个格式:

````mermaid
语句部分
````

下面讲解将直接显示语句部分:

Graph声明方向

graph LR
    A --> B

360截图20180101093806706.jpg

这是声明一个水平向右的图,LR 就是属性之一。 A和B 只是obj
可能方向有:
TB 上下 BT 下上 RL 右左 LR 左右 TD 上下

节点与形状

数字节点

 graph LR 
1

360截图20180101093806706.jpg

文本节点

 graph LR 
id[这里输入的是文本]

360截图20180101093806706.jpg

圆角节点

 graph LR
id(这里输入的是文本)

360截图20180101093806706.jpg

圆节点

 graph LR
 id((这里输入的是文本))

360截图20180101093806706.jpg

非对称节点

 graph LR
 id>这里输入的文字]

360截图20180101093806706.jpg

菱形节点

graph LR
id{这里输入的是文本}

360截图20180101093806706.jpg

连接线

节点间的连接线有多种形状,而且可以在连接线中加入标签:

箭头形连接

graph LR;
  A-->B;

360截图20180101093806706.jpg

开放行连接

graph LR
A --- B

标签连接

graph LR
A -- 标签文本--- B;

360截图20180101093806706.jpg

箭头标签连接

graph LR
 A-- text -->B

360截图20180101093806706.jpg

虚线

graph LR
A-.->B

360截图20180101093806706.jpg

虚线不带箭头 A-.-.B 标签虚线 A-.text.->B

粗实线

graph LR
A==>B

360截图20180101093806706.jpg

不带箭头粗线 A===B 标签粗线 A==text==>B

特殊的语法

使用引号可以抑制一些特殊的字符的使用,可以避免一些不必要的麻烦。

graph LR\ 
d1[“This is the (text) in the box”]

360截图20180101093806706.jpg

html字符的转义字符

graph LR
        A["A double quote:#quot;"]-->B["A dec char:#9829;"]

360截图20180101093806706.jpg

插入表情

如果想加入来自frontawesome的图表字体,需要像frontawesome网站上那样引用的那样

graph TD
      B["fa:fa-twitter 哈哈"]
      B-->C[fa:fa-ban 哈哈]
      B-->D(fa:fa-spinner);
      B-->E(A fa:fa-camera-retro 哈哈);

360截图20180101102515340.jpg

今天教程就介绍到这里,markdown编辑器,推荐使用typora。谢谢阅读!



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
  ·  7 years ago 

这个,我一直用纯文本编辑器 notepad++,不纠结工具。越简单越好用。

臣附议

Hey @jubi I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Congratulations @jubi! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You published 4 posts in one day
You published a post every day of the week

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

这个工具还真不错,可惜steemit还不支持吧,以后也许能支持,我先收藏一下!

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]