markdown随手记

优雅漂亮的 readme

标题

开头写n多个#就表示这是一个标题,#越少表示标题级别越高

锚点:不同平台的方式不同效果也不相同

锚点怎么写?点我

换行

可以一行的最后使用两个或两个以上的空格, 也可以使用
标签
我是一行文本
我是第二行文本
我是第三行文本

特殊字符 & 和 <

  • &copy;: ©
  • a&b
  • &amp; : &
  • &: &
  • <: <
  • 1 < 2
  • &lt;: <

字体

字体与标识符之间不能加空格

加粗

在文字的前后加两个星号
bold

斜体

斜体文字:文字前后加一个 星号
斜体加粗: 文字前后加三个 星号
斜体加粗的文字

删除线

需要删除的内容 使用删除线:文字前后添加 ~~

列表

  • 无序列表 使用 * - 开头的一系列文本项
    • 无序列表项1
    • 无序列表项2
    • 无序列表项3
  • 有序列表 使用 数字加点 例如 1. 开头的文本列表项
    1. 列表项1
    2. 列表项2

基础模式结束,是时候展示真正的技术了


超链接

[linkId]: www.baidu.com “百度一下,你就知道这是一个参考式的连接”
[隐式链接]: www.baidu.com “百度一下,你就知道这是一个隐式链接”

  • 行内式链接
    • [跳转到百度](www.baidu.com “百度一下你就什么都不知道了。”):跳转到百度
  • 参考式链接 使用 Markdown 的参考式链接,可以让文件更像是浏览器最后产生的结果,让你可以把一些标记相关的元数据移到段落文字之外,你就可以增加链接而不让文章的阅读感觉被打断。
  • linkId 规范
    • 方括号(前面可以选择性地加上至多三个空格来缩进),里面输入链接文字
    • 接着一个冒号
    • 接着一个以上的空格或制表符
    • 接着链接的网址
    • 选择性地接着 title 内容,可以用单引号、双引号或是括弧包着
    • 链接ID的定义不要放在列表内部 否则可能会无法识别
  • 隐式链接标记功能让你可以省略指定链接标记,这种情形下,链接标记会视为等同于链接文字,要用隐式链接标记只要在链接文字后面加上一个空的方括号
  • 锚点
    使用html标签的特性,设置相应的id,使用超链接的 #id 实现锚点跳转
    锚点到这里

代码段

代码段在MarkDown中会被转化到 标签中

  • 单行代码
    let arr = new Array.form(new Set([1, 2, 4, 1, 3, 999]))
    如果代码中有反引号 ` 存在,则需要使用更多的反引号来开始和结束代码块,
    let str = `this is s String named &{name}
  • 多行代码块
    使用 ```分隔 并且需要独占一行
function () {
	console.log('this is a example form coding of markdown')
}

图片

[imageId]: https://i-blog.csdnimg.cn/blog_migrate/7d291f88f3a485cfca9248fae274590e.jpeg “这是参考是图片说明”

  • 行内式
    ![草帽路飞](https://i-blog.csdnimg.cn/blog_migrate/7d291f88f3a485cfca9248fae274590e.jpeg “这是一串图片的描述性文字”)
    草帽路飞
  • 参考式
    ![参考是图片]imageId
    参考是图片
  • markdown自带的图片展示不能自定义宽高,如果需要自定义宽高,可以使用html标签 img 来代替

转移符号 \

  • \<: <
  • \*
  • []

表格

表格的格式

name | age | sex | hobbit | work
--- | :---- | ---: | :----: | --
小明 | 12 | 男 | 滚出去 | 学生
小华 | 32 | 男 | 爱小花 | IT男
小红 | 18 | 女 | 花季少女 | 吃喝玩乐
<br>

版本号 | 项目名称 | 负责人 | 参与人 | 更新时间| 跟新内容| 技术支持
:------:|:-----------:|:-------:|:-----------------:|:---------:|:----------------------:|:-----------:
1.0 | readme 测试 | Mr Qyj | 你、我、他 | 2019-08-13 | 测试readme | network and others
1.1 | git 测试 | Mr Qyj | 你、我、他 | 2019-08-16 | 测试git | network and others

示例:

nameagesexhobbitwork
小明12滚出去学生
小华32爱小花IT男
小红18花季少女吃喝玩乐
版本号项目名称负责人参与人更新时间跟新内容技术支持
1.0readme 测试Mr Qyj你、我、他2019-08-13测试readmenetwork and others
1.1git 测试Mr Qyj你、我、他2019-08-16测试gitnetwork and others

flowchart流程图

节点定义方式

nodeName=>nodeType: nodeText[|flowstate][:>urlLink]

Items in [] are optional. 中括号内为可选项
nodeName defines the nodes variable name within the flowchart document.
nodeType defines what type the node is. See Node Types for more information.
nodeText is the text that will be inserted into the node. Newlines are allowed and will be reflected in the rendered node text.
flowstate is optional and uses the | operator that specifies extra styling for the node.
urlLink is optional and uses the :> operator to specify the url to link to.

节点连接方式

  • 使用 -> 连接不同节点: nodeA -> nodeB -> condition
  • 对条件节点使用yes和no判断,同时可以指定分支方向和下一个节点
    condition(yes, [right | left]) -> nodeC
    condition(no, [left | right]) -> nodeD

在连接流程图的时候,对于condition类型,有yes和no两个分支,默认情况下,yes在下面显示,right在右面显示。如果同时限制left和right,那么将按照默认的位置显示;如果只限制其中一个,那么另一个也自动限定,则可以按照设定的进行显示

nodeType

  • start
  • end
  • operation
  • subroutine
  • condition
  • inputoutput

示例

flowchat
st=>start: 测试项目:>https://fshows.yuque.com/tech-ozd0u/oul77n/kggcfy "北斗系统1.1"
productOp=>operation: 产品会|past
technologyOp=>operation: 技术会
submiteBug=>subroutine: 提交BUG
resolveBug=>operation: 修BUG中...
resolveCond=>condition: 改好了吗
codeOp=>operation: 疯狂coding
uedOp=>operation: UED评审会
testOp=>operation: 测试评审会
UEDInspect=>operation: UED验收
UIBug=>condition: 视觉BUG
testInspect=>operation: 测试验收
testBug=>condition: 测试问题
publishOp=>operation: 发布上线
onlineBug=>condition: 线上问题
e=>end
st->productOp->technologyOp->uedOp->codeOp->UEDInspect->UIBug
UIBug(yes,right)->submiteBug(right)->resolveBug(right)->resolveCond
UIBug(no)->testInspect->testBug
resolveCond(yes)->UEDInspect
resolveCond(no)->resolveBug
testBug(yes, right)->submiteBug
testBug(no)->publishOp->onlineBug
onlineBug(yes, right)->submiteBug
onlineBug(no)->e
Created with Raphaël 2.2.0 测试项目 产品会 技术会 UED评审会 疯狂coding UED验收 视觉BUG 提交BUG 修BUG中... 改好了吗 测试验收 测试问题 发布上线 线上问题 End yes no yes no yes no yes no

mermaid 流程图

示例

graph LR
origin((远程仓库 github gitlab))
origin --> my-local(本地仓库)
my-local --> branchA(分支A)
branchA --> fileA((文件A))
branchA --> fileB((文件B))
my-local --> branchB(分支B)
branchB --> fileC((文件F))
branchB ==> fileD((文件B))
origin --> your-local(本地仓库)
your-local --> branchC(分支C)
branchC --> fileE((文件A))
branchC --> fileF((文件B))
your-local --> branchD(分支D)
branchD --> fileG((文件A))
branchD --> fileH((文件C))
location((本地文件))
location -.-> four(四维)
fileA -.-> location
fileB -.-> location
fileC -.-> location
fileD -.-> location
fileE -.-> location
fileF -.-> location
fileG -.-> location
fileH -.-> location
location -.-> three(三维)
three --> ip[主机地址]
three --> fileurl[文件路径]
three --> filename[文件名称]
five(五维)
branchA -.-> five
branchB -.-> five
branchC -.-> five
branchD -.-> five
six(六维)
my-local -.-> six
your-local -.-> six
style origin fill: #0b61a4, fill-opacity: 0.7, stroke: #fa0, stroke-width: 2px;
style my-local fill: #00a779, stroke: #fa0, stroke-width: 2px;
style your-local fill: #00a779, stroke: #fa0, stroke-width: 2px;
style branchA fill: #48dd00, stroke: #fa0, stroke-width: 2px;
style branchB fill: #48dd00, stroke: #fa0, stroke-width: 2px;
style branchC fill: #48dd00, stroke: #fa0, stroke-width: 2px;
style branchD fill: #48dd00, stroke: #fa0, stroke-width: 2px;
style fileA fill: #d5f800, stroke: #fa0, stroke-width: 2px;
style fileB fill: #d5f800, stroke: #fa0, stroke-width: 2px;
style fileC fill: #d5f800, stroke: #fa0, stroke-width: 2px;
style fileD fill: #d5f800, stroke: #fa0, stroke-width: 2px;
style fileE fill: #d5f800, stroke: #fa0, stroke-width: 2px;
style fileF fill: #d5f800, stroke: #fa0, stroke-width: 2px;
style fileG fill: #d5f800, stroke: #fa0, stroke-width: 2px;
style fileH fill: #d5f800, stroke: #fa0, stroke-width: 2px;
style location fill: #ffe200, stroke: #fa0, stroke-width: 2px;
style ip fill: #ff8500, stroke: #fa0, stroke-width: 2px;
style fileurl fill: #ff6f00, stroke: #fa0, stroke-width: 2px;
style filename fill: #ff4f00, stroke: #fa0, stroke-width: 2px;
style six fill: #009999, stroke: #fa0, stroke-width: 3px;
style five fill: #009999, stroke: #fa0, stroke-width: 3px;
style four fill: #009999, stroke: #fa0, stroke-width: 3px;
style three fill: #009999, stroke: #fa0, stroke-width: 3px

生成流程图如下:

远程仓库 github gitlab
本地仓库
分支A
文件A
文件B
分支B
文件F
文件B
本地仓库
分支C
文件A
文件B
分支D
文件A
文件C
本地文件
四维
三维
主机地址
文件路径
文件名称
五维
六维

语法说明

连接线使用 - . > 连接 虚线的点和箭头分别站一个位置

  • graph:显示方向
    TB/TD( top bottom/top down)表示从上到下
    BT(bottom top)表示从下到上
    RL(right left)表示从右到左
    LR(left right)表示从左到右

  • 节点类型
    默认节点: A
    矩形节点: B[矩形]
    圆角矩形节点: C(圆角矩形)
    圆形节点: D((圆形))
    非对称节点: E>非对称]
    菱形节点: F{菱形}

  • 节点连接类型

    • 箭头连接 A1- ->B1
    • 开放连接 A2- - -B2
    • 虚线箭头连接 A3.->B3 或者 A3-.->B3
    • 虚线连接 A4.-B4 或者 A4-.-B4
    • 粗线箭头连接 A5==>B5
    • 粗线开放连接 A6===B6
    • 标签虚线箭头连接 A7-.text.->B7
    • 标签开放连接 A8- -text- - -B8
    • 小结:
      • - 表示直线
      • > 表示箭头
      • . 表示虚线
      • = 表示粗直线
  • 节点样式
    fill:节点填充颜色
    fill-opacity:填充透明度
    stroke:边框颜色
    stroke-width:边框宽度
    样式写法与 SVG 样式写法一致


以优美的分割线结束时惯例

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值