Markdown常用语法
加粗 斜体 删除线
加一个星号或下划线为斜体
*test* 或 _test_
效果: test
加两个星号或下划线为加粗
**test** 或 __test__
效果:test
加三个星号或下划线为加粗的斜体
***test*** 或 ___test___
效果:test
加两个波浪线为带删除线的文字
~~你看不见我~~
效果:你看不见我
引用
将 >
加在一段文字的开头表示引用
> 成功就是1%的努力加上99%的不玩手机
成功就是1%的努力加上99%的不玩手机
多个>>
嵌套加在一段文字开头表示嵌套引用
>成功就是1%的努力加上99%的不玩手机
>>这不是我说的
成功就是1%的努力加上99%的不玩手机
这不是我说的
标题
Setext式语法: 在标题文字下加==号或者---号表示标题
This is H1
==========
效果如下:
This is H1
==========
和
This is H2
----------
效果如下:
This is H2
atx式语法: 在标题文字前加上#
号表示标题,#
号越少,标题级别越高
# This is H1
## This is H2
### This is H3
#### This is H4
##### This is H5
###### This is H6
效果如下:
This is H1
This is H2
This is H3
This is H4
This is H5
This is H6
列表
有序列表
在行首增加 1.、2.、3.,即数字和英文句点, 加一个空格 , 不要求数字一定要连续,可以都是1
1. 有序列表
1. 有序列表
4. 有序列表
效果:
- 有序列表
- 有序列表
- 有序列表
无序列表
在行首增加 * 或 -
* 无序列表
* 无序列表
- 无序列表
- 无序列表
效果:
- 无序列表
- 无序列表
- 无序列表
- 无序列表
分割线
用三个及以上连在一起的星号***
或下划线___
或短划线---
变出一条分割线
框起来的代码块
在一段代码的上一行和下一行加上```来将其框起来
int i = 0; i = 1;
for (int i = 0; i < 100; i++)
{
printf("hello markdown!\\n");
}
也可以用``将几个单词框起来,例如
`printf`
效果: printf
表格
用竖线|
画简单的表格:
------------ | ------------- | ------------
是不可缺少的
First Header | Second Header | Third Header
------------ | ------------- | ------------
Content Cell | Content Cell | Content Cell
Content Cell | Content Cell | Content Cell
First Header | Second Header | Third Header |
---|---|---|
Content Cell | Content Cell | Content Cell |
Content Cell | Content Cell | Content Cell |
或者可以在表格每行的最前和最后加竖线
| First Header | Second Header | Third Header |
| ------------ | ------------- | ------------ |
| Content Cell | Content Cell | Content Cell |
| Content Cell | Content Cell | Content Cell |
First Header | Second Header | Third Header |
---|---|---|
Content Cell | Content Cell | Content Cell |
Content Cell | Content Cell | Content Cell |
可以在单元格里用冒号规定文字在单元格里的对齐方式
First Header | Second Header | Third Header
:----------- | :-----------: | -----------:
Left | Center | Right
Left | Center | Right
First Header | Second Header | Third Header |
---|---|---|
Left | Center | Right |
Left | Center | Right |
插入链接
插入email链接
在email地址两段加上<
和>
表示. 例
<example@example.com>
效果
example@example.com
插入链接
<http://www.直接插入链接.com>
[有文字描述的链接](链接地址)
效果:
有文字描述的链接
或者可以用字符串代替实际链接,稍后再定义此字符串,如插入链接:
[有文字描述的链接](id)
效果: 链接
然后在文档的任意其他地方定义id:
[id]: http:www.example.com
插入图片

效果:

图片实际地址也可以用字符串代替并稍后定义.
角标
角标由两部分组成,一个数字编号角标和角标的定义.
这句话有一个角标.[^1]
[^1]: 害羞的角标
(简书不支持角标语法)
以上语法就很全面啦, 有需求的可以再学习流程图, 时序图,Mathjax 数学公式等语法.
Enjoy Markdown!
网友评论