柴语言 Markdown 语法速查

发布时间:

柴语言的撰写基于 Markdown 语法,同时使用了一些拓展语法(通过插件实现)。

标准部分请参考 Markdown Reference, 下面记录我常用到的拓展语法,以便速查:

Frontmatter ​

Frontmatter 即文章的元数据,用于配置文章的标题、日期、分类、布局等信息。

markdown
---
title: "中文标题"
date: 1970-01-01  # 晚于 3000 年的文章会被置顶 📌 ,通过时间控制优先级
category: essay | note | tutorial | project  # 参考 categoryTrans()
layout: home | post
draft: true | false # 默认为 false 否则带有 🚧 标记
---

图片样式 ​

markdown
![](/assets/image.png){style="max-height:200px;"}

折叠 Collapse ​

markdown
+++ 折叠标题
折叠内容
++++ 多重折叠
多重折叠内容
++++
+++
折叠标题

折叠内容

多重折叠

多重折叠内容

旁注 Sidenote ​

魔改自 Inline 语法,用于补充一些细节,参考 Tufte CSS 了解更多。

markdown
Here is an inline note.^[Inlines notes are easier to write, since
you don't have to pick an identifier and move down to type the
note.] Here is the rest of the paragraph.

Here is another paragraph.

Here is an inline note. Here is the rest of the paragraph.

Here is another paragraph.

脚注 Footnote ​

正文阅读部分用的比较少,通常用于引用文献。

markdown
This is a footnote reference[^footnote].

[^footnote]: This is the footnote.

This is a footnote reference[1].

文本样式 ​

markdown
paragraph with [a style me span]{style="color:red;"},
amazing [R]{style="color:red;"} 
[G]{style="color:green;"} 
[B]{style="color:blue;"}

paragraph with a style me span, amazing RGB

markdown
<u>Please underline me</u>

Please underline me


  1. This is the footnote. ↩︎