Markdown Quick Start


Quick Start of Markdown

The best way to get started with Markdown is to use it.

目录
  • Quick Start of Markdown
    • Reasons why I use Markdown
    • Where can I write Markdown
      • Online editor
      • VScode
        • Ubuntu
        • Windows
      • Vim
      • Typora
    • Markdown Syntax
      • Kicking the Tires
        • Headings
        • Paragraphs
        • Blockquotes
        • Fenced Code Blocks
        • Horizontal Rules
      • Font
        • Bold
        • Italic
        • Code
        • Strickthrough
        • Highlight
      • List
        • Ordered list
        • Unordered list
        • Task list
        • List With Another Elements
      • Other Elements
        • Links
        • Images
        • Tables
        • Mathematical Formula
        • HTML


Reasons why I use Markdown

  1. Markdown is everywhere. Websites like Github, StackOverflow, Gitee, cnblogs support Markdown.
  2. Markdown is application-independent and cross-platform. Since Typora has started subscription mode, I have turned to VScode for writing Markdown. There is virtually no difference between writing experiences of these two applications. And I can also write Markdown on even any operating system like Ubuntu, Windows, Andriod and so on.
  3. By using markdown we can easily orgnize content of a paragraph and its style.

Where can I write Markdown

The best way to get started with Markdown is to use it. That's is easier than ever before thanks to a variety of free tools.

Online editor

A green hand doesn't even need to download anything for there are several online editors that you can try writing in Markdown. Here are some of them.

Generally, just open an online editor and start typing in the code pane(mostly the left pane), as the same time, a preview of the rendered document appears in the preview pane(mostly the right pane).

  1. Dillinger(https://dillinger.io)
  2. Arya(https://markdown.lovejade.cn/)
  3. MdEditor(https://md.mzr.me/)

VScode

A light-weight text editor which is cross-platform.

Ubuntu

  1. Download the VS code from the official website(https://code.visualstudio.com/).

2.2.1.1

  1. Install the VS code from package.
sudo dpkg -i code_1.45.1-1589445302_amd64.deb
  1. Install Markdown All in One,Markdown Preview Enhanced plugin.

2.2.1.2
2.2.1.3

Windows

  1. Download the VS code from the official website(https://code.visualstudio.com/).

  2. Install the VS code from the .exe.
    Just Next, Next utill it complete installation process.

  3. Install Markdown All in One,Markdown Preview Enhanced plugins.

2.2.1.2
2.2.1.3

Vim

Typora

Just install from the official website and start typing. But notice that this software is not FREE.


Markdown Syntax

Kicking the Tires

This section will introduce some basic and necessary formatting elements of a document.

Headings

To create headings, add number signs(#) in front of a word or phrase. The number of number signs should correspond to the heading level.

syntax:

# Heading level 1

## Heading level 2

### Heading level 3

......

###### Heading level 6

Rendered Output:

Heading level 1

Heading level 2

Heading level 3

......

Heading level 6

Alternate Syntax:

Heading level 1
===

Heading level 2
---

Rendered Output:

Heading level 1

Heading level 2

Paragraphs

To create a paragraph, use a blank line to separate on or more lines of text.

What's more, for compatibility, please be careful about spaces and blank lines in Markdown.

Blockquotes

To create a blockquote, add a > in front of a paragraph.
Blockquotes can contain mulitple paragraphs. Add a > on the blank lines between the paragraphs.
Blockquotes can also be nested.Add a >> in front of the paragraph you want to nest.

syntax:

> A single paragraph

> the first paragraph
> 
> the second paragraph
> 
> > paragraphs nested can also contain blockquotes
> >
> > > just like **this** 

Rendered Output:

A single paragraph

the first paragraph

the second paragraph

paragraphs nested can also contain blockquotes

just like this

Fenced Code Blocks

The Basic Markdown syntax allows you to create code blocks by indenting lines by four spaces or one tab.

To create fenced code blocks without indenting any lines, putting three backticks on the lines before and after the code block.

syntax:

```C++
#include
int main(){
    puts("hello world!");
    return 0;
}
```

Rendered Output:

#include
int main(){
    puts("hello world!");
    return 0;
}

Horizontal Rules

To create a horizental rule, use three or more asterisks on a line by themselves.

syntax:

---

----

Rendered Output:



Font

You can add emphasis or distinguish some content by putting them in different fonts.

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.

syntax:

**Bold words or sentence.**

Rendered Output:

Bold words or sentence.

Italic

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

syntax:

*Italic words or sentence.*
***Italic and bold sentence.***

Rendered Output:

Italic words or sentence.
Italic and bold sentence.

Code

To denote a word or phrase as code, enclose it in backticks.

syntax:

`vim` is a likable `text editor`.

Rendered Output:

vim is a likable text editor.

Strickthrough

To strickthrough words, use two tilde symbols before and after the words which will be rendered as putting a horizontal line through the center of them indicating that certain words are a mistake not meant for inclusion in the document.

syntax:

this ~~fucking~~ examination

Rendered Output:

this fucking examination

Highlight

To highlight text, add two equal signs before and after a word or phrase.

But this isn't common for some Markdown processors allow you to hight text.

syntax:

Occasions are not rare when we need to emphasis some ==vital important words==.

Rendered Output:

Occasions are not rare when we need to emphasis some vital important words.

List

You can orgnize items into ordered, unordered or todo lists.

Ordered list

To creat 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.

syntax:

1. First thing
2. Second thing
   1. Second thing has sub tasks
   2. And sub task can also has subsubtask
      1. Just like this
3. Third thing

Rendered Output:

  1. First thing
  2. Second thing
    1. Second thing has sub tasks
    2. And sub task can also has subsubtask
      1. Just like this
  3. Third thing

Unordered list

To create an unordered list, add asterisks in front of line items.

Indent one or more items to create a nested list.

syntax:

* One thing
* Another thing
  * Something has sub tasks
  * And sub task can also has subsubtasks
    * Just like this
* And so on

Rendered Output:

  • One thing
  • Another thing
    • Something has sub tasks
    • And sub task can also has subsubtasks
      • Just like this
  • And so on

Task list

Task lists(also reffered to as checklists) allow you to create a list of items with checkboxes. In Markdown applications that support task lists, checkboxes will be displayed next to the content.

To create a task list, add dashes and brackets with a space([ ]) in front of task list items.

To select a checkbox, add an x in between the brackets([x]).

syntax:

- [ ] Introduction to the Basic Principles of Marxism 
- [ ] Data structure and algorithm design
- [ ] Discrete mathematics

Rendered Output:

List With Another Elements

To add another elements in a list while preserving the continuity of the list, indent the element four spaces or one tab.

Tip: If things don't appear the way you expect, double check that you've indented the elements in the list four spaces or one tab.

syntax:

* This is an unordered list
* Here's the second list item
    > I need to add another element bellow the second list item.
* And this list has totally three items

Rendered Output:

  • This is an unordered list
  • Here's the second list item

    I need to add another element bellow the second list item.

  • And this list has totally three items

Other Elements

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

syntax:

My blog adress is [www.cnblogs.com/-CXF-](https://www.cnblogs.com/-CXF-).

And I storage these `.md` files on [github](https://github.com/CXF233).

Rendered Output:

My blog adress is www.cnblogs.com/-CXF-.

And I storage these .md files on github.

Images

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

syntax:

![illustration](https://sm.ms/image/WfP9wHb2jZLdcz6 "background picture")

Rendered Output:

illustration

Tables

To add a table, use three or more hyphen(---) to create each column's header, and use pipes(|) to separate each column.

For compatibility, you should also add a pipe on either end of the row.

You can align text in the cloumns to the left, right, or center by adding a colon to the left, right, or on both side of the hyphens within the header row.

syntax:

| Syntax    | Description |   Test Text |
| :-------- | :---------: | ----------: |
| Header    |    Title    | Here's this |
| Paragraph |    Text     |    And more |

Rendered Output:

Syntax Description Test Text
Header Title Here's this
Paragraph Text And more

Mathematical Formula

Many Markdown applications allow you to use Latex in Markdown-formatted text.

syntax:

Using `\(` and `\)`, you can insert a formula like $ E=mc^2 $ into a paragraph.

Using `\[` and `\]`, you can display equations in a newline,like :
$$
\int_V{ \left| \Psi{ (\vec{r},t )} \right|^2} dV=1
$$

Rendered Output:

Using \( and \), you can insert a formula like $ E=mc^2 $ into a paragraph.

Using \[ and \], you can display equations in a newline,like :

\[\int_V{ \left| \Psi{ (\vec{r},t )} \right|^2} dV=1 \]

Alternative Syntax:

Using a pair of `$`, you can insert a formula like $ e^{i\theta}+1=0 $ into a paragraph.

Using a pair of `$$`, you can display equations in a newline,like :
$$
e^x=\sum_{i=0}^{\infty}{\frac{x^i}{i!}}
$$

Rendered Output:

Using a pair of $, you can insert a formula like $ e^{i\theta}+1=0 $ into a paragraph.

Using a pair of $$, you can display equations in a newline,like :

\[e^x=\sum_{i=0}^{\infty}{\frac{x^i}{i!}} \]

HTML

Many Markdown applications allow you to use HTML tags in Markdown-formatted text.

Tips:

  1. For security reasons, not all Markdown applications support HTML. Some applications support only a subset of HTML tags.
  2. Use blank lines to seperate block-level HTML elements like ,

    from the surrounding content. Do not indent the tags with tabs or spaces which can interface with the formatting.

  3. Markdown syntax inside block-level HTML tags won't work.