Markdown简单语法总结

. 标题

  • # 一级标题
  • ## 二级标题
  • ### 三级标题
  • #### 四级标题
  • ##### 五级标题
  • ###### 六级标题

2. 列表

无序列表


  • * 西瓜
  • * 葡萄
  • * 香蕉

  • - 西瓜
  • - 葡萄
  • - 香蕉

  • + 西瓜
  • + 葡萄
  • + 香蕉

有序列表

  1. 西瓜
  2. 葡萄
  3. 香蕉

3. 引用

只需要在文本前面加入 ">"

离离原上草
一岁一枯荣
野火烧不尽
春风吹又生

如果注释一行,在">"后面与文字之间加上五个空格

4. 图片和链接

图片写法为:

![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "title text")

展示效果

alt text

链接写法为:

[link text](https://www.google.com "title text")

展示效果:

google

5. 换行、斜体、加粗、加粗斜体

  • 换行: 在每一行后面加上两个空格即可
  • 斜体: 在要被强调的地方加上*强调*即可,强调
  • 加粗: 在被强调的地方加上**强调**即可,强调
  • 斜体加加粗: 在被强调的地方加上***强调***即可,强调
  • 换行分隔符: ***, 或者* * * , 或者--- 或者- - -
  • 插入空格: 使用全角,添加空格键就可以
  • 不建议使用:使用~~不适用~~, 不适用
  • 强调: 使用==强调==,强调
  • 添加下划线: 使用++下划线++,下划线
  • 在前面选中与不选中,- [ ] 表示没有选中,- [x] 表示选中,后面文字与前面符号有空格隔开 展示:
  •  没有选中

  •  选中

  • 表示行内代码块:`html`, 例如:html

6. 插入代码

方法一:只需要在第一行加上四个空格即可

public int add(int num1, int num2) {
    int result = 0;
    int carry = 0;
    do {
        result = num1 ^ num2;
        carry = (num1 & num2) << 1;
        num1 = result;
        num2 = carry;

    } while (num2 != 0);
    return num1;
}

方法二:加上``` 在代码段的前后分别加上,这个符号是英文的[~]这个键,键盘的左上角那个键,不要搞错了

展示:

public int add(int num1, int num2) {
        int result = 0;
        int carry = 0;
        do {
            result = num1 ^ num2;
            carry = (num1 & num2) << 1;
            num1 = result;
            num2 = carry;

        } while (num2 != 0);
        return num1;
    }

7. 插入表格

使用markdown插入表格比较麻烦,还不如直接写html的tabel插入 实例:

| Tables   | Are    | Cool   |
|-------------------|------------------|----------------|
| col 3 is   | right-akugbed| $1600   |
| col 2 is   | centered  | $12   |
| col 1 is   | are neat  | $1    |

显示结果:

TablesAreCool
col 3 is right-akugbed $1600
col 2 is centered $12
col 1 is are neat $1

8. 插入公式

```math
E = mc^2
```

展示:

E = mc^2E=mc2​​
原文地址:https://www.cnblogs.com/wzyxidian/p/5930635.html