Markdown简介及作用

 

Markdown的官方文档是这样介绍Markdown的:

Markdown is a way to style text on the web. You control the display of the document; formatting words as bold or italic, adding images, and creating lists are just a few of the things we can do with Markdown.(Markdown是一种Web上表现文本的风格,你可以控制文本的展示:粗体字或者是斜体字,插入图片和创建列表,这些都是我们可以使用Markdown做到的事情)

Markdown用途很广泛,例如Github上的ReadMe.md文档就是使用Markdown这个轻量级的文本表示语言书写的,在简书上,你也可以使用这种语言来编辑你的文章,有些前后端对接的API文档也可以使用Markdown语言编写,这样可以使你的文本更加简单易读。

常用语法展示


标题及字体展示

# 标题文本,可以使文本以标题形式展示,共六级标题,# 一级标题,## 二级标题,依次类推

这是一个六级标题的效果


字体展示

*This text will be italic* _This will also be italic_

**This text wiil be bold** __This will also be italic__

效果: This text will be italic This text will be bold


列表展示

* Item 1
* Item 2
  * Item 2a
  * Item 2b (这些代码会让文本呈现无序列表的形式)
  
1. Item 1
1. Item 2
1. Item 3
   1. Item 3a
   2. Item 3b (这些代码会让文本呈现有序列表的形式)

*   A list item with a blockquote:

    > This is a blockquote
    > inside a list item. (当一个列表包含区块的时候,区块需要缩进)

效果:

  • Item 1
  • Item 2
    • Item 2a
    • Item 2b
  1. Item 1
  2. Item 2
  3. Item 3
    1. Item 3a
    2. Item 3b
  • A list item with a blockquote:

    This is a blockquote
    inside a list item.


图片展示

![Markdown learning](https://upload.jianshu.io/users/upload_avatars/5420272/41b3aee5-049c-4d77-8b22-3a744101e5f9?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240)
这段代码会渲染成下面的图片风格,语法如下:
![图片解释的文本](图片URL)

Markdown learning


超链接、引用及分隔符

http://github.com - automatic!
[GitHub](http://github.com)   //这是超链接的使用方法

As Kanye West said:
> We're living the future so
> the present is our past. //这是引用的使用方法

`<addr>`   //这是单行代码的使用方法
 \```
这是多行代码的使用方法
 \```  //使用三个引号来表现代码会让代码关键字部分高亮,如果不想让代码高亮,可以在代码部分前面加上四个空格即可

http://github.com - 当直接使用一个URL时会直接解析成超链接
GitHub - 这个超链接依然指向github的官网,只是可以自由编辑他表现出来的文本内容


表格

First Header | Second Header
------------ | -------------
Content from cell 1 | Content from cell 2
Content in the first column | Content in the second column
First Header Second Header
Content from cell 1 Content from cell 2
Content in the first column Content in the second column

猜你喜欢

转载自blog.csdn.net/xiaochen1999/article/details/82181132