Markdown

Introduction

Definition

Markdown is a lightweight markup language with plain text formatting syntax. Its design allows it to be converted to many output formats, but the original tool by the same name only supports HTML.

Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.

More Info: Wikipedia or 百度百科

Properties

  • Plaint text
  • Converts to HTML
  • Easy to read and learn
  • Enables faster creating and editing of blog posts

Syntax

Headings

To create a heading, add number signs (#) in front of a word or phrase. The number of number signs you use should correspond to the heading level. For example, to create a heading level three, use three number signs (e.g., ### My Header).

1
2
3
4
5
6
# Level 1
## Level 2
### Level 3
#### Level 4
##### Level 5
###### Level 6

Emphasis

You can add emphasis by making text bold or italic.

Bold

To bold text, add two asterisks before and after a word or phrase. To bold the middle of a word for emphasis, add two asterisks without spaces around the letters.

1
**bold text**

The rendered output looks like this: bold text

Italic

To italicize text, add one asterisk before and after a word or phrase. To italicize the middle of a word for emphasis, add one asterisk without spaces around the letters.

1
*italic text*

The rendered output looks like this: bold text

Bold and Italic

To emphasize text with bold and italics at the same time, add three asterisks before and after a word or phrase.

1
***bold and italic text***

The rendered output looks like this: bold and italic text

Blockquotes

To create a blockquote, add a > in front of a paragraph.

1
2
3
> This is a quotation.
>
>> THis is nested quotation.

The rendered output looks like this:

This is a quotation.

THis is nested quotation.

Lists

You can organize items into ordered and unordered lists.

Unordered Lists

To create an unordered list, add dashes, asterisks, or plus signs in front of line items. Indent one or more items to create a nested list.

1
2
3
4
5
6
- list item1
- list item2
* list
* list
* list
- list item3

The rendered output looks like this:

  • list item1
  • list item2
    • list
    • list
    • list
  • list item3

Ordered Lists

To create an ordered list, add line items with numbers followed by periods. The numbers don’t have to be in numerical order, but the list should start with the number one.

1
2
3
4
5
6
1. list item1
2. list item2
1. list
2. list
3. list
3. list item3

The rendered output looks like this:

  1. list item1
  2. list item2
    1. list
    2. list
    3. list
  3. list item3

Horizontal Rules

To create a horizontal rule, use three or more asterisks, dashes, or underscores on a line by themselves.

1
2
3
4
5
6
***
****
---
----
___
____

To create a link, enclose the link text in brackets and then follow it immediately with the URL in parentheses.

1
2
[Google](https://www.google.com/)
[Baidu](http://www.baidu.com/)

The rendered output looks like this:
Google
Baidu

Code

If the word or phrase you want to denote as code includes one or more tick marks, you can escape it by enclosing the word or phrase in double tick marks.

Images

To add an image, add an exclamation mark (!), followed by alt text in brackets, and the path or URL to the image asset in parentheses. You can optionally add a title after the URL in the parentheses.

1
![Pikachu Detective](https://www.pokemoncenter.com/wcsstore/MarketingContent/detective-pikachu/landing_detective-pikachu_header.jpg "Pikachu Detective")

The rendered output looks like this:
Pikachu Detective

Form

The second line separates the header and the content.
By default, text is left; Add two colons before and after dashes, text is center; Add one colon after dashes, text is right.

1
2
3
4
5
Name|Number|E-mail
--|:--:|--:
Lucas|1|xxxxx@xxxx
Tracy|2|xxxxx@xxxx
Mento|3|xxxxx@xxxx

The rendered output looks like this:

Name Number E-mail
Lucas 1 xxxxx@xxxx
Tracy 2 xxxxx@xxxx
Mento 3 xxxxx@xxxx
  1. Basic Syntax from Markdown Guide
  2. Markdown基本语法 来自高鸿祥的简书
------------------------ The End ------------------------

本文标题:Markdown

文章作者:Lu, Ruihui

发布时间:2019年05月29日 - 21:16:06

最后更新:2021年04月13日 - 19:08:08

原始链接:https://github.com/cs-lurh0826/cs-lurh0826.github.io/Programming-Laugauge/markdown/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

一花一世界,一叶一追寻