Markdown novice learning

MARKDOWN

1, Title

1. Use the # number to indicate the title, and the # number must be at the beginning of the line,

For example:

# Primary title
## Secondary title
### Tertiary title
#### Four level title
##### Five level title
###### Six level title

Code running result:

Primary title

Secondary title

Tertiary title

Four level title

Five level title
Six level title

2. Use = = = and --- to indicate primary and secondary titles, for example:

This is the first level title
=================

This is the secondary title
-----------------

Code running result:

This is the first level title

This is the secondary title

2, Split line

Use more than three asterisks and minus signs in a row to create a separator
And this line only has symbols and can't have anything else (be careful not to be recognized as a secondary title)
You can also insert a space between the asterisk or minus sign
You can create separation lines in each of the following ways:

***
* * *
- - -
--------------

Code running result:

3, Italics and bold

1. Use * and * * for italics and bold, respectively

For example:

*Italics*  
**bold**  
***Bold Italic***

Code running result:

Italics
bold
Bold Italic

2. Strikeouts are represented by two ~

For example:

~~Text to delete~~

Code running result:

Text to delete

3. Underline is realized through the < U > tag of HTML

For example:

<u>Underlined text</u>

Code running result:

Underlined text

4. Footnotes are supplementary notes to the text [^ text to be noted]

For example:
The following example demonstrates the use of footnotes:

Create a footnote format similar to this[^1]  

[^1]:Here is the footnote

Code running result:

Create a footnote format similar to this 1

5. Change font model and color

<font face="Blackbody"> I'm in bold</font>  
<font color=gray size=10>color=gray</font>  
<font color=#0099ff size=3 face="Blackbody">color=#0099ff size=72 face = "bold" < / font >

Code running result:

I'm in bold
color=gray
color=#0099ff size=72 face = "bold"

4, Hyperlinks and pictures

Links and pictures are written in a similar way. There is only one more picture in front of the hyperlink!

1. Link

There are two ways of writing:
The first way to write: the brackets and parentheses under the English input method. Add the quotation marks under the English input into the parentheses to show the title of the link when clicking
For example:

This is[The first way to write](https://www.baidu.com/)  
[The first way of writing (yes) title)](https://www.baidu.com/ "baidu")   

Code running result:

This is The first way to write
The first way to write (with title)

The second way is to use the link address directly
For example:

<https://www.baidu.com>  

Code running result:

https://www.baidu.com

Extension:
Advanced links
We can set a link through variables, and the variable assignment is carried out at the end of the document:

This link uses 1 as the URL variable [Google][1]  
This link uses baidu As URL variable [Baidu][baidu]  
Then assign a value (URL) to the variable at the end of the document  

  [1]: http://www.google.com/
  [baidu]: http://www.baidu.com/

Code running result:

This link uses 1 as the URL variable Google
This link uses baidu as the URL variable Baidu
Then assign a value (URL) to the variable at the end of the document

2. Picture

The syntax format of Markdown picture is as follows:
! [insert alternative text of picture inside] (picture address)
! [insert alternative text of picture inside] (picture address "optional title")

5, List

1. Unordered list

Use -, + and * as the list marks. Add a space after these marks, and then fill in the content
For example:

 * First item
 * Item 2
 * Item 3
 + First item
 + Item 2
 + Item 3
 - First item
 - Item 2
 - Item 3

Code running result:

  • First item
  • Item 2
  • Item 3
  • First item
  • Item 2
  • Item 3
  • First item
  • Item 2
  • Item 3

2. Ordered list

The ordered list uses numbers and adds Sign, such as:

 1. First item  
 2. Item 2  
 3. Item 3  

Code running result:

  1. First item
  2. Item 2
  3. Item 3

3. List nesting

List nesting simply adds four spaces in front of the options in the sub list:

1. Item 1:
	- The first element of the first item nest
    - The second element nested in the first item
2. Item 2:
    - The first element of the second nested item
    - The second nested element of the second item

Code running result:

  1. Item 1:
    • The first element of the first item nest
    • The second element nested in the first item
  2. Item 2:
    • The first element of the second nested item
    • The second nested element of the second item

6, Text reference

Using > indicates that there can be more than one >, indicating a deeper level
For example:

> first floor
>>The second floor
>>> It can be deeper

Code running result:

first floor

The second floor

It can be deeper

7, Inline code block

Use ` ` ` to indicate, for example:

`Inline code block`

Code running result:
Inline code block

Extension:
Many characters need to be escaped. Use backslash \ to escape

8, Code block

Indent the code block with four spaces, for example:

	L = []
	for i in range(3):
	    x = input("")
	    L.append(x)
	L.sort()
	print(L)

Code running result:

L = []
for i in range(3):
    x = input("")
    L.append(x)
L.sort()
print(L)

However, there is no code highlighting in this way, so it is recommended to use the following method to realize code highlighting and line number prompt

```python
L = []
for i in range(3):
	x = input("")
	L.append(x)
L.sort()
print(L)
```(Don't forget to add at the end```)

Code running result:

L = []
for i in range(3):
	x = input("")
	L.append(x)
L.sort()
print(L)

9, Table (MarkDown Pad2 does not support tables temporarily)

Markdown makes tables, uses | to separate different cells, and uses - to separate headers and other rows.
Alignment:
-: set the right alignment of content and title bar.
: - align the content and title bar to the left.
: -: center the content and title block.
example:

| Align left | Right align | Center alignment |
| :-----| ----: | :----: |
| Cell | Cell | Cell |
| Cell | Cell | Cell |

Code running result:

Align left Right align Center alignment
Cell Cell Cell
Cell Cell Cell

10, Flow chart

The main syntax is name = > type: describe, of which type mainly includes the following types:

  1. Start and end: start end

  2. Input / output: inputoutput

  3. operation: operation

  4. Condition: condition

  5. Subroutine: subroutine

    tag=type: content:url

  6. Tag: tag, which is used when connecting elements. It is equivalent to defining a constant

  7. =: label defines the equation.

  8. Type: the type of the tag. There are 6 types as follows:
    Meaning of element type:
    Start start
    End end / finish
    Operation process operation
    subroutine reservation sub process
    condition judgment
    inputoutput input output

  9. Content: the content placed in the process statement

Type: there must be a space between type and content, otherwise there will be problems

:: hyperlink definition equation

url: refers to the link, which is bound to the process statement. Optional.

```mermaid
flowchat
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End:>http://www.google.com
op1=>operation: get_hotel_ids|past
op2=>operation: get_proxy|current
sub1=>subroutine: get_proxy|current
op3=>operation: save_comment|current
op4=>operation: set_sentiment|current
op5=>operation: set_record|current

cond1=>condition: ids_remain empty?
cond2=>condition: proxy_list empty?
cond3=>condition: ids_got empty?
cond4=>condition: Crawl successful??
cond5=>condition: ids_remain empty?

io1=>inputoutput: ids-remain
io2=>inputoutput: proxy_list
io3=>inputoutput: ids-got

st->op1(right)->io1->cond1
cond1(yes)->sub1->io2->cond2
cond2(no)->op3
cond2(yes)->sub1
cond1(no)->op3->cond4
cond4(yes)->io3->cond3
cond4(no)->io1
cond3(no)->op4
cond3(yes, right)->cond5
cond5(yes)->op5
cond5(no)->cond3
op5->e
```(Don't forget to add at the end```)

Code running result:

11, Mathematical formula

$means exclusive in two lines, and $means exclusive in one line.

eg1 :

 $$
 \sum_{i=1}^n a_i=0
 $$

Code running result:
∑ i = 1 n a i = 0 \sum_{i=1}^n a_i=0 i=1∑n​ai​=0

eg2:

$$
\mathbf{V}_1 \times \mathbf{V}_2 =  \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} &  \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} &  \frac{\partial Y}{\partial v} & 0 \\
\end{vmatrix}
$$

Code running result:
V 1 × V 2 = ∣ i j k ∂ X ∂ u ∂ Y ∂ u 0 ∂ X ∂ v ∂ Y ∂ v 0 ∣ \mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\ \end{vmatrix} V1​×V2​=∣∣∣∣∣∣​i∂u∂X​∂v∂X​​j∂u∂Y​∂v∂Y​​k00​∣∣∣∣∣∣​

12, Support HTML tags

For example, if you want to indent a paragraph, you can do the following:

&nbsp;&nbsp;Continuous blank space&nbsp;or&#160;  
&ensp;&ensp;Half square blank&ensp;or&#8194;  
&emsp;&emsp;All square big blank&emsp;or&#8195;

Code running result:

A blank space of continuous lines {or
Half square blank or
  full square blank   or  

  1. Here is the footnote ↩︎

Tags: Python markdown

Posted by kujtim on Sat, 14 May 2022 12:18:27 +0300