Skip to content

更新了使用Python脚本将引注链接到参考文献表的文档。 #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2025

Conversation

Syize
Copy link
Contributor

@Syize Syize commented Mar 27, 2025

No description provided.

Copy link
Contributor

github-actions bot commented Mar 27, 2025

✅ 成功部署预览!

类型 链接
预览地址 https://deploy-preview-wiki-363--zotero-zh.netlify.app
最新提交 ca66452
部署日志 ci-pr #175

@Syize
Copy link
Contributor Author

Syize commented Mar 27, 2025

需要再更新一下文档

@Syize Syize closed this Mar 27, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Zotero CN Backlog Mar 27, 2025
Copy link
Member

@northword northword left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢!有一些修改建议,你可以按需采纳。

@@ -245,44 +245,49 @@ Public Sub ZoteroLinkCitation()

## Python 脚本

通过使用 Python 的 pywin32 库,可以在 Python 中实现与 Word 宏类似的功能
Python 包[noterools](https://github.com/Syize/noterools)提供了可以 zotero 的引用添加超链接的函数
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Python 包[noterools](https://github.com/Syize/noterools)提供了可以 zotero 的引用添加超链接的函数
Python 包 [noterools](https://github.com/Syize/noterools) 提供了为 Zotero 的引注添加超链接的方法

from noterools import Word, add_citation_cross_ref_hook, add_cross_ref_style_hook

if __name__ == '__main__':
# 你想要添加超链接的Word文档路径
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 你想要添加超链接的Word文档路径
# 你想要添加超链接的 Word 文档路径


### 使用前的注意事项

- 本 Python 代码仅对引用格式为 `(作者, 年份)` 的文档做过测试
- `noterools`实际上也是通过操作 Word 来添加的超链接,由于依赖库的原因其只能在 Windows 环境下使用。
- 在为`(作者, 年份)`引用格式添加超链接时,`noterools`还会修正参考文献表中没有被正确设置为斜体的刊物名称或出版商名称。*顺序引用格式*目前还不支持此功能。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 在为`(作者, 年份)`引用格式添加超链接时,`noterools`还会修正参考文献表中没有被正确设置为斜体的刊物名称或出版商名称。*顺序引用格式*目前还不支持此功能
- 在为`(作者, 年份)`引用格式添加超链接时,`noterools`还支持修正参考文献表中没有被正确设置为斜体的刊名或出版商名称。**顺序引用格式目前还不支持此功能**

Comment on lines 275 to 280
# 为顺序引用格式添加超链接
add_citation_cross_ref_hook(word, is_numbered=True)
# 为(作者, 年份)引用格式添加超链接,默认会将参考文献表中没有被正确设置为斜体的刊物名称或出版商设置为斜体
add_citation_cross_ref_hook(word, is_numbered=False)
# 为(作者, 年份)引用格式添加超链接,不修正参考文献表
add_citation_cross_ref_hook(word, is_numbered=False, set_container_title_italic=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议仅保留一个例子,其余两个注释掉,并在注释中说明按需取消注释,这样有助于理解。

@northword
Copy link
Member

需要再更新一下文档

好的,你可以随时 reopen 或发起新 pr,或是把这个 pr 转为 draft,完成后再 ready for review。

@Syize
Copy link
Contributor Author

Syize commented Mar 28, 2025

好的,感谢建议👍

@Syize Syize reopened this Mar 28, 2025
@github-project-automation github-project-automation bot moved this from Done to In Progress in Zotero CN Backlog Mar 28, 2025
@northword northword merged commit 5f207af into zotero-chinese:main Mar 28, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Zotero CN Backlog Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants