Extensions
About 573 wordsAbout 2 min
Guidemarkdown
2025-03-03
Header Anchors
Headers automatically have anchors applied.
Custom Anchors
To specify a custom anchor for a header instead of using the auto-generated one, add a suffix to the header:
# Using a Custom Anchor {#my-anchor}This allows linking to the header as #my-anchor instead of the default #using-a-custom-anchor.
Links
Internal and external links are specially processed.
The theme automatically generates a new link for each md file and stores it in the permalink of the corresponding md file's frontmatter. You can modify these links at any time. You can also disable this feature via the theme.autoFrontmatter option, reverting to VuePress's default behavior.
Internal Links
There are three ways to use internal links:
- Use the generated
permalinkas the target for the internal link. - Use the relative path of the md file as the target for the internal link.
- Use the absolute path of the md file as the target for the internal link. The absolute path
/indicates starting from the${sourceDir}directory.
[Markdown](/guide/markdown/)
[Markdown](./basic.md)Renders as:
External Links
External links have target="_blank" rel="noreferrer":
GitHub-Style Tables
Input:
| Tables | Are | Cool |
| ------------- | :-----------: | ----: |
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |Output:
| Tables | Are | Cool |
|---|---|---|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
Table of Contents
Input:
[[TOC]]Output:
Superscript (Sup)
Superscript is used to display text above normal text, commonly for mathematical exponents (e.g., X²), ordinal numbers (e.g., 19th), etc. Content wrapped with ^ ^ will be rendered as superscript.
Syntax
X^2^
19^th^Effect
X2
19th
Subscript (Sub)
Subscript is used to display text below normal text, commonly for chemical formulas (e.g., H₂O), mathematical variables (e.g., a₁), etc. Content wrapped with ~ ~ will be rendered as subscript.
Syntax
H~2~OEffect
H2O
Custom Alignment
Input:
::: left
Left-aligned content
:::
::: center
Centered content
:::
::: right
Right-aligned content
:::Output:
Left-aligned content
Centered content
Right-aligned content
Task Lists
Task lists are used to create list items with checkboxes, suitable for displaying to-dos, task progress, or checklists. Use - [ ] for incomplete tasks and - [x] for completed tasks.
Syntax
- [ ] Task 1
- [x] Task 2
- [ ] Task 3Effect
Footnotes
Footnotes are used to add supplementary notes at the bottom of a document without affecting the reading flow of the main text. By adding footnote markers ([^identifier]) in the text and defining the footnote content anywhere in the document, readers can click the marker to jump to the corresponding note. Footnote identifiers can be numbers or any descriptive text.
Syntax
This is a paragraph[^1] that needs a footnote explanation.
[^1]: This is the footnote content.Descriptive identifiers are also supported:
Since ancient times, who has not died? Let my loyal heart illuminate the annals of history[^footnote1].
[^footnote1]: From Song Dynasty · Wen Tianxiang **"Passing Lingdingyang"**Effect
This is a paragraph[1] that needs a footnote explanation.
Since ancient times, who has not died? Let my loyal heart illuminate the annals of history[2].
Contributors
Changelog
0daf2-docs: improve docs (#929)on97a5b-docs: fix typoondb8a4-docs: optimize and completion docs (#766)on4d236-feat(theme)!: add collections support (#704)on497fe-docs: fix markdown formatting and update snippet path in usage guideon9f99a-docs: add enmarkdowndoc (#538)on0fd6c-refactor(theme): improve types and flat config (#524)ona4ac3-docs: add en-US docs (#514)on
