Skip to content

Markdown 使用演示

与普通markdown有微小差别

首句空格

c
 //半角空格,半个汉字
 //全角空格,一个汉字

顶部

可以设置的项目有

  • Edit Link
  • Prev Next Link
  • Outline
yaml
---
prev:
    text: 'Markdown'
    link: '/guide/markdown'
---

---
outline: deep
---
#等同于
---
outline: [2,6]
---

页面跳转

markdown
 [点击这里跳转到:顶部](#顶部)

表格

| Tables        |      居中      |  右对齐 |
| ------------- | :-----------: | ----: |
| col 3 is      | right-aligned | $1600 |
| col 2 is      |   centered    |   $12 |
| zebra stripes |   are neat    |    $1 |
Tables居中右对齐
col 3 isright-aligned$1600
col 2 iscentered$12
zebra stripesare neat$1

emoji

:tada: :100:

🎉 💯 可用的emoji连接

latex

latex
行内latex公式$\color{red} {这是一串红色的字符}$  
$$F = \sum_{n=-\infty}^{\infty}\left|\mathscr{F}\left[f(x)\right]\right|^{2}\Delta x$$
$$\varGamma(x)=\frac{\int_{\alpha}^{\beta}g(t)(x-t)^2\text{d}t}{\phi(x)\sum_{i=0}^{N-1}\omega_i}\tag{2}$$

行内latex公式

F=n=|F[f(x)]|2Δx(2)Γ(x)=αβg(t)(xt)2dtϕ(x)i=0N1ωi

提示

md
::: info
This is an info box.
:::

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a dangerous warning.
:::

::: details
- 第一个
    ```python
    print(1)
    ```
- 第二个
    ```sh
    git clone 啥啥啥
    ```
:::

::: code-group

<!-- 文件名默认是标题 -->

<<< ./snippet.py

<!-- 你可以添加设置-->

<<< ./snippet-with-region.py#snippet{1,2 python:line-numbers} [snippet with region]

:::

INFO

This is an info box.

TIP

This is a tip.

WARNING

This is a warning.

DANGER

This is a dangerous warning.

Details
  • 第一个
    python
    print(1)
  • 第二个
sh
git clone 啥啥啥
py
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import make_s_curve # 生成S形二维数据点 https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_s_curve.html
import torch
python
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import make_s_curve # 生成S形二维数据点 https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_s_curve.html
import torch

行内高光

python{2}

python
def p_sample(model,x,t,betas,one_minus_alphas_bar_sqrt):
    t = torch.tensor([t])  
    return (t )

// [!code hl]

python
def p_sample(model,x,t,betas,one_minus_alphas_bar_sqrt):
    t = torch.tensor([t])  
    return (t )

行内聚焦

// [!code focus]

python
def p_sample(model,x,t,betas,one_minus_alphas_bar_sqrt):
    t = torch.tensor([t])  
    
    return (t )

行内修改

js中// [!code --] 或py中 # [!code --]

python
def p_sample(model,x,t,betas,one_minus_alphas_bar_sqrt):
    t1 = "code --"
    t = "code ++"

    t = "code error"
    t = "code warn"
    return (t )

行前数字

:no-line-numbers表示没有代码块行数

js
def p_sample(model,x,t,betas,one_minus_alphas_bar_sqrt):
    t1 = torch.tensor([t])  
    t = torch.tensor([t])  
    return (t )
ts
// line-numbers is enabled and start from 10
const line3 = 'This is line 3'
const line4 = 'This is line 4'

类似的还有 [!code error] [!code warning]

徽章

html
### Title <Badge type="info" text="default" />
### Title <Badge type="tip" text="^1.9.0" />
### Title <Badge type="warning" text="beta" />
### Title <Badge type="danger" text="caution" />

Code above renders like:

Title default

Title ^1.9.0

Title beta

Title caution

Released under the MIT License.