0%

markdown常用语法归纳

markdown常用语法归纳

一级标题

这是标题下的一段正常段落。

二级标题

这是标题下的块引用.

三级标题

1
这是标题下的代码块。

四级标题

  • 这是无序列表项
  • 这是无序列表项
  • 这是无序列表项
五级标题
  1. 这是有序列表
  2. 这是有序列表
  3. 这是有序列表
六级标题
WhatFollows
A tableA header
A tableA header
A tableA header

水平分割线如上下


任务清单如下:

  • [x] Create a sample markdown document
  • [x] Add task lists to it
  • [ ] Take a vacation

任务清单与列表的混合如下:

  • [ ] Steal underpants
  • 文本
  • [ ] Profit!

嵌套的无序列表:

  • Jackson 5
    • Michael
    • Tito
    • Jackie
    • Marlon
    • Jermaine
  • TMNT
    • Leonardo
    • Michelangelo
    • Donatello
    • Raphael

Markdown内置了HTML解析器,可以直接使用HTML语法定义列表。
默认的样式为加粗和斜体。

1
2
3
4
5
6
7
8
9
10
<dl>
<dt>Name</dt>
<dd>Godzilla</dd>
<dt>Born</dt>
<dd>1952</dd>
<dt>Birthplace</dt>
<dd>Japan</dd>
<dt>Color</dt>
<dd>Green</dd>
</dl>
Name
Godzilla
Born
1952
Birthplace
Japan
Color
Green

表格是粗体标题,表格体行之间阴影交替。

ArtistAlbumYear
Michael JacksonThriller1982
PrincePurple Rain1984
Beastie BoysLicense to Ill1986

如果某一数据行过多,它应该向下换行压缩和/或水平滚动。

1
2
<!-- prettier-ignore-start -->
<!-- prettier-ignore-end -->
ArtistAlbumYearLabelAwardsSongs
Michael JacksonThriller1982Epic RecordsGrammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-ClassicalWanna Be Startin’ Somethin’, Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life
PrincePurple Rain1984Warner Brothers RecordsGrammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with VocalLet’s Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I’m a Star, Purple Rain
Beastie BoysLicense to Ill1986Mercury RecordsnoawardsbutthistablecelliswideRhymin & Stealin, The New Style, She’s Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill

像代码块 var foo = "bar"; 应该在行内输入。

同样的,this should vertically align with this and this.

代码片段应该放在代码块中。

1
var foo = "bar";

代码段也可以使用高亮语法,标注的语言和代码匹配就可以高亮

1
var foo = "bar";

表格单元格内的内联代码仍然可以区分。

LanguageCode
Javascriptvar foo = "bar";
Rubyfoo = "bar"

小图像应该显示在他们的实际大小。

octocat

大图片应该总是按比例缩小并适合内容容器。

touxiang

Mermaid Test

纵向TB

graph TB
    c1-->a2
    subgraph one
    a1-->a2
    end
    subgraph two
    b1-->b2
    end
    subgraph three
    c1-->c2
    end

横向LR

graph LR
    c1-->a2
    subgraph one
    a1-->a2
    end
    subgraph two
    b1-->b2
    end
    subgraph three
    c1-->c2
    end

简单图

graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;

类图

classDiagram
classA --|> classB : Generalization
classM ..|> classN : Realization
classC --* classD : Composition
classE --o classF : Aggregation
classG --> classH : Association
classI -- classJ : Association
classK ..> classL : Dependency

E-R图

erDiagram
    CUSTOMER ||--o{ ORDER : places
    ORDER ||--|{ LINE-ITEM : contains
    CUSTOMER }|..|{ DELIVERY-ADDRESS : uses

表情文本

I give this theme two :+1:!

Set config plugins: [jemoji], Emoji searcher, see: https://emoji.muan.co/

font-awesome

1
2
<i class="fa fa-check-circle text-green">checked</i>
<i class="fa fa-battery-quarter text-red">battery</i>

checked
battery

数学公式

-------------本文结束-------------