1. 前言
没应用 markdown
之前,开发文档都是应用 doc
文档。然而 doc
文档不利于上传到 gitHub 或者 gitee 等代码托管平台,不易查看批改记录。而 markdown
她简略易上手,没有繁琐的格局和排版,且很不便查看批改记录。因而,markdown
成为了泛滥开发者的首先。置信,大家都会应用她了,因而,这里只是做个简略的介绍,记录一下咱们的开发好帮手!
2. 劣势
- 和 doc 相比,简略易上手,没有繁琐的格局和排版
- 不便上传 gitHub 或 gitee,易于查看批改记录
- 很容易生成 pdf 或者 html 文档,便于转换
- 很多网站均反对 markdown 写文章,因为没有格局和排版的问题,不便多平台公布
3. 下载路径
反对 markdown
的软件和平台很多,作为平时开发文档的书写,我经常应用的开源的 typora,她是我最喜爱的 markdown
软件了,没有之一。当然,如果你喜爱 vscode
,也能够通过vscode
装置其插件。这里次要给出 typora 的下载方式:
3.1 windows 装置
- 能够通过官网地址下载:https://typora.io/
- 或者应用 chocolatey 下载安装,这种基于 windows 包管理器的装置形式,我比拟喜爱
3.2 linux 装置
for Linux
# or run:
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
# add Typora's repository
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update
# install typora
sudo apt-get install typora
4. 常用命令与显示成果
4.1 分段与分行
以一个或多个空行来隔开段落;以两个或多个空格来段内换行。
4.2 题目
# This is an H1
## This is an H2
###### This is an H6
成果:
This is an H1
This is an H2
This is an H6
4.3 援用
在每一行后面写一个>
:
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
成果:
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
或者在每一段后面写一个>
:
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing.
多重援用
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
成果:
This is the first level of quoting.
This is nested blockquote.
Back to the first level.
列表
列表项占一行,以 *、+、- 结尾即可:
* Red
* Green
* Blue
成果:
- Red
- Green
- Blue
有序列表只须要将上述标记符换成数字加句点。而且程序由书写程序决定,与数字无关,但数字须要从 1 开始。例如:
1. Bird
2. McHale
3. Parish
成果:
- Bird
- McHale
- Parish
每一个列表项能够多行:
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.
成果:
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
- Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
代码块
This is a normal paragraph:
This is a code block.
成果:
This is a normal paragraph:
This is a code block.
横线
三个或更多个*
、-
(它们之间能够有空格)会产生横线:
* * *
成果:
链接
内嵌链接:
I get 10 times more traffic from [Google](http://google.com/ "Google")
than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
[MSN](http://search.msn.com/ "MSN Search").
成果:
I get 10 times more traffic from Google than from Yahoo or MSN.
如果间接以链接地址作为链接文本,能够用如下快捷写法:
[OneOS-Lite](https://gitee.com/cmcc-oneos/OneOS-Lite)
成果:
OneOS-Lite
强调
单个 *
或_
产生斜体,两个(**
、__
)则产生粗体。例如:
*like* _this_
**like** **this**
成果:
like _this_
like this
内嵌代码
code: `echo hello`
成果:
code: echo hello
图片
图片与链接相似,只需在文本后面加上感叹号 !
即可。图片地位和大小无奈通过 Markdown 来指定。
转义字符
以下特殊字符须要用 \
本义失去。
\ backslash
` backtick
* asterisk
_ underscore
{} curly braces
[] square brackets
() parentheses
# hash mark
+ plus sign
- minus sign (hyphen)
. dot
! exclamation mark
5. 关注 && 分割
gitee:https://gitee.com/cmcc-oneos/OneOS-Lite
docs:https://oneos-lite.com/
公众号:CMCC-OneOS