Markdown is a lightweight markup language created by John Gruber. It allows people to “write documents in plain text format that is easy to read and write, and then convert them into valid XHTML(or HTML) documents.” The language has absorbed many of the features of plain text markup already found in E-mail.

John Gruber created Markdown in 2004, much of it in collaboration with Aaron Swartz. The goal of the language is to use “an easy-to-read, easy-to-write plain text format with selective conversion to valid XHTML (or HTML).” One of the most important designs is readability, meaning that the language should be readable literally, without being marked up with formatting instructions (like RTF and HTML). So it is the convention of the prevailing E-mail markup format, though it also borrows from many of the earlier markup languages: SeText, Texile, reStructuredText. Many sites use Markdown or variations of it, such as GitHub, Reddit, Diaspora, Stack Exchange, OpenStreetMap and SourceForge to facilitate discussion.

Markdown is also a Perl script written by Gruber: markdown.pl. It converts content written in Markdown syntax into valid, well-formed XHTML or HTML content and replaces the left Angle brackets < and am& with their respective character entity references. It can be used as a separate script, a plug-in for Blosxom and Movable Type, or a text filter for BBEdit.

Markdown has also been re-implemented by others in Perl and other programming languages, with a Perl module placed on CPAN(Text::Markdown). It is distributed under a BSD-style license and can be used as a plug-in for several content management systems.

Quote from WikipediaMarkdown

1. Italic and bold

Use * and ** to indicate italic and bold.

Example:

This is * italic *, this is * bold *.

Effect:

This is italic, this is bold.

2. Classify titles

Use # for level 1 headings and ## for level 2 headings.

Example:

# This is a level 1 title

## This is a secondary title

### This is a level 3 headline

Effect:

This is a level one title

This is a secondary heading

This is a level 3 title

3. The external links

Add external links to text using description (link address).

Example:

Here is a link to my blog (www.laoliang.ink).

Effect:

Here is a link to my blog.

4. Unordered lists

Use *, +, – to indicate an unordered list.

Example:

– Unordered list item 1 – Unordered list item 2 – Unordered list item 3

Effect:

  • Unordered list item 1
  • Unordered list item 2
  • Unordered list item 3

5. Ordered lists

Use numbers and dots to represent ordered lists.

Example:

  1. Ordered list item one
  2. Ordered list item two
  3. Ordered list item three

Effect:

  1. Ordered list item one
  2. Ordered list item two
  3. Ordered list item three

6. Text quotes

Use > for literal references.

Example:

“> < p style =” max-width: 100%;

Effect:

Wildfires burn out, spring breeze blows again.

7. Inline code blocks

Use ‘code’ to represent a block of inline code.

Example:

Let’s talk about ‘HTML’.

Effect:

Let’s talk about HTML.

8. A code block

Support forty-one programming languages syntax highlighted, line number display.

Non-code examples:

“` $ sudo apt-get install vim-gnome “`

Non-code effects:

$ sudo apt-get install vim-gnome
Copy the code

The Python example:

“`python

import sys

for s in sys.stdin:

a = [int(i) for i in s.split()]
print (a[0] + a[1])
Copy the code

` ` `

Python effect:

import sys

for s in sys.stdin:
    a = [int(i) for i in s.split()]
    print (a[0] + a[1])
Copy the code

JavaScript example:

“` javascript

function fib(n) { var a = 1, b = 1; var tmp; while (–n >= 0) { tmp = a; a += b; b = tmp; } return a; }

document.write(fib(10)); ` ` `

JavaScript effects:

function fib(n) {
  var a = 1, b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

document.write(fib(10));
Copy the code

9. Insert images

Use! [Description](image link address) Insert image.

Example:

! The head of [I] (avatars.githubusercontent.com/u/23415234?…).

Effect: