Skip to content

Commit

Permalink
🔖 v1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Achuan-2 committed Nov 25, 2024
1 parent 40fc346 commit 3b301fe
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

## v1.1.4 / 2024.11.25

- ✨支持设置脚注内容块的别名,提示这个块是脚注内容,设置为空则不设置别名
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-25_09-48-30-2024-11-25.png)
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-25_09-49-59-2024-11-25.png)
- 📝README添加设置脚注引用和脚注内容块的css


## v1.1.3 / 2024.11.24

- ✨ 脚注内容模板支持渲染sprig语法,现在可以在脚注内容中插入当前时间了
Expand Down
41 changes: 41 additions & 0 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
## 📝更新日志

v1.1.4 / 2024.11.25

- ✨支持设置脚注内容块的别名,提示这个块是脚注内容,设置为空则不设置别名
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-25_09-48-30-2024-11-25.png)
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-25_09-49-59-2024-11-25.png)
- 📝README添加设置脚注引用和脚注内容块的css

v1.1.3 / 2024.11.24

- ✨ 脚注内容模板支持渲染sprig语法,现在可以在脚注内容中插入当前时间了
Expand Down Expand Up @@ -121,6 +128,40 @@ v1.0.9 / 2024.11.23

![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/%E6%80%9D%E6%BA%90%E7%AC%94%E8%AE%B0%E8%84%9A%E6%B3%A8%E6%8F%92%E4%BB%B6%E6%94%AF%E6%8C%81%E5%AF%B9%E5%90%8C%E4%B8%80%E4%B8%AA%E6%96%87%E6%9C%AC%E8%BF%9B%E8%A1%8C%E5%A4%9A%E6%AC%A1%E5%A4%87%E6%B3%A8-2024-11-19.gif)

## 自定义脚注样式

自定义脚注引用的css
```
/* 自定义脚注引用样式 */
.protyle-wysiwyg [data-node-id] span[custom-footnote] {
/* 设置背景色 */
background-color: var(--b3-font-background3);

/* 设置文字颜色 */
color: var(--b3-theme-on-background) !important;

/* 移除边框 */
border: none!important;

/* 设置左右外边距 */
margin: 0 1px;

/* 设置圆角 */
border-radius: 3px;
}
```
自定义脚注内容块的css
```
/* 自定义脚注内容块样式 */
.protyle-wysiwyg [data-node-id][custom-plugin-footnote-content="true"] {
/* 设置字体大小 */
font-size: 0.8em;

/* 设置文字颜色 */
color: var(--b3-font-color5);
}
```
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-25_09-47-46-2024-11-25.png)
## 🙏致谢
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan-plugin-blockref-footnote",
"author": "Achuan-2",
"url": "https://github.com/Achuan-2/siyuan-plugin-blockref-footnote",
"version": "1.1.3",
"version": "1.1.4",
"minAppVersion": "3.1.13",
"backends": [
"windows",
Expand Down
5 changes: 5 additions & 0 deletions public/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
"title": "Enable Ordered Footnotes",
"description": "Use automatic numbering instead of custom anchor text"
},
"footnoteAlias": {
"title": "Footnote Block Alias",
"description": "Set the alias for footnote content blocks",
"value": "Footnote"
},
"template": {
"title": "Footnote Template",
"description": "Template variables: <code>${selection}</code> is the content of the selected text , <code>${content}</code> is the placeholder for footnote content, and <code>${refID}</code> is the block ID containing the selected text <br/> ${{...}} for Sprig templated, e.g. ${{now | date \"20060102 15:04:05\"}} </br>You can use kramdown syntax to style the block."
Expand Down
5 changes: 5 additions & 0 deletions public/i18n/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
"title": "脚注内容模版",
"description": "模板变量:<code>${selection}</code>选中文本的内容,<code>${content}</code>脚注内容占位,<code>${refID}</code>选中文本所在的块的ID<br/>使用<code>${{...}}</code>可以使用Sprig语法,例如插入当前时间<code>${{now | date \"20060102 15:04:05\"}}</code></br>可以使用kramdown语法设置块样式"
},
"footnoteAlias": {
"title": "脚注内容块的别名",
"description": "设置脚注内容块的别名,提示这个块是脚注内容,设置为空则不设置别名",
"value": "脚注"
},
"reset": {
"title": "<span data-type=\"strong text\" style=\"color: var(--b3-font-color1); font-size: 130%\">重置设置</span>",
"description": "重置所有设置为默认值",
Expand Down
12 changes: 11 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default class PluginFootnote extends Plugin {
}}}
{: style="border: 2px dashed var(--b3-border-color);"}}`,
enableOrderedFootnotes: false, // Add new setting
footnoteAlias: 'footnote',
};
}

Expand Down Expand Up @@ -223,6 +224,15 @@ export default class PluginFootnote extends Plugin {
description: this.i18n.settings.template.description,
});

// Add after other style settings
this.settingUtils.addItem({
key: "footnoteAlias",
value: this.i18n.settings.footnoteAlias.value,
type: "textinput",
title: this.i18n.settings.footnoteAlias.title,
description: this.i18n.settings.footnoteAlias.description,
});

// Reset Settings Button
this.settingUtils.addItem({
key: "resetConfig",
Expand Down Expand Up @@ -624,7 +634,7 @@ export default class PluginFootnote extends Plugin {
let newBlockId = back[0].doOperations[0].id
// 添加脚注内容属性
await setBlockAttrs(newBlockId, { "custom-plugin-footnote-content": 'true' });

await setBlockAttrs(newBlockId, { "alias": this.settingUtils.get("footnoteAlias") });

// 选中的文本添加样式
// 选中的文本添加样式
Expand Down

0 comments on commit 3b301fe

Please sign in to comment.