扩展
约 544 字大约 2 分钟
指南markdown
2024-03-05
标题锚点
标题会自动应用锚点。
自定义锚点
要为标题指定自定义锚点而不是使用自动生成的锚点,请向标题添加后缀:
# 使用自定义锚点 {#my-anchor}这允许将标题链接为 #my-anchor,而不是默认的 #使用自定义锚点。
链接
内部和外部链接都会被特殊处理。
主题默认对每个 md 文件自动生成一个新的 链接,并保存在对应的 md 文件的 frontmatter 的 permalink 中。 你可以随时修改它们。你也可以通过 theme.autoFrontmatter 选项来禁用这个功能,这时会恢复为 VuePress 的默认行为。
内部链接
有三种方式来使用内部链接:
- 使用 生成的
permalink作为内部链接的目标。 - 使用 md 文件的相对路径作为内部链接的目标。
- 使用 md 文件的绝对路径作为内部链接的目标, 绝对路径
/表示从${sourceDir}目录开始。
[Markdown](/guide/markdown/)
[Markdown](./basic.md)渲染为:
外部链接
外部链接带有 target="_blank" rel="noreferrer" :
Github风格的表格
输入:
| Tables | Are | Cool |
| ------------- | :-----------: | ----: |
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |输出:
| Tables | Are | Cool |
|---|---|---|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
目录表
输入:
[[TOC]]输出:
上下角标
- 使用
^ ^进行上角标标注。 - 使用
~ ~进行下角标标注。
输入:
- 19^th^
- H~2~O输出:
- 19th
- H2O
自定义对齐
输入:
::: left
左对齐的内容
:::
::: center
居中的内容
:::
::: right
右对齐的内容
:::输出:
左对齐的内容
居中的内容
右对齐的内容
任务列表
输入:
- [ ] 任务 1
- [x] 任务 2
- [ ] 任务 3输出:
脚注
输入:
人生自古谁无死,留取丹心照汗青[^脚注1]。
[^脚注1]: 出自 宋·文天祥 **《过零丁洋》**输出:
人生自古谁无死,留取丹心照汗青[1]。
出自 宋·文天祥 《过零丁洋》 ↩︎
贡献者
更新日志
2025/12/1 03:30
查看所有更新日志
db8a4-docs: optimize and completion docs (#766)于4d236-feat(theme)!: add collections support (#704)于0fd6c-refactor(theme): improve types and flat config (#524)于b153b-docs: update docs于e3b1c-docs: improve docs于62e12-feat(theme): 新增<Card>卡片组件于824a5-Update 扩展.md to fix missing[!TIP]syntax in output于4349a-docs: update doc于822d8-docs: lint fix md于2fb3d-docs: update theme docs于
