Table of contents
Table of contents
You can add table of contents by adding Table of contents
, toc
or contents
heading in the markdown file.
Only the first matching heading will generate the table of contents.
## Table of contents
## toc
## contents
GitHub repository cards
You can add dynamic cards that link to GitHub repositories, on page load, the repository information is pulled from the GitHub API.
Create a GitHub repository card with the code ::github{repo="<owner>/<repo>"}
.
::github{repo="Yuhanawa/astro-charm"}
Admonitions
Following types of admonitions are supported: note
tip
question
warning
notice
important
caution
danger
Highlights information that users should take into account, even when skimming.
Optional information to help a user be more successful.
Questions that users should ask themselves.
Critical content demanding immediate user attention due to potential risks.
Notice some information that users should be aware of.
Crucial information necessary for users to succeed.
Negative potential consequences of an action.
style is similar to caution
, but icon and title are different.
:::note
Highlights information that users should take into account, even when skimming.
:::
:::tip
Optional information to help a user be more successful.
:::
The title of the admonition can be customized.
This is a note with a custom title.
:::note[MY CUSTOM TITLE]
This is a note with a custom title.
:::
The GitHub syntax is also supported.
> [!TIP]
> The GitHub syntax is also supported.
Video embed
You can copy the embed code from YouTube or other platforms, and paste it in the markdown file. Or paste youtube or bilibili link to embed a video.
We support two YouTube link formats: https://www.youtube.com/watch?v=id
and https://youtu.be/id
. For Bilibili, we accept both plain link
and 【title】 link
formats. Any URL parameters beyond the video ID (such as tracking parameters) will be disregarded.
https://www.youtube.com/watch?v=oZpYEEcvu5I
【【乐正绫AI】《世末歌者》——“我仍然在无人问津的阴雨霉湿之地”【原创PV付】】 https://www.bilibili.com/video/BV1jG4y1C7uv/?share_source=copy_web
Code blocks
We support the following features:
- Syntax highlighting
- Copy button
- Colorized Brackets
- Enable by default
- Notation Diff
- Use
!code ++
and!code --
to mark added and removed lines.
- Use
- Notation Highlight
- Allow using
!code highlight
notation in code to mark highlighted lines.
- Allow using
- Notation Word Highlight
- Highlight words based on the meta string provided on the code snippet.
- Notation Focus
- Allow using
!code focus
notation in code to mark focused lines.
- Allow using
- Notation Error Level
- Allow using
!code error
!code warning
notation in code to mark highlighted lines.
- Allow using
- Meta Highlight
- Allow using
{1,3-5}
in the code snippet meta to mark highlighted lines.
- Allow using
- Meta Word Highlight
- Allow using
/word/
in the code snippet meta to mark highlighted words.
- Allow using
- Remove Notation Escape
- Remove notation escapes. Useful when you want to write
// [!code]
in markdown. If you process// [\!code ...]
expression, you can get// [!code ...]
in the output.
- Remove notation escapes. Useful when you want to write
- TypeScript Twoslash
- need explicit trigger or configuration
The reference for you might need: shiki transformers
interface Todo {
Todo.title: string
title: string
}
const const todo: Readonly<Todo>
todo: type Readonly<T> = { readonly [P in keyof T]: T[P]; }
Make all properties in T readonlyReadonly<Todo> = {
title: string
title: 'Go to bed early'.String.toUpperCase(): string
Converts all the alphabetic characters in a string to uppercase.toUpperCase(),
}
const todo: Readonly<Todo>
todo.title = 'Go to bed Right now'.String.toUpperCase(): string
Converts all the alphabetic characters in a string to uppercase.toUpperCase()
var Number: NumberConstructor
An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.Number.p- parseFloat
- parseInt
- prototype
NumberConstructor.parseInt(string: string, radix?: number): number
Converts A string to an integer.arseInt('123', 10)
Custom twoslash message
const const log: "custom message"
log = "custom message"You can use `// @log message` to make custom messagetype type type = "log" | "error" | "warn" | "annotate"
type = "log" | "error" | "warn" | "annotate"`@error` `@warn` and `@annotate` are also supportedconst const perpetual_motion_machine: string
perpetual_motion_machine = "cat" + "butter" It can't be doneconst const cat_touch_water: string
cat_touch_water = "cat" + "water"Cat couldn't touch water