Markdown语法总结

发布于 2022-11-19  372 次阅读


练习markdown

H1 标题

# H1

H2

## H2

H3

### H3

H4

#### H4
H5
##### H5
H6
###### H6

水平线

--- or ___(三个英文下划线) or ***



强调

**粗体**

__粗体__

*斜体*

_斜体_

建议用*而不是_,更容易判断且不易失灵

~~删除线~~(用的是~符号)

bold粗体

italic斜体

bold粗体

italic斜体

Strikethrough删除线

块引用

> 块引用可以相互嵌套
>> 用相邻的大于>符号
> > > ...或者分开的大于>符号

块引用可以相互嵌套

用相邻的大于符号

...或者分开的大于>符号

列表

无序列表

+ 通过 `+`, `-`, or `*`来创建列表
+ 子列表通过缩进两个空格来表现
  - 标记字符更改将强制新列表启动
    * 可以用`*`
    + 可以用`+`
    - 也可以用`-`
+ enjoy it!
  • 通过 +, -, or *来创建列表

  • 子列表通过缩进两个空格来表现

    • 标记字符更改将强制新列表启动

      • 可以用*

      • 可以用+

      • 也可以用-

  • enjoy it!

有序列表

1. 可以使用数字标记
2. 第二行
3. 第三行

1. 你可以指定某一数字
1. 例如`1`

或者采取一定的偏移量

57. 芜湖
1. 起飞(实际上的效果应该是58)
  1. 可以使用数字标记

  2. 第二行

  3. 第三行

  4. 你可以指定某一数字

  5. 例如1

或者采取一定的偏移量

  1. 芜湖
  2. 起飞(实际上的效果应该是58)

Code(内嵌代码)

行内代码 code

缩进代码

    // Some comments
    line 1 of code
    line 2 of code
    line 3 of code

块代码

Sample text here...


指定语法类别(推荐)

``` js
var foo = function (bar) {
  return bar++;
};

console.log(foo(5));</code></pre>
<pre><code>
行内代码 <code>code</code>

缩进代码(貌似是粘贴代码到typora的时候自动判断?)

    // Some comments
    line 1 of code
    line 2 of code
    line 3 of code

块代码
</code></pre>
<p>Sample text here...</p>
<pre><code>
指定语法类别(推荐,有高亮)

``` js
var foo = function (bar) {
  return bar++;
};

console.log(foo(5));

表格

**正常表格**

`仅需输入| something | something | Typora 就会自动生成表格`

| Option | Description |
| ------ | ----------- |
| data   | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext    | extension to be used for dest files. |

**右对齐表格**

| Option | Description |
| ------:| -----------:|
| data   | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext    | extension to be used for dest files. |

正常表格

仅需输入| | |,然后回车

Typora 就会自动生成表格

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

右对齐表格

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

链接

[虚空裂隙](https://tftree.top)

[移动我上面停留一会会显示注释](https://tftree.top "这里是虚空裂隙!")

**可以在最后面添加注释**

**直接输入链接会自动识别,但是不能署名**

https://tftree.top

虚空裂隙

移动我上面

可以在最后面添加脚注

直接输入链接会自动识别,但是不能署名

https://tftree.top

图像

![Minion](https://octodex.github.com/images/minion.png)
![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")

**图像大概就是多了一个!感叹号,也可以添加注释**

Minion
Stormtroopocat

图像大概就是多了一个!感叹号,也可以添加注释

插件(以下功能需要安装插件)

有各种插件,在此不做翻译

The killer feature of `markdown-it` is very effective support of
[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin).

### [Emojies](https://github.com/markdown-it/markdown-it-emoji)

> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum:
>
> Shortcuts (emoticons): :-) :-( 8-) ;)

see [how to change output](https://github.com/markdown-it/markdown-it-emoji#change-output) with twemoji.

### [Subscript](https://github.com/markdown-it/markdown-it-sub) / [Superscript](https://github.com/markdown-it/markdown-it-sup)

- 19^th^
- H~2~O

### [\<ins>](https://github.com/markdown-it/markdown-it-ins)

++Inserted text++

### [\<mark>](https://github.com/markdown-it/markdown-it-mark)

==Marked text==

### [Footnotes](https://github.com/markdown-it/markdown-it-footnote)

Footnote 1 link[^first].

Footnote 2 link[^second].

Inline footnote^[Text of inline footnote] definition.

Duplicated footnote reference[^second].

[^first]: Footnote **can have markup**

    and multiple paragraphs.

[^second]: Footnote text.

### [Definition lists](https://github.com/markdown-it/markdown-it-deflist)

Term 1

:   Definition 1
with lazy continuation.

Term 2 with *inline markup*

:   Definition 2

        { some code, part of Definition 2 }

    Third paragraph of definition 2.

_Compact style:_

Term 1
  ~ Definition 1

Term 2
  ~ Definition 2a
  ~ Definition 2b

### [Abbreviations](https://github.com/markdown-it/markdown-it-abbr)

This is HTML abbreviation example.

It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.

*[HTML]: Hyper Text Markup Language

### [Custom containers](https://github.com/markdown-it/markdown-it-container)

::: warning
*here be dragons*
:::

原贴

本文是依据该网站内容而做的个人markdown复习