入门级Markdown笔记

还在使用txt文本进行记录吗?markdown作为类似html的存在,这里将markdown的神奇操作分享出来!

一、首先是标题与注释的使用,"# "代表标题,#的个数代表标题的等级,"> "代表为注释,"[TOC]"为生成目录的快捷方式,与标题进行呼应~(含空格)

### MarkDown学习篇
> 学习方便以后做笔记

#### 目录篇

**[15]设置目录**
[TOC]

二、"1. "..."n. "为无序列表,"* "..."* "为有序列表,"[文字](链接地址)"为超链接,"![图片备注](链接地址)"为插入图片(这里借用下网上的图片,嘿嘿)

**[1]这是无序列表**
1. The First
2. The Second
3. The Third

**[2]这是有序列表**
* The First
* The Second
* The Third

**[3]这是超链接**
[知乎](https://www.zhihu.com/)

**[4]这是图片**
![清新可爱](
https://pic.qqtn.com/up/2019-11/2019112517321791250.jpg)

三、字体与表格的设置:

**[5]这是粗体、斜体、删除线、下划线**
*斜体文字*
**粗体文字**
~~删除文字~~
<u>下划线文字</u>

**[6]表格**
|内容居左|内容居中|内容居右|
|:----|:----:|----:|
|A|A|A|
|B|B|B|

四、代码的展示(仅以java与python为例)

 1 **[7.1]java**
 2 ```java
 3 public int getVerticalScrollbarWidth() {
 4 ScrollabilityCache cache = mScrollCache;
 5 if (cache != null) {
 6 ScrollBarDrawable scrollBar = cache.scrollBar;
 7 if (scrollBar != null) {
 8 int size = scrollBar.getSize(true);
 9 if (size <= 0) {
10 size = cache.scrollBarSize;
11 }
12 return size;
13 }
14 return 0;
15 }
16 return 0;}
17 ```
18 
19 **[7.2]python**
20 ```python
21 #!/usr/bin/python
22 import re
23 
24 line = "Cats are smarter than dogs"
25 
26 matchObj = re.match(r'(.*) are (.*?).*',line,re.M|re.l)
27 
28 if matchObj:
29 print "matchObj.group():",matchObj.group()
30 print "matchObj.group(1):",matchObj.group(1)
31 print "matchObj.group(2):",matchObj.group(2)
32 else:
33 print "No match!!"
34 ```

五、分割线、添加待办事项与插入表格

**[8]分割线**
***
---

**[9]添加待办事项**
三只青蛙
* [x]第一只青蛙
* [x]第二只青蛙
* [ ]第三只青蛙

**[10]插入表格**
```chart
,预算,收入,花费,债务
June,5000,8000,4000,6000
July,3000,1000,4000,3000
Aug,5000,7000,6000,3000
Sep,7000,2000,3000,1000
Oct,6000,5000,4000,2000
Nov,4000,3000,5000,

type:pie
title:每月收益
x.title:Amount
y.title:Month
y:suffix:$
```  

五、数学公式、流程图

**[11]插入数据公式**
> 印象笔记 Markdown 支持绝大多数的 LaTeX 数学公式
[更多数学公式的输入可以参考:](https://khan.github.io/KaTeX/docs/supported.html)
```math
e^{i\pi} + 1 = 0
```

**[12]插入流程图**
```mermaid
graph TD
A[模块A] --> |A1| B(模块B)
B --> C{判断条件C}
C --> |条件C1| D[模块D]
C --> |条件C2| E[模块E]
C --> |条件C3| F[模块F]
```

六、时序图与甘特图

**[13]插入时序图**
```mermaid
sequenceDiagram
A->>B: 是否已接受消息?
B-->>A: 已接受消息
```

**[14]插入甘特图**
```mermaid
gantt
title 甘特图
dateFormat YYYY-MM-DD
section 项目A
任务1 :a1,2018-06-06, 30d
任务2 :after a1 , 20d
section 项目B
任务3 :2018-06-12 , 12d
任务4 :24d
```

  

这里就算是基本的markdown的使用方式。

猜你喜欢

转载自www.cnblogs.com/lululuckyboy/p/12000043.html