Skip to content

Commit

Permalink
🔖 v1.1.1 / 2024.11.24
Browse files Browse the repository at this point in the history
- ✨ 添加脚注引用css样式
- ✨ 脚注块引的自定义属性值改为脚注内容块id,方便删除和后面的数字编号功能
- ✨ 选中文本的样式设置,取消加粗、高亮等原生样式,改用自定义样式。注意:所以如果有对重叠文字重复添加脚注的需求,请不要开启自定义样式,会有样式冲突问题。
  • Loading branch information
Achuan-2 committed Nov 23, 2024
1 parent 9f395c1 commit 1b2b947
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 70 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@


## v1.1.0 / 2024.11.23

## v1.1.1 / 2024.11.24

- ✨ 添加脚注引用css样式
- ✨ 脚注块引的自定义属性值改为脚注内容块id,方便删除和后面的数字编号功能
- ✨ 选中文本的样式设置,取消加粗、高亮等原生样式,改用自定义样式。注意:所以如果有对重叠文字重复添加脚注的需求,请不要开启自定义样式,会有样式冲突问题。

## v1.1.0 / 2024.11.23

- ✨支持设置脚注内容放到当前块后
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-23_20-16-16-2024-11-23.png)

## v1.0.9 / 2024.11.23
## 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)
Expand Down
70 changes: 34 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,35 @@ Implement footnotes and remarks function using SiYuan's blockref.

> Using the Tsundoku theme for demonstration, the style of nested blockquote has been optimized.
## 📝CHANGELOG

See [CHANGELOG.md](CHANGELOG.md)


## 📝Usage Instructions

> The minimum required version of Siyuan Notes for this plugin is v3.1.13.
**This plugin supports high customization with the following settings:**

- **Footnote Container Settings**
- **Footnote Location**: You can set the storage location to be in the current document, a specified document, or a sub-document. The default is `Current Document`.
- **Document ID of the Specified Document**: When the footnote location is set to "Specified Document", set a document to store all footnotes.
- **Footnote Container Title in the Current Document**: When the footnote location is set to "Current Document", set the h2 title for storing footnotes.
- **Footnote Container Title in the Specified Document and Sub-document**: When the footnote location is set to "Specified Document", set the h2 title for storing footnotes. When the footnote location is set to "Sub-document", set the document title for storing footnotes.
- **Automatically Update Footnote Container Title**: Whether to automatically update the footnote container title to match the set template each time a footnote is created.
- **Footnote Reference Style**: The style of footnote references: "Blockquote" or "Block Link".
- **Footnote Blockquote Anchor Text**: Set the anchor text for footnote references. The default is `[Note]`.
- **Selected Text Style**: You can add styles such as bold, highlight, italic, or underline to the selected text. The default is `None`.
- **Order of Inserting Footnotes**: Ascending or descending order. The default is `Ascending`.
- **Footnote Content Template**: To set up a template for footnotes, it is recommended to use nested quote blocks or a combination of super blocks to store the footnote content. This ensures that the footnote content is contained within a single block. `${selection}` represents the content of the selected text, `${content}` is a placeholder for the footnote content, and `${refID}` is the ID of the block where the selected text is located. And you can use kramdown syntax to define the block styles.
- **Nested Quote Block Template**

- **Footnote Storage Settings**
- **Footnote Location**: You can set footnotes to be stored in the current document, specified document, sub-document, or after parent block. Default is `Current Document`.
- **Document ID for Specified Document**: When footnote location is "Specified Document", set a document to store all footnotes.
- **Container Title in Current Document**: When using current document storage, set the h2 heading for footnotes.
- **Container Title in Specified Document**: When using specified document storage, set the h2 heading for footnotes.
- **Container Title in Sub-document**: When using sub-document storage, set the document title for footnotes.
- **Auto Update Container Title**: Whether to automatically update the container title to match template settings when creating footnotes.
- **Footnote Insertion Order**: Ascending or descending order, default: `Ascending`.

- **Footnote Style Settings**
- **Reference Style**: Choose between "Block Reference" or "Block Link".
- **Reference Anchor Text**: Set the anchor text for footnote references, default: `[Note]`.
- **Selected Text Style**: Choose between no style or custom style, default: `No Style`. Note: For overlapping text footnotes, disable custom styling to avoid conflicts.
- **Footnote Content Template**: Set template for footnotes using nested quotes or super blocks. Variables: `${selection}` (selected text), `${content}` (footnote content), `${refID}` (block ID). Supports kramdown syntax for block styling.

- Nested Quote Template:
```markdown
>> ${selection} [[↩️]](siyuan://blocks/${refID})
>>
> 💡${content}
```

- **Vertical Super Block Combination Template**

- Vertical Super Block Template:
```markdown
{{{row
> ${selection} [[↩️]](siyuan://blocks/${refID})
Expand All @@ -46,34 +43,35 @@ See [CHANGELOG.md](CHANGELOG.md)
}}}
{: style="border: 2px dashed var(--b3-border-color);"}
```
- Use list items to store references to the original block, with the selected text as the anchor text. You can view all footnotes in the backlink panel of the current document.
```
- ((${refID} "${selection}"))

{{{row
${content}
}}}
- List Item Template with Backlinks:
```markdown
- ((${refID} "${selection}"))

{{{row
${content}
}}}
```

![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-24_01-26-22-2024-11-24.png)

![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-21_08-53-00-2024-11-21.png)
Supports simultaneous deletion of footnote references and content via right-click menu [Plugin -> Delete Footnote].

To simultaneously delete footnote references and footnote content, you can right-click on the footnote reference and select `[Plugin -> Delete Footnote]` from the menu.
![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-18_16-39-18-2024-11-18.png)

![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-18_16-24-25-2024-11-18.png)
Supports multiple annotations for the same text.

![](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)

## 🙏 Acknowledge
## 🙏Acknowledgments

- [https://github.com/zxhd863943427/siyuan-plugin-memo](https://github.com/zxhd863943427/siyuan-plugin-memo)
- [https://github.com/siyuan-note/plugin-sample-vite-svelte](https://github.com/siyuan-note/plugin-sample-vite-svelte)
- [https://github.com/zxhd863943427/siyuan-plugin-memo](https://github.com/zxhd863943427/siyuan-plugin-memo): Improved based on this plugin, adding more features and configuration options
- [https://github.com/siyuan-note/plugin-sample-vite-svelte](https://github.com/siyuan-note/plugin-sample-vite-svelte): Using this plugin template greatly improved development efficiency

## ❤️ Donation
## ❤️Donation

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.
A poor graduate student in the process of studying. If you like my plugin, feel free to star the GitHub repository and donate. 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)


> 2024.11.20, thanks to muhaha for donating ¥30
> 2024.11.20, thanks to muhaha for donating ¥30
65 changes: 34 additions & 31 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,54 @@ v1.0.9 / 2024.11.23
**本插件支持高度自定义化,支持的设置如下:**


- **脚注容器设置**
- **脚注存放位置**:可以设置脚注存放在当前文档、指定文档或子文档,默认为`当前文档`
- **脚注存放设置**
- **脚注存放位置**:可以设置脚注存放在当前文档、指定文档、子文档、父块后,默认为`当前文档`
- **指定文档的文档ID** :当脚注存放位置为“指定文档”时,设置某个文档存放所有的脚注

- **当前文档的脚注容器标题**:当脚注存放位置为“当前文档”时,设置存放脚注的h2标题

- **指定文档和子文档的脚注容器标题**:当脚注存放位置为“指定文档”时,设置存放脚注的h2标题。当脚注存放位置为“子文档”时,设置存放脚注的文档标题名
- **指定文档的脚注容器标题**:当脚注存放位置为“指定文档”时,设置存放脚注的h2标题。
- **子文档的脚注容器标题**:当脚注存放位置为“子文档”时,设置存放脚注的文档标题名
- **是否自动更新脚注容器标题**:每次创建脚注是否会自动更新脚注容器标题符合设置的模板
- **脚注引用样式**脚注引用的样式:“块引”或“块链接”
- **脚注块引锚文本**:设置脚注引用的锚文本,默认:`[注]`
- **选中文本的样式**可以为选中文本添加加粗、高亮、斜体、下划线样式,默认:`无样式`
- **插入脚注的顺序**顺序或者倒序,默认:`顺序`
- **脚注内容模板**设置脚注的模板,推荐使用嵌套引述块或超级块来存放脚注内容,保证脚注内容属于同一个块,`${selection}`代表选中文本的内容,`${content}`代表脚注内容占位,`${refID}`代表选中文本所在的块的ID。另外可以使用kramdown语法设置教主内容块的块样式。
- **插入脚注的顺序**顺序或者倒序,默认:`顺序`
- **脚注样式设置**
- **脚注引用样式**脚注引用的样式:“块引”或“块链接”
- **脚注块引锚文本**设置脚注引用的锚文本,默认:`[注]`
- **选中文本的样式**选择无样式或自定义样式,默认:`无样式`。注意:所以如果有对重叠文字重复添加脚注的需求,请不要开启自定义样式,会有样式冲突问题

- 嵌套引述块模板
- **脚注内容模板**:设置脚注的模板,推荐使用嵌套引述块或超级块来存放脚注内容,保证脚注内容属于同一个块,`${selection}`代表选中文本的内容,`${content}`代表脚注内容占位,`${refID}`代表选中文本所在的块的ID。另外可以使用kramdown语法设置教主内容块的块样式。

```markdown
>> ${selection} [[↩️]](siyuan://blocks/${refID})
>>
> 💡${content}
```
- 嵌套引述块模板

- 竖向超级块组合模板,添加虚线框样式
```markdown
>> ${selection} [[↩️]](siyuan://blocks/${refID})
>>
> 💡${content}
```

```markdown
{{{row
> ${selection} [[↩️]](siyuan://blocks/${refID})

${content}
}}}
{: style="border: 2px dashed var(--b3-border-color);"}
```
- 使用列表项存放引用原块的块引,锚文本为选中文字,可以在当前文档的反链面板查看所有脚注
```
- ((${refID} "${selection}"))
- 竖向超级块组合模板,添加虚线框样式

{{{row
${content}
}}}
```markdown
{{{row
> ${selection} [[↩️]](siyuan://blocks/${refID})

${content}
}}}
{: style="border: 2px dashed var(--b3-border-color);"}
```
- 使用列表项存放引用原块的块引,锚文本为选中文字,可以在当前文档的反链面板查看所有脚注
```
- ((${refID} "${selection}"))

```
{{{row
${content}
}}}

```


![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-21_08-52-02-2024-11-21.png)

![](https://fastly.jsdelivr.net/gh/Achuan-2/PicBed/assets/PixPin_2024-11-24_01-26-22-2024-11-24.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.0",
"version": "1.1.1",
"minAppVersion": "3.1.13",
"backends": [
"windows",
Expand Down

0 comments on commit 1b2b947

Please sign in to comment.