diff --git a/docs/zh-CN/advanced/assist.md b/docs/zh-CN/advanced/assist.md
index 47096dfa81749d7e7053f004dd3db18e1141b360..dc86edd125c8734ddc488bfee5cb2c30c600b95f 100644
--- a/docs/zh-CN/advanced/assist.md
+++ b/docs/zh-CN/advanced/assist.md
@@ -36,19 +36,19 @@ Hexo 主题一般都会扩展一些自己特有的标签插件,在这方面做
此外,Stun 主题也有自己扩展的一些标签插件,这些标签插件如下:
-### 插入表格数据
+### 插入表格数据
如果想要在文章中显示一个表格,你可以使用 markdown 原生支持的语法,但是如果你想要让表格里的数据存储在外部文件中,那么你可以使用下面这种语法:
```
-{% table [path], [thead1, thead2, ...] %}
+{% table [path] [thead1,thead2,...] %}
```
参数:
`[path]`:数据文件的路径
-`[thead1, thead2, ...]`:表格头部的文字(表格有几列就要写几项)
+`[thead1,thead2,...]`:表格头部的文字(用半角逗号分隔,逗号前后不要有空格)
::: warning
数据文件必须放在 `/source/` 目录下,建议放在 `/source/_data/` 目录下。
@@ -80,14 +80,14 @@ Hexo 主题一般都会扩展一些自己特有的标签插件,在这方面做
2. 在文章或页面的 markdown 源文件中,插入如下标签。
```
-{% table _data/reward.json, 时间, 赞助人, 金额, 留言 %}
+{% table _data/reward.json 时间,赞助人,金额,留言 %}
```
3. 重启 Hexo 服务器,效果如下。
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190802171506.png)
-### Bootstrap 标注
+### Bootstrap 标注
语法如下:
@@ -109,14 +109,34 @@ any text
举例:
-```
+```md
+
{% note success %}
**Success**
+This is success note.
+{% endnote %}
+
+
+{% note success no-icon %}
+**Success**
+
+This is success note.
+{% endnote %}
+
+
+{% note success %}
+This is success note.
+{% endnote %}
+
+
+{% note success no-icon %}
This is success note.
{% endnote %}
```
全部效果如下:
-![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190802221712.png)
+![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190803082614.png)
+
+![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190803081736.png)
diff --git a/scripts/tags/note.js b/scripts/tags/note.js
index 99d917b1e3209eedae12e564a02aec34804c9ff9..05af1e6e76ce1674f0b26df2f1755da8c8c456fb 100644
--- a/scripts/tags/note.js
+++ b/scripts/tags/note.js
@@ -3,7 +3,9 @@
'use strict';
function note(args, content) {
- return `
+ var args = args.join(' ');
+
+ return `
${hexo.render
.renderSync({ text: content, engine: 'markdown' })
.split('\n')
diff --git a/scripts/tags/table.js b/scripts/tags/table.js
index ccad758ae1a294f4478820f1375c045c6f2370a7..d38dd6ad00bd4c43fe9125282314d1bf5ae01dbc 100644
--- a/scripts/tags/table.js
+++ b/scripts/tags/table.js
@@ -6,9 +6,8 @@ var pathFn = require('path');
var fs = require('hexo-fs');
function table(args) {
- args = args.join(' ').split(',');
var path = pathFn.join(hexo.source_dir, args[0]);
- var headers = args.slice(1);
+ var headers = args[1].split(',');
fs.exists(path).then(function(exist) {
if (!exist) {
@@ -17,24 +16,24 @@ function table(args) {
}
});
- return fs.readFile(path).then(function(data) {
- if (!data) {
+ return fs.readFile(path).then(function(datas) {
+ if (!datas) {
hexo.log.warn('Include file empty.');
return;
}
- var data = JSON.parse(data);
+ var datas = JSON.parse(datas);
var result = '
';
- headers.forEach(item => {
- result += `${item.trim()} | `;
+ headers.forEach(header => {
+ result += `${header} | `;
});
result += '
';
- data.forEach(item => {
+ datas.forEach(data => {
result += '';
- for (const key in item) {
- if (item.hasOwnProperty(key)) {
- const value = item[key];
+ for (const key in data) {
+ if (data.hasOwnProperty(key)) {
+ const value = data[key];
result += `${value} | `
}
diff --git a/source/css/_components/tag-plugin/note.styl b/source/css/_components/tag-plugin/note.styl
index 8b2412102fbc3e1fba41d9f1d9b6cb91764ab059..baa75c6651b28467796c9f04f41c119fbeb67867 100644
--- a/source/css/_components/tag-plugin/note.styl
+++ b/source/css/_components/tag-plugin/note.styl
@@ -22,15 +22,15 @@
&.success::before
content: '\f058'
- color: #5cb85c
+ color: #42b983
&.warning::before
content: '\f06a'
- color: #f0ad4e
+ color: #ecc91e
&.danger::before
content: '\f056'
- color: #d9534f
+ color: #dc3b3b
&.default
border-left-color: #777
@@ -39,22 +39,22 @@
color: #777
&.success
- border-left-color: #5cb85c
+ border-left-color: #42b983
strong
- color: #5cb85c
+ color: #42b983
&.warning
- border-left-color: #f0ad4e
+ border-left-color: #ecc91e
strong
- color: #f0ad4e
+ color: #ecc91e
&.danger
- border-left-color: #d9534f
+ border-left-color: #dc3b3b
strong
- color: #d9534f
+ color: #dc3b3b
h1, h2, h3, h4, h5, h6
margin: 0