跳转至

Markdown注解

写注解使用,依赖模块: admonition

完整格式

Bash
!!! note "标题"
    内容

标题

内容

空标题

Bash
!!! note ""
    内容

内容

无标题

Bash
!!! note
    内容

Note

内容

注意: 无标题时类型首字母会被大写,如上面note被大写成Note

无类型

无类型,则默认为note

注意这个时候标题必须写英文,并且首字母会被自动转成大写:

Bash
1
2
3
4
5
6
7
!!! title
    内容

相当于

!!! note "Title"
    内容

Title

内容

折叠

!!!改成???,注意此时标题不能为空,否则样式有问题

适用场景: 折叠特别适用于FAQ,即标题里写问题,内容里写答案

依赖模块: pymdownx.details

Bash
??? note "标题"
    内容
标题

内容

11种颜色样式

有11种样式,每一种样式都支持多种关键字,比如note可以用seealso替代,summary可以用tldr替代

Bash
!!! note "note, seealso"
    test text

note, seealso

test text

Bash
!!! summary "summary, tldr"
    test text

summary, tldr

test text

Bash
!!! info "info, todo"
    test text

info, todo

test text

Bash
!!! tip "tip, hint, important"
    test text

tip, hint, important

test text

Bash
!!! success "success, check, done" 
    test text

success, check, done

test text

Bash
!!! question "question, help, faq"
    test text

question, help, faq

test text

Bash
!!! warning "warning, caution, attention"
    test text

warning, caution, attention

test text

Bash
!!! failure "failure, fail, missing"
    test text

failure, fail, missing

test text

Bash
!!! danger "danger, error"
    test text

danger, error

test text

Bash
!!! bug "bug"
    test text

bug

test text

Bash
!!! quote "quote, cite"
    test text

quote, cite

test text

嵌套

注解标题和内容支持多种样式

标题里使用斜体

Bash
!!! note "*标题e*"
    内容

标题e

内容

内容里使用h1-h6

Bash
1
2
3
4
!!! note "标题"
    # h1
    ## h2
    ### h3

标题

h1

h2

h3