skip to content
行之

Markdown 元素示例

/ 约3分钟

更新:
目 录

这是二级标题

这是三级标题

这是四级标题

这是五级标题
这是六级标题

分隔线




强调

这是加粗文字

这是斜体文字

删除线

引号

“双引号” 和 ‘单引号’

引用块

引用可以嵌套……

……通过连续使用更多的 > 号来实现……

脚注引用

一个包含可点击引用1(带来源链接)的示例。

第二个示例包含一个带来源链接的引用2

如果你查看 src/content/post/markdown-elements/index.md,会发现脚注引用与“Footnotes”标题由 remark-rehype 插件自动追加到页面底部。

列表

无序列表

  • 使用 +-* 开头创建列表
  • 子列表通过缩进 2 个空格实现:
    • 更换标记符会强制开始新的列表:
      • Ac tristique libero volutpat at
      • Facilisis in pretium nisl aliquet
      • Nulla volutpat aliquam velit
  • 很简单!

有序列表

  1. Lorem ipsum dolor sit amet

  2. Consectetur adipiscing elit

  3. Integer molestie lorem at massa

  4. 你可以使用连续编号……

  5. ……或者都写成 1. 也可以

从偏移量开始编号:

  1. foo
  2. bar

代码

行内 code

缩进代码

// Some comments
line 1 of code
line 2 of code
line 3 of code

代码块 “围栏”

这里是示例文本……

语法高亮

var foo = function (bar) {
return bar++;
};
console.log(foo(5));

Expressive code examples

添加标题

file.js
console.log("Title example");

一个 bash 终端

Terminal window
echo "A base terminal example"

高亮代码行

line-markers.js
function demo() {
console.log("this line is marked as deleted");
// This line and the next one are marked as inserted
console.log("this is the second inserted line");
return "this line uses the neutral default marker type";
}

Expressive Code can do a ton more than shown here, and includes a lot of customisation.

表格

选项描述
data模板可用的数据文件路径
engine用于处理模板的引擎,默认 Handlebars
ext目标文件使用的扩展名

表格对齐

商品价格库存
苹果1.99739
香蕉1.896

键盘标记

动作快捷键
垂直分栏Alt+Shift++
水平分栏Alt+Shift+-
自动分栏Alt+Shift+d
切换分栏Alt + 方向键
调整分栏大小Alt+Shift + 方向键
关闭分栏Ctrl+Shift+W
最大化面板Ctrl+Shift+P + Toggle pane zoom

图片

同目录图片:src/content/post/markdown-elements/logo.png

Astro 仙人掌主题 Logo

链接

来自 markdown-it 的示例内容

Footnotes

  1. 第一个脚注示例(带返回内容的链接)。

  2. 第二个脚注示例(带链接)。