notice #
{{< notice class="blue" >}}
这是 blue 样式
{{< /notice >}}
这是 blue 样式
这是 green 样式
这是 yellow 样式
这是 red 样式
img #
{{< img src="example.png" align="left" >}}
| 参数 | 说明 |
|---|
align | 对齐 left center right |
zoom | 缩放,默认 0.5,svg 图片默认 1 |
auto-dim | 深色模式图片是否变暗,默认 true,对 svg 图片无效 |
font-family | 字体,只对 svg 图片有效,默认 LXGW WenKai Mono |
font-size | 字体大小,只对 svg 图片有效,默认 16px |
scroll-x | 图片溢出后左右滚动,默认 false,只对 svg 图片有效 |
margin | 图片边距,格式:margin="10px 0 15px 0" |
table #
{{< table thead=true wrap=false min-width="100,200,300">}}
|选项|说明|
|:---|:---|
|参数|123 |
{{< /table >}}
| 参数 | 说明 |
|---|
thead | 是否显示表头,默认 true |
warp | 长文本是否换行,默认 false |
mono | 使用等宽字体,默认 false |
min-width | 单元格最小宽度 |
| min-width="100,200,300" 表示第一列最小宽 100px , 第二列 200px ,第三列 300px |
| min-width="100,,300" 表示第一列最小宽 100px ,第三列 300px |
text #
{{< text fg="green" >}} hello world {{< /text >}}
| 参数 | 说明 |
|---|
fg | 文本前景色。 |
bold | 粗体,默认 false。 |
foreground
red
orange
yellow
green
blue
aqua
purple
background-dim
background-0
background-1
background-2
background-3
background-4
background-5
background-red
background-visual
background-yellow
background-green
background-blue
gray-0
gray-1
gray-2
```text{ nonebg=true }
./
├── configure.ac
├── {{< button-file target="targetDiV" src="files/test1.c" title=" test1.c" >}}
└── src/
├── {{< button-file target="targetDiV" src="files/test2.c" title=" test2.c" fg="purple" >}}
└── subdir/
└── {{< button-file target="targetDiV" src="files/subdir/test2.c" title=" test2.c" fg="purple" >}}
```
<div id="targetDiV"></div>
./
├── configure.ac
├──
└── src/
├──
└── subdir/
└──
| 参数 | 说明 |
|---|
target | 目标元素的 id,如果 id 为空则直接在当前位置插入。 |
src | 源文件位置。 |
title | 按钮的标题。 |
fg | 按钮标题的前景色 foreground、 red、orange 等 core.css 中的颜色。 |
insert-file #
{{< insert-file src="file/test.md" >}}
代码块样式 #
该功能不是 Shortcodes,是 Code block render hooks。
文件标题栏:
```text{ bar="hello.txt" }
hello world
```
文件hello.txt
自定义标题栏:
```bash-session{ bar="终端:打印 hello world" }
$ echo hello world
```
终端打印 hello world
| 属性 | 说明 |
|---|
bar | 格式 类型:标题,若不指定 类型,默认为 文件。 |
copy | 显示 复制 按钮,默认 false。 |
height | 最大高度(占视窗高度的百分比),范围 1-100,默认为 空。 |
nonebg | 背景透明,默认 false。 |
hover | 鼠标 hover 时高亮当前行,默认 false。 |