Skip to content

Commit 63054d1

Browse files
committed
Update version to v1.1.0
1 parent ea0b866 commit 63054d1

File tree

4 files changed

+51
-17
lines changed

4 files changed

+51
-17
lines changed

README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
<p align="center">中文文档 | <a href="README_EN.md">English</a></p>
44

5-
一开始我只是想依照[gwyn-hopkins](https://forums.zotero.org/discussion/comment/418013/#Comment_418013)的代码写一份相应的Python实现,用于为Zotero的引用添加可跳转的超链接。但是随着论文的修改,我发现需要对论文的格式做越来越多的设置,代码实现的功能也越来越多。经过大量的重构以后,noterools诞生
5+
一开始我只是想依照 [gwyn-hopkins](https://forums.zotero.org/discussion/comment/418013/#Comment_418013) 的代码写一份相应的 Python 实现,用于为 Zotero 的引用添加可跳转的超链接。但是随着论文的修改,我发现需要对论文的格式做越来越多的设置,代码实现的功能也越来越多。经过大量的重构以后,noterools 诞生
66

77
## 这是什么?
88

9-
目前noterools包含以下功能
9+
目前 noterools 包含以下功能
1010

11-
- 为Zotero参考文献表中的每个文献创建书签
12-
- 为Zotero的引用设置跳转到相应文献的超链接,并设置超链接是否带下划线
13-
- 为Zotero的引用设置字体颜色
14-
- 将Zotero的参考文献表中,不能被正确设置为斜体的期刊名称和出版商设置为斜体
11+
- 为 Zotero 参考文献表中的每个文献创建书签
12+
- 为 Zotero 的引用设置跳转到相应文献的超链接,并设置超链接是否带下划线
13+
- 为 Zotero 的引用设置字体颜色
14+
- 将 Zotero 的参考文献表中,不能被正确设置为斜体的期刊名称和出版商设置为斜体
1515
- 为正文中的交叉引用设置字体颜色和粗细
16+
- 将参考文献表中,表示页码范围的`-` (Unicode为`002D`)修正为`` (Unicode为`2013`)
17+
- **(实验性功能)** 帮助修改英文文献标题的大小写形式,支持三种形式:全部大写、所有单词首字母大写、仅句首首字母大写
1618

1719
## 效果图
1820

@@ -22,16 +24,15 @@
2224

2325
## 注意
2426

25-
- **该脚本仅能在Windows环境下运行**
26-
- **为顺序引用格式添加超链接的功能正常,但是暂时不能为期刊名称和出版商设置斜体**
27+
- **该脚本仅能在 Windows 环境下运行**
2728

2829
## 如何使用
2930

30-
1. 使用pip安装noterools
31+
1. 使用 pip 安装 noterools
3132
```bash
3233
pip install noterools
3334
```
34-
2. 创建一个Python脚本并运行。以下是一个简单的示例
35+
2. 创建一个 Python 脚本并运行。以下是一个简单的示例
3536

3637
```python
3738
from noterools import Word, add_citation_cross_ref_hook, add_cross_ref_style_hook
@@ -44,8 +45,8 @@ if __name__ == '__main__':
4445
# 为顺序引用格式添加超链接
4546
add_citation_cross_ref_hook(word, is_numbered=True)
4647

47-
# 为 (作者, 年份) 引用格式添加超链接,默认会将参考文献表中没有被正确设置为斜体的刊物名称或出版商设置为斜体
48-
# 由于 Word 中的超链接默认为蓝色,而 noterools 仅会将超链接添加到 年份 上,所以 作者名称 和 年份 的颜色会不一致
48+
# 为 (作者, 年份) 引用格式添加超链接,设置引用为蓝色。
49+
# 默认会将参考文献表中没有被正确设置为斜体的刊物名称或出版商设置为斜体
4950
# add_citation_cross_ref_hook(word, is_numbered=False)
5051

5152
# 通过设置 color 的值,可以设置整个引用的颜色(不包含括号)
@@ -60,4 +61,20 @@ if __name__ == '__main__':
6061

6162
# 为正文中以 Figure 开头的交叉引用字体设置蓝色和粗体
6263
add_cross_ref_style_hook(word, color=16711680, bold=True, key_word=["Figure"])
64+
65+
# 修正 "-" 符号
66+
# add_update_dash_symbol_hook(word)
67+
68+
# 将英文标题改为全部大写
69+
# add_format_title_hook(word, upper_all_words=True)
70+
71+
# 将英文标题改为首字母大写
72+
# add_format_title_hook(word, upper_first_char=True)
73+
74+
# 将英文标题改为仅句首单词的首字母大写
75+
# add_format_title_hook(word, lower_all_words=True)
76+
77+
# 改为仅句首单词的首字母大写时,你可以给出一个专有名词列表,noterools 会检测其中的专有名词,防止这些名词被错误设置为小写
78+
# word_list = ["UNet", "US", "China", "WRF"]
79+
# add_format_title_hook(word, lower_all_words=True, word_list=word_list)
6380
```

README_EN.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Currently, noterools can help you do the following things:
1313
- Customize the font color of Zotero citations.
1414
- Italicize journal names and publishers in the Zotero bibliography that aren't correctly formatted as italics.
1515
- Adjust the font color and weight for cross-references within the main text.
16+
- Replace the hyphen (-, Unicode 002D) used for page ranges in the bibliography with an en dash (–, Unicode 2013).
17+
- (Experimental Feature) Modify the capitalization style of English reference titles. Supports three styles: ALL CAPS, Title Case (Capitalize Each Word), and Sentence case (Capitalize first word only).
1618

1719
## Screenshots
1820

@@ -23,7 +25,6 @@ Currently, noterools can help you do the following things:
2325
## Important Note
2426

2527
- **This script can only work in Windows.**
26-
- **The function for adding hyperlinks to sequential citation formats works properly, but italicizing journal names and publishers is not yet supported.**
2728

2829
## How to use?
2930

@@ -46,8 +47,8 @@ if __name__ == '__main__':
4647
# Add hyperlinks for numbered citation formats.
4748
add_citation_cross_ref_hook(word, is_numbered=True)
4849

49-
# Add hyperlinks to (Author, Year) citation format. By default, container titles or publishers in the bibliography that are not correctly italicized will be set to italics.
50-
# In Word, hyperlinks are blue by default, while noterools only adds hyperlinks to the year, causing a color mismatch between the author name and the year.
50+
# Add hyperlinks to (Author, Year) citation format, set the citation font color to blue.
51+
# By default, container titles or publishers in the bibliography that are not correctly italicized will be set to italics.
5152
# add_citation_cross_ref_hook(word, is_numbered=False)
5253

5354
# By setting the value of color, you can change the color of the entire citation (excluding the parentheses).
@@ -62,4 +63,20 @@ if __name__ == '__main__':
6263

6364
# Set the font color and bold style for cross-references starting with 'Figure' in the main contents.
6465
add_cross_ref_style_hook(word, color=16711680, bold=True, key_word=["Figure"])
66+
67+
# Replace the hyphen with en dash.
68+
# add_update_dash_symbol_hook(word)
69+
70+
# Change English articles' title format to All CAPS.
71+
# add_format_title_hook(word, upper_all_words=True)
72+
73+
# Change English articles' title format to Title Case (minor words will be changed too).
74+
# add_format_title_hook(word, upper_first_char=True)
75+
76+
# Change English articles' title format to Sentence Case.
77+
# add_format_title_hook(word, lower_all_words=True)
78+
79+
# You can give a list contains proper noun when change format to Sentence Case.
80+
# word_list = ["UNet", "US", "China", "WRF"]
81+
# add_format_title_hook(word, lower_all_words=True, word_list=word_list)
6582
```

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project(
22
'noterools',
3-
version: '1.0.2',
3+
version: '1.1.0',
44
license: 'BSD-3',
55
meson_version: '>=0.64.0',
66
default_options: ['warning_level=2'],

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = ["meson-python"]
44

55
[project]
66
name = "noterools"
7-
version = "1.0.2"
7+
version = "1.1.0"
88
readme = "README_EN.md"
99
license = { text = "GPL-3.0-or-later" }
1010
requires-python = '>=3.10'

0 commit comments

Comments
 (0)