Why do I need to learn Markdown markup Language? A: Markdown is a tool for converting text to HTML. As long as we write text according to Markdown’s syntax, the Markdown editor will convert it to HTML language, so that the text structure looks very clear. Markdown also provides very simple syntax. Text structure can be achieved through simple symbols.

Markdown can inline HTML code and does not require any symbols to indicate that the code is HTML. Only Spaces or TAB characters are required around block-level HTML elements, such as <div>, <table>, <pre>, < P >, etc., to separate Markdown syntax. You can’t use Markdown syntax in HTML blocks. Normally, you don’t need to nest HTML syntax in Markdown.

Part ONE: Grammar

Header

Header supports two styles in Markdown

  • Setext style

    • Use successive = signs to indicate first-level headings
    • Use successive – signs to indicate secondary headings
  • Atx style

    • Use # to indicate several levels of title but only 1-6

Piece of reference

Implementing a block reference with the > symbol has the following effect:

This is a block reference

Markdown syntax allows you to use only the > symbol at the beginning of a paragraph if you need to refer to something very long, but segmentation is a line with only one > symbol to implement segmentation, and block references can be nested. Block references can also contain other Markdown elements, such as code blocks, titles, lists, etc

The list of

  • Ordered list: use 1. And 2. For numbered lists
  • Unordered list: No numeric identifier, can be implemented by *, +, – symbols

To add a reference block to a list, you need to indent one TAB or four Spaces. To add a code block to a list, you need to indent two tabs or eight Spaces

A horizontal line

There are several ways to implement this ——— *** _____

Three or more *(asterisk), -(join line), _(underscore)

The connection

Markdown supports two styles of connection:

  • Inline: [connection name](address title of the connection)
  • 2. reference: Defined in two steps
    • [Connection name][Connection id]
    • [Connection id]: URL title

The title above is optional. If the title is written, it must be enclosed in single or double quotation marks or (). In reference, the URL can also be enclosed in <>, and the connection identifier is case insensitive

Emphasis on

  • Use a single * or _ to enclose text that needs to be emphasized. The emphasized text is rendered in italics
  • Surround highlighted text with double * or _. Highlighted text appears in bold

code

Use backquotes (‘) to surround your code. If you are enclosing code that contains backquotes, then you can use two backquotes, one of which identifies the code on only one line. A markdown editor, however, will provide three backquotes around the code snippet, and after the three backquotes write what kind of language the code is, such as Java

image

Similarly, there are two styles of connection

  • The inline:! [Image description](url or path optional title)
  • Reference:
    • The first step is [image description][identification]
    • The second step is [identifier]: url or path optional title

The optional title needs to be enclosed in single or double quotation marks

Automatic connection

Using <> to surround a URL or email address, markdown helps create automatic connections: juejin. Cn/markdown will generate juejin

Note: THE URL must be complete, with HTTP, or it will not automatically connect

Escape character (\)

Escape characters help us generate character text instead of markdown syntax. For example, if you want to write a < string in the Markdown editor, since Markdown will parse it as <, you can write &lt; , the Markdown editor forces the original (<) output instead of converting it to escaped characters

Note: This is the original use of markdown, but many markdown editors now add some common syntax to it: for example, insert formulas surrounded by $

Above part translation since MarkDown author’s blog: daringfireball.net/projects/ma…

Part two: Markdown editor Typora

Liverpoolfc.tv: typora. IO /

Typora is a very clean Markdown editor with real-time preview support. It’s very easy to use and, more importantly, it’s free.

Since Markdown converts text to HTML, we can use CSS to beautify our text, and in Typora we can customize our own styles using CSS. Typora -> Preferences -> Appearance -> Open the theme folder, we just need to place our own style according to the rules of the theme inside, and then select the custom style can be realized in Typora according to the custom style to edit the document.