← 指南与示例
434 字
2 分钟
Markdown 扩展功能

GitHub 仓库卡片#

你可以添加链接到 GitHub 仓库的动态卡片。页面加载时,仓库信息会从 GitHub API 获取。

FabrizzMMM-OnSpotify

使用代码 ::github{repo="<owner>/<repo>"} 创建 GitHub 仓库卡片。

::github{repo="saicaca/fuwari"}

Mermaid 图表#

带围栏的 mermaid 代码块会渲染为图表,并跟随当前配色方案。

flowchart LR
    accTitle: Markdown rendering pipeline
    accDescr: Markdown source is transformed into semantic HTML and then enhanced as a themed SVG diagram.
    A[Markdown source] --> B[Astro content pipeline]
    B --> C[Semantic HTML]
    C --> D[Themed diagram]

提示容器#

支持以下提示容器类型:note、tip、important、warning、caution。

基础语法#

:::note
Highlights information that users should take into account, even when skimming.
:::
:::tip
Optional information to help a user be more successful.
:::

自定义标题#

提示容器的标题可以自定义。

:::note[MY CUSTOM TITLE]
This is a note with a custom title.
:::

GitHub 语法#

> [!NOTE]
> The GitHub syntax is also supported.
> [!TIP]
> The GitHub syntax is also supported.

剧透内容#

你可以在文本中添加剧透内容,其中同样支持 Markdown 语法。

这段内容 !

The content :spoiler[is hidden **ayyy**]!

图片宽度与图注#

独立图片可在 alt 文本中使用可选的 w-N% 宽度令牌,并可通过 Markdown 标题在图片下方渲染居中的图注:

相册示例图片
带图注的半宽图片
![Image description w-50%](./image.webp "Visible caption")

有效宽度范围是 w-1% 至 w-100%;无效令牌会保留在 alt 文本中。图片宽度与图注相互独立——仅提供标题也会生成图注:

相册示例图片
相册示例图片
没有宽度令牌的图注
Markdown 扩展功能
https://blog.datahuk.top/posts/markdown-syntax-guide/markdown-extended/
作者
Encore
发布于
2024-05-01
许可协议
CC BY-NC-SA 4.0

分享文章

生成精美分享图或复制链接,与更多人分享本文。

最后更新于 ,距今已过 725 天

部分内容可能已过时