Skip to content

Commit

Permalink
🔖v1.0.9 / 2024.11.23
Browse files Browse the repository at this point in the history
  - ✨当前文档的脚注容器标题和指定文档的脚注容器标题可以用“#”设置标题级别,不输入“#”,默认为二级标题
  - ✨设置界面改善,由于不会做设置分栏,所以只是给设置添加了“脚注存放位置”、“脚注样式设置”两个title,方便查看
  - ✨支持重置设置,重置后会恢复插件默认设置
  • Loading branch information
Achuan-2 committed Nov 23, 2024
1 parent 3454bed commit 37339ca
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 104 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@


## v1.0.9 / 2024.11.23

- ✨当前文档的脚注容器标题和指定文档的脚注容器标题可以用“#”设置标题级别,不输入“#”,默认为二级标题
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-23_18-58-47-2024-11-23.png)
- ✨设置界面改善,由于不会做设置分栏(orz),所以只是给设置添加了“脚注存放位置”、“脚注样式设置”两个title,方便查看
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-23_18-59-13-2024-11-23.png)
- ✨支持重置设置,重置后会恢复插件默认设置
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-23_18-59-34-2024-11-23.png)

## v1.0.8 / 2024.11.21
- 📝 完善README、优化设置项的表述
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ To simultaneously delete footnote references and footnote content, you can right

A poor graduate student in the process of studying. If you like my plugin, feel free to buy me a pack of spicy strips. This will motivate me to continue improving this plugin and developing new ones.

![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/20241118182532-2024-11-18.png)
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/20241118182532-2024-11-18.png)


> 2024.11.20, thanks to muhaha for donating ¥30
12 changes: 10 additions & 2 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
## 📝更新日志

[CHANGELOG.md](https://fastly.jsdelivr.net/gh/Achuan-2/siyuan-plugin-blockref-footnote/CHANGELOG.md)

v1.0.9 / 2024.11.23

- ✨当前文档的脚注容器标题和指定文档的脚注容器标题可以用“#”设置标题级别,不输入“#”,默认为二级标题
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-23_18-58-47-2024-11-23.png)
- ✨设置界面改善,由于不会做设置分栏(orz),所以只是给设置添加了“脚注存放位置”、“脚注样式设置”两个title,方便查看
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-23_18-59-13-2024-11-23.png)
- ✨支持重置设置,重置后会恢复插件默认设置
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-23_18-59-34-2024-11-23.png)
## 📝使用介绍

> 思源笔记使用本插件的版本要求:>v3.1.13
Expand Down Expand Up @@ -83,3 +89,5 @@
穷苦研究生在读ing,如果喜欢我的插件,欢迎给GitHub仓库点star和捐赠,这会激励我继续完善此插件和开发新插件。

![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/20241118182532-2024-11-18.png)

> 2024.11.20 感谢muhaha捐赠¥30
35 changes: 3 additions & 32 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,4 @@
# TODO

- [ ] 参考其他插件,对设置界面进行优化
- [ ] https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-block/blob/main/src/components/Settings.svelte
- [ ] 重置按钮并刷新思源
- [ ] 多个设置项分组
- [ ] svelte可以做到我选项1选择的是x的时候,选项2 textinput就不显示吗
```
<script>
let selection = ''; // 存储选项1的值
</script>
<div>
<label>
选项1:
<select bind:value={selection}>
<option value="">请选择</option>
<option value="x">X</option>
<option value="y">Y</option>
</select>
</label>
{#if selection === 'y'}
<div>
<label>
选项2:
<input type="text" />
</label>
</div>
{/if}
</div>
```
- [ ] 支持数字编号
- [ ] 思路:添加一个命令,把当前文档的脚注转化为数字编号,考虑到思源的动态加载机制,应该是把当前文档导出kramdown文本,直接对kramdown进行处理。注意,导出kramdown需要用span样式(https://github.com/siyuan-note/siyuan/issues/13183)
1. 首先先用正则搜索形如`<sup>((20241118190709-lx2usll "注"))</sup>{: style="--memo: 1"}`的块引,根据搜索,获取每个被引用的块id,考虑到可能会存在重复,只考虑这个id在整个文档第一次出现的顺序进行排序。排序后将块引中的`"注"`改为单引号包裹的对应块id的序号(思源笔记kramdown语法单引号代表动态锚文本)。
Expand All @@ -43,4 +12,6 @@
- [ ] 去除脚注块引锚文本,只保留导出
- [ ] 不导出脚注内容,只显示思源的脚注
- [ ] 自定义选中文本的样式
- [ ] 参考<https://github.com/zxhd863943427/siyuan-plugin-memo>,添加css样式
- [ ] 参考<https://github.com/zxhd863943427/siyuan-plugin-memo>,添加css样式
- [ ] 删除最后一个脚注后,删除脚注标题
* 方法:检测脚注标题有几个脚注内容块,如果没有脚注内容块了,就把标题删除(暂时不考虑通过文档属性的方式删除)
12 changes: 11 additions & 1 deletion public/i18n/en_US.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"tips": "Add footnote",
"settings": {
"groups": {
"container": "<b style='font-size: 130%'>Footnote Storage Settings</b>",
"style": "<b style='font-size: 130%'>Footnote Style Settings</b>"
},
"saveLocation": {
"title": "Footnote Location",
"description": "Current document, Specified document or Child Document",
Expand All @@ -12,7 +16,7 @@
"title": "Specified Document ID",
"description": "Takes effect when footnote location is set to Specified document"
},
"footnoteContainerTitle":{
"footnoteContainerTitle": {
"title": "Footnote Container Title",
"description": "Set the document title to store footnotes when the footnote location is set to Current Document.<br/>Template variable: Current document title <code>${filename}</code>",
"value": "## Footnotes"
Expand Down Expand Up @@ -60,6 +64,12 @@
"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/>You can use kramdown syntax to style the block."
},
"reset": {
"title": "<span data-type=\"strong text\" style=\"color: var(--b3-font-color1); font-size: 130%\">Reset Settings</span>",
"description": "Reset all settings to default values",
"label": "Reset",
"confirm": "Are you sure you want to reset all settings of this plugin to default values?"
}
},
"deleteFootnote": "Delete Footnote",
Expand Down
18 changes: 14 additions & 4 deletions public/i18n/zh_CN.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"tips": "添加脚注",
"settings": {
"groups": {
"container": "<b style='font-size: 130%'>脚注存放设置</b>",
"style": "<b style='font-size: 130%'>脚注样式设置</b>"
},
"saveLocation": {
"title": "脚注存放位置",
"description": "将脚注存放于当前文档、指定文档或子文档",
Expand All @@ -12,22 +16,22 @@
"title": "指定文档的文档ID",
"description": "当脚注存放位置为“指定文档”时,通过文档ID指定文档,设置这个文档存放所有的脚注,方便导出"
},
"footnoteContainerTitle":{
"footnoteContainerTitle": {
"title": "当前文档的脚注容器标题",
"description": "当脚注存放位置为“当前文档”时,设置存放脚注的标题名(如果不用#指定标题级别,默认为二级标题)<br/>模板变量:<code>${filename}</code>当前文档标题",
"value": "## 脚注"
},
"footnoteContainerTitle2":{
"footnoteContainerTitle2": {
"title": "指定文档的脚注容器标题",
"description": "当脚注存放位置为“指定文档”时,设置存放脚注的标题名(如果不用#指定标题级别,默认为二级标题)<br/>模板变量:<code>${filename}</code>当前文档标题",
"value": "## ${filename} 脚注"
},
"footnoteContainerTitle3":{
"footnoteContainerTitle3": {
"title": "子文档的脚注容器标题",
"description": "当脚注存放位置为“子文档”时,设置存放脚注的文档标题名<br/>模板变量:<code>${filename}</code>当前文档标题",
"value": "${filename} 脚注"
},
"updateFootnoteContainerTitle":{
"updateFootnoteContainerTitle": {
"title": "是否自动更新脚注容器标题",
"description": "每次创建脚注是否根据模板自动更新脚注容器标题"
},
Expand Down Expand Up @@ -60,6 +64,12 @@
"template": {
"title": "脚注内容模版",
"description": "模板变量:<code>${selection}</code>选中文本的内容,<code>${content}</code>脚注内容占位,<code>${refID}</code>选中文本所在的块的ID<br/>可以使用kramdown语法设置块样式"
},
"reset": {
"title": "<span data-type=\"strong text\" style=\"color: var(--b3-font-color1); font-size: 130%\">重置设置</span>",
"description": "重置所有设置为默认值",
"label": "重置",
"confirm": "是否重置该插件所有设置为默认值?"
}
},
"deleteFootnote": "删除脚注",
Expand Down
63 changes: 0 additions & 63 deletions src/hello.svelte

This file was deleted.

0 comments on commit 37339ca

Please sign in to comment.