基础——markdown语法

markdown语法

1.标题

用#表示最多六级标题

写法:

# 一级标题

## 二级标题

### 三级标题

#### 四级标题

##### 五级标题

###### 六级标题

效果:

一级标题

二级标题

三级标题

四级标题
五级标题
六级标题
2.加粗,斜体

*倾斜部分*

_倾斜部分_

**加粗部分**

__加粗部分__

***倾斜粗体***

___倾斜粗体___

效果:

倾斜部分

倾斜部分

加粗部分

加粗部分

倾斜粗体

倾斜粗体

3.列表
3.1无序列表

使用符号*、-和+进行无序列表的创建,形式为符号后加空格加内容

* 列表1

* 列表2

* 列表3

+ 列表4

+ 列表5

+ 列表6

- 列表7

- 列表8

- 列表9

效果:

  • 列表1

  • 列表2

  • 列表3

  • 列表4

  • 列表5

  • 列表6

  • 列表7

  • 列表8

  • 列表9

3.2有序列表

利用数字加英文的**.**实现,输入后会自动缩进

1. 列表1

2. 列表2

3. 列表3

效果:

  1. 列表1
  2. 列表2
  3. 列表3
4.段落
5.插入图片

方框内为:Alt text,代表图片的Alt标签,用来描述图片的关键词,可以不写。最初的本意是当图片因为某种原因不能被显示时而出现的替代文字,后来又被用于SEO,可以方便搜索引擎根据Alt text里面的关键词搜索到图片。

5.1插入网络图片

没有自己的服务器存储图片的可以利用github平台进行图片的插入,比如:

![Alt text](图片链接)

效果:

![](https://github.com/yxxupup/picture/blob/master/1488771180506677.jpeg)

5.2插入本地图片

相对路径:图片与md文件处于同一个文件夹中,则框中可直接写为

![](***.png)

绝对路径:照片在本地的路径

![](\user\***.png)

5.3插入图片编码

把图片转化为字符串,插入到文档中,放在()中的链接位置。

![avatar](data:image/png;base64,iVBORw0…)

base64编码非常长,影响整个源代码的阅读体验。

简易方法

中间调用: ![avatar][base64str]

文章末尾存放base64编码: [base64str]:data:image/png;base64,iVBORw0…`

如何获取base64编码

利用Python的base64库:

import base64
f = open('***.png','rb') #二进制方式打开图文件
ls_f = base64.b64encode(f.read()) #读取文件内容,转换为base64编码
f.close()
print(ls_f)
6.引用

利用>符号实现引用:

在使用时换行后会自动添加引用标号

>引用1
>引用2
>引用3

效果:

引用1

引用2

引用3

引用线后面的enter键可以消除一级引用

cacacaw

引用中可以正常使用其他语法

7.分割线

代码块中是语法,下面是效果

***

---

+++

+++

8.勾选
-空格[空格]空格
-空格[x]空格
  • [ ]
  • [x]
9.自动链接

[名字](网址)

[SLEEPYHEAD's Blog](https://yxxupup.github.io/)

SLEEPYHEAD’s Blog

10.表格

语法:

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
11.流程图

基础示例:

```mermaid
flowchat
flow
st=>start: Start
op=>operation: Your Operation
cond=>condition: Yes or No?
e=>end
st->op->cond
cond(yes)->e
cond(no)->op
```

基本结构:

tag(用于下面连接时简写)=>type:空格 显示的内容:>url
选择语句:
tag=>condition: 条件1 or 条件2?

type有以下几类:

标签有6种类型:start end operation subroutine condition inputoutput

连接部分

tag1->tag2
Created with Raphaël 2.2.0 Start Your Operation Yes or No? End yes no
参考文章:

Learning-Markdown (Markdown 入门参考)

Markdown笔记:如何画流程图

Markdown的常用语法(个人总结)

你可能感兴趣的:(基本操作)