Use of markdown syntax
0. Contents
1. Italics and bold
code:
1. *Italics*or_Italics_ 2. **bold** 3. ***Bold Italic*** 4. ~~Delete line~~
Display effect:
- This is a paragraph in italics
- This is a paragraph in bold
- This is a paragraph in bold italics
- This is a delete line
2. Graded title
Writing method:
1. # Primary title 2. ## Secondary title 3. ### Tertiary title 4. #### Four level title 5. ##### Five level title 6. ###### Six level title
Display effect:
# Primary title ## Secondary title ### Tertiary title #### Four level title ##### Five level title ###### Six level title
3. Hyperlink
Markdown supports two forms of link syntax: inline and reference. Inline is generally used more.
3.1 inline
Syntax description:
Write the link text in [] and the link address in (). The "" in () can specify the title attribute for the link, and the title attribute can be added or not. The effect of the title attribute is that the specified title text will appear when the mouse hovers over the link. Link text ’Such a form. There is a space before the link address and the link title.
code:
1. Welcome to[Fanju Downtown](http://blog.leanote.com/freewalk) 2. 3. Welcome to[Fanju Downtown](http://blog.leanote.com/freewalk ("Fanju downtown")
Display effect:
Welcome to Fanju Downtown
Welcome to Fanju Downtown
3.2 reference formula
Reference hyperlinks are generally used in academic papers, or in another case, if a link is used in multiple places in the article, it will be very good to create links by reference, which allows you to manage links uniformly.
Syntax description:
The reference link is divided into two parts. The writing method in the text is [link text] [link mark]. Add [link mark] at any position of the text: the link address is "link title", and there is a space before the link address and the link title.
If the link text itself can be used as a link mark, you can also write it as [link text] []
[link text]: see the last line of the code for the form of the link address.
code:
1. Several websites I often go to[Google][1],[Leanote][2]as well as[Own blog][3] 2. [Leanote note][2]It's a good one[website][]. 3. 4. [1]:http://www.google.com "Google" 5. [2]:http://www.leanote.com "Leanote" 6. [3]:http://http://blog.leanote.com/freewalk "Fanju downtown" 7. [website]:http://http://blog.leanote.com/freewalk
Display effect:
Several websites I often go to Google,Leanote as well as Own blog
Leanote notes It's a good one website.
3.3. Automatic link
Syntax description:
Markdown supports handling web addresses and e-mail mailboxes in the form of short automatic links. As long as it is wrapped with < >, markdown will automatically turn it into a link. The link text of the general website is the same as the link address, for example:
code:
1. <http://example.com/> 2. <address@example.com>
Display effect:
http://example.com/
address@example.com
4. Anchor point
In a web page, an anchor is actually a hyperlink within the page, that is, a link to some elements within the document to realize the jump in the current page. For example, if I write down an anchor here and click back to the directory, I can jump to the directory. Click this section in the directory to jump over. And the footnotes for the next section. These are basically realized by anchor points.
be careful:
- Markdown Extra only supports inserting anchor points after the title, and other places are invalid.
- The display effect area on the right side of the Leanote editor does not support anchor jump temporarily, so click to find that there is no jump. Don't panic, but you support jump after you publish it as a note or blog post.
Syntax description:
Insert the anchor {# tag} after the specified title you are going to jump to, and then write a link to the anchor elsewhere in the document.
code:
1. ## 0. catalogue{#index} 2. 3. Jump to[catalogue](#index)
Display effect:
Jump to catalogue
5. List
5.1 unordered list
Use *, +, - to represent an unordered list.
code:
- Unordered list item 1 - Unordered list item 2 - Unordered list item 3
Display effect:
- Unordered list item 1 - Unordered list item 2 - Unordered list item 3
5.2. Ordered list
If there is a sequence table, use numbers followed by an English period.
code:
1. Ordered list item 1 2. Ordered list item 2 3. There are three items in the sequence table
Display effect:
1. Ordered list item 1 2. Ordered list item 2 3. There are three items in the sequence table
5.3. Defined list
Syntax description:
The definition list consists of nouns and explanations. Write the definition on one line and the explanation on the next line. Explanation: followed by an indent (Tab)
code:
1. Markdown 2. : Lightweight text markup language, which can be converted into html,pdf Equal format (one visible colon and four invisible spaces on the left) 3. Code block 2 4. : This is the definition of the code block (with a visible colon and four invisible spaces on the left) 5. Code block (eight invisible spaces on the left)
Display effect:
Markdown
Lightweight text markup language, which can be converted into html, pdf and other formats
Code block 2
This is the definition of a code block
1. Code block (eight invisible spaces on the left)
5.4. List containing paragraphs
Syntax description:
List items can contain multiple paragraphs. The paragraphs under each item must be indented with 4 spaces or 1 tab (the display effect is consistent with the code):
- Gently I left, just as I came gently; I gently waved goodbye to the clouds in the West.
The golden willow by the river is the bride in the sunset; The bright shadow in the wave light rippled in my heart.
The green fungus on the soft mud swaggers under the water; In the gentle waves of Kang River, I am willing to be a water plant!
The pool under the shade of elms is not a clear spring, but a rainbow in the sky; Crumpled in the floating algae, precipitating a rainbow like dream.
Dream seeking? Hold a long pole and go back to the greener part of the grass; A boat full of stars, singing in the beauty of stars.
But I can't play songs. Silence is a farewell Sheng and Xiao; Xia Chong is also silent for me. Silence is Cambridge tonight!
- I left quietly, just as I came quietly; I waved my sleeves and didn't take away a cloud.
If you indent every line, it will look much better. Of course, again, if you are lazy, Markdown also allows:
code:
1. * Gently I left, just as I came gently; I gently waved goodbye to the clouds in the West. 2. The golden willow by the river is the bride in the sunset; The bright shadow in the wave light rippled in my heart. 3. The green fungus on the soft mud swaggers under the water; In the gentle waves of Kang River, I am willing to be a water plant! 4. The pool under the shade of elms is not a clear spring, but a rainbow in the sky; Crumpled in the floating algae, precipitating a rainbow like dream. 5. The Dream Pursued? Hold a long pole and go back to the greener part of the grass; A boat full of stars, singing in the beauty of stars. 6. But I can't play songs. Silence is a farewell Sheng and Xiao; Xia Chong is also silent for me. Silence is Cambridge tonight! 7. * I left quietly, just as I came quietly; I waved my sleeves and didn't take away a cloud.
Display effect:
- Gently I left, just as I came gently; I gently waved goodbye to the clouds in the West.
The golden willow by the river is the bride in the sunset; The bright shadow in the wave light rippled in my heart.
The green fungus on the soft mud swaggers under the water; In the gentle waves of Kang River, I am willing to be a water plant!
The pool under the shade of elms is not a clear spring, but a rainbow in the sky; Crumpled in the floating algae, precipitating a rainbow like dream.
Dream seeking? Hold a long pole and go back to the greener part of the grass; A boat full of stars, singing in the beauty of stars.
But I can't play songs. Silence is a farewell Sheng and Xiao; Xia Chong is also silent for me. Silence is Cambridge tonight!
* I left quietly, just as I came quietly; I waved my sleeves and didn't take away a cloud.
5.5. List containing references
Syntax description:
If you want to put a reference within a list item, then > needs to be indented:
code:
* Reading methods: > Open the book. > Turn on the light.
Display effect:
-
How to read:
Open the book.
Turn on the light.
5.6. Contains a reference to a code block
Syntax description:
If you want to put a code block, the block needs to be indented twice, that is, 8 spaces or 2 tabs:
-
A list item contains a list block:
<The code is written here>
5.7. A special case
Under special circumstances, the list of items may be generated accidentally, as follows:
1986\. What a great season.
It will be displayed as:
1986\. What a great season.
6. Reference
Syntax description:
The reference needs to be preceded by the > symbol.
code:
> This is a quote with two paragraphs, > Meaningless line occupying text > Meaningless line occupying text > > Meaningless line occupying text > Meaningless line occupying text 4.
Display effect:
This is a quote with two paragraphs, Meaningless line occupying text 1. Meaningless line occupying text 2. Meaningless line occupying text 3. Meaningless line occupying text 4.
Markdown also allows you to be lazy, just adding > at the beginning of the first line of the whole paragraph:
code:
> This is a quote with two paragraphs, Meaningless line occupying text 1. Meaningless line occupying text 2. > Meaningless line occupying text 3. Meaningless line occupying text 4.
Display effect:
This is a quote with two paragraphs, Meaningless line occupying text 1. Meaningless line occupying text 2. Meaningless line occupying text 3. Meaningless line occupying text 4.
6.1. Multi level nesting of references
Block references can be nested (for example, references within references), as long as different numbers of >:
code:
>>> Excuse me? Markdwon How to use it? - Xiaobai >> Watch the tutorial yourself! - Indignant youth > Where is the tutorial? - Xiaobai
Display effect:
How can I use Markdwon- Xiaobai
Watch the tutorial yourself- Indignant youth
Where is the tutorial- Xiaobai
6.2. Reference other elements
Other Markdown syntax can also be used in the referenced block, including title, list, code block, etc
code:
> 1. This is the first row of list items. > 2. This is the second row of list items. > > Give some example codes: > > return shell_exec("echo $input | $markdown_script");
Display effect:
1. This is the first row of list items. 2. This is the second row of list items.
Give some example codes:
return shell_exec("echo $input | $markdown_script");
7. Insert image
Images are created in a similar way to hyperlinks, and like hyperlinks, there are two ways to write them, inline and reference.
In syntax, picture Alt means that if the picture cannot be displayed for some reason, the defined picture Alt text will be used instead of the picture. Like the Title in the link, the picture Title represents the text that appears when the mouse hovers over the picture. Alt and Title are not required and can be omitted, but it is recommended to write them.
7.1. Inline
Syntax description: [the external chain picture transfer fails. The source station may have an anti-theft chain mechanism. It is recommended to save the picture and upload it directly (IMG gnbskhdo-1643426621224) (picture address "picture Title")]
code:
Beautiful flowers: [External chain picture transfer failed,The origin station may have anti-theft chain mechanism,It is recommended to save the picture and upload it directly(img-acirypXt-1643426759964)(http://ww2.sinaimg.cn/large/56d258bdjw1eugeubg8ujj21kw16odn6.jpg ("beautiful flowers")]
Display effect:
Beautiful flowers:
7.2. Reference formula
Syntax description:
Write where you want to insert a picture in the document! [picture Alt] [mark]
Write [mark] at the end of the document: picture address "Title"
code:
Beautiful flowers: ![Beautiful flowers][flower] [flower]:http://ww2.sinaimg.cn/large/56d258bdjw1eugeubg8ujj21kw16odn6.jpg "beautiful flowers"
Display effect:
Beautiful flowers:
8. Contents
8.1. Inline
code:
C Functions in language `scanf()` How do you use it?
Display effect:
How to use the function scanf() in C language?
8.2. Indented multiline code
Indent 4 spaces or 1 tab
A block of code will continue until the line without indentation (or the end of the file).
code:
#include <stdio.h> int main(void) { printf("Hello world\n"); }
Display effect:
#include <stdio.h> int main(void) { printf("Hello world\n"); }
8.3. Wrap multiple lines of code with six ` s
code:
#include <stdio.h> int main(void) { printf("Hello world\n"); } ,,,
Display effect:
#include <stdio.h> int main(void) { printf("Hello world\n"); }
8.4. HTML source code
In the code block, &, < and > will be automatically converted into HTML entities. This way makes it very easy for you to use Markdown to insert the HTML source code for the example. You only need to copy and paste it, and the remaining Markdown will help you deal with it, for example:
code:
First example:
<div class="footer"> © 2004 Foo Corporation </div>
Second example:
<div class="footer"> © 2004 Foo Corporation </div> Second example: <table> <tr> <th rowspan="2">Personnel on duty</th> <th>Monday</th> <th>Tuesday</th> <th>Wednesday</th> </tr> <tr> <td>Li Qiang</td> <td>Zhang Ming</td> <td>Wang Ping</td> </tr> </table>
Display effect:
First example:
© 2004 Foo Corporation
Second example:
Personnel on duty | Monday | Tuesday | Wednesday |
---|---|---|---|
Li Qiang | Zhang Ming | Wang Ping |
9. Footnotes
Syntax description:
Adding the footnote name [^ footnote name] after the text that needs to be annotated is called annotation. Then add a footnote anywhere in the text (usually at the end). There must be a corresponding footnote name before the footnote.
Note: after the test, a line must be left blank between the footnote and the footnote, otherwise it will become invalid. After success, you will find that even if you don't write the footnote at the end of the article, it will be automatically classified to the end of the article after Markdown conversion.
code:
use Markdown[^1]Can write documents efficiently, Direct conversion to HTML[^2], You can use Leanote[^Le] Write in the editor. [^1]:Markdown Is a plain text markup language [^2]:HyperText Markup Language Hypertext markup language [^Le]:Open source note taking platform, support Markdown And notes are sent directly as blog posts
Display effect:
Using Markdown 1 It can write documents efficiently and convert them directly into HTML 2 , you can use Leanote 3 Write in the editor.
Note: footnotes are automatically moved to the back. Please check at the end of the article, and the link behind the footnotes can directly jump back to the place of annotation.
10. LaTeX formula
10.1. $ Represents an inline formula:
code:
The conservation equation of mass and energy can use a very simple equation $E=mc^2$ To express.
Display effect:
The mass energy conservation equation can be expressed by a very simple equation.
10.2 $$indicates the whole line formula:
code:
$$\sum_{i=1}^n a_i=0$$ $$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $$ $$\sum^{j-1}_{k=0}{\widehat{\gamma}_{kj} z_k}$$
Display effect:
11. Flow chart
code:
flow st=>start: Start:>https://www.zybuluo.com io=>inputoutput: verification op=>operation: Your Operation cond=>condition: Yes or No? sub=>subroutine: Your Subroutine e=>end st->io->op->cond cond(yes)->e cond(no)->sub->io
Display effect:
StartverificationYour OperationYes or No?EndYour Subroutineyesno
12 . form
Syntax description:
- Either way, the first row is the header, the second row separates the header and the main part, and the third row starts with a table row for each row.
- The listed columns are separated by the pipe symbol |. In the native form, there should also be pipe characters on both sides of each row of the table.
- The second row can also specify the alignment direction for different columns. The default is left alignment. Add: right alignment on the - right.
code:
Simple way to write a form:
Student number|full name|fraction -|-|- Xiao Ming|male|75 Xiao Hong|female|79 Xiaolu|male|92
Write table in native mode:
|Student number|full name|fraction| |-|-|-| |Xiao Ming|male|75| |Xiao Hong|female|79| |Xiaolu|male|92|
Specify the direction for the second column of the table:
product|Price -|-: Leanote Advanced account|60 element/year Leanote Super account|120 element/year
Display effect:
Simple way to write a form:
Student number | full name | fraction |
---|---|---|
Xiao Ming | male | 75 |
Xiao Hong | female | 79 |
Xiaolu | male | 92 |
Write table in native mode:
Student number | full name | fraction |
---|---|---|
Xiao Ming | male | 75 |
Xiao Hong | female | 79 |
Xiaolu | male | 92 |
Specify the direction for the second column of the table:
product | Price |
---|---|
Leanote advanced account | 60 yuan / year |
Leanote super account | 120 yuan / year |
13. Dividing line
You can use more than three asterisks, minus signs and bottom lines in a line to create a separation line. There can be nothing else in the line. You can also insert a space between the asterisk or minus sign. You can create separation lines in each of the following ways:
code:
* * * *** *****- - - ---------------------------------------
The display effect is the same:
14. Code
For programmers, this function is essential. There are two ways to insert program code, one is to use indentation (Tab), and the other is to wrap the code with the "`" symbol (usually below the ESC key).
Syntax description:
1. Insert in-line code, that is, when inserting a word or a sentence of code, insert it in the form of code.
2. To insert multiple lines of code, you can use indentation or "code". See the example for details.
e advanced account | 60 yuan / year
Leanote super account | 120 yuan / year