-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 完善README说明 - 完善代码注释 - 完善代码格式 - 完善插件log日志 - 完善插件说明 - 自动发布资产 - 自动生成发布说明 - 使得 GitHub Actions 工作流中的时间戳反映的是 UTC+8 时区 - 自动更新 tag_name 和 release_name
- Loading branch information
Showing
3 changed files
with
177 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Release Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
timestamp: ${{ steps.get-timestamp.outputs.time }} | ||
steps: | ||
- name: Get build timestamp | ||
id: get-timestamp | ||
run: | | ||
echo "time=$(TZ="Asia/Shanghai" /bin/date "+%Y-%m-%d-%H%M")" >> $GITHUB_OUTPUT | ||
- name: Generate environmental variables | ||
id: generate_env_vars | ||
run: | | ||
echo "tag_name=nlcisbn-${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT | ||
echo "release_name=NLCISBN Plugin Release ${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT | ||
- uses: actions/checkout@v2 | ||
|
||
# 创建ZIP压缩包 | ||
- name: Create ZIP Archive | ||
run: | | ||
zip NLCISBNPlugin.zip *.py README.md LICENSE | ||
# 创建发布说明 | ||
- name: Generate Release Notes | ||
id: generate_notes | ||
run: | | ||
RELEASE_NOTES=$(git log --format='%h %s' --reverse $(git describe --tags --abbrev=0 @^)..@) | ||
echo "RELEASE_NOTES=$RELEASE_NOTES" >> $GITHUB_ENV | ||
# 创建发布 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.generate_env_vars.outputs.tag_name }} | ||
release_name: ${{ steps.generate_env_vars.outputs.release_name }} | ||
body: ${{ env.RELEASE_NOTES }} | ||
draft: false | ||
prerelease: true | ||
|
||
# 上传ZIP文件作为发布资产 | ||
- name: Upload Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./NLCISBNPlugin.zip | ||
asset_name: NLCISBNPlugin.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,93 @@ | ||
# NLCISBNPlugin | ||
基于中国国家图书馆ISBN检索的calibre的source/metadata插件 | ||
<p align="center"> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin/stargazers" target="_blank"><img src="https://img.shields.io/github/stars/DoiiarX/NLCISBNPlugin.svg"></a> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin/network/members" target="_blank"><img src="https://img.shields.io/github/forks/DoiiarX/NLCISBNPlugin.svg"></a> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin/issues" target="_blank"><img src="https://img.shields.io/github/issues/DoiiarX/NLCISBNPlugin.svg"></a> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin/issues?q=is%3Aissue+is%3Aclosed" target="_blank"><img src="https://img.shields.io/github/issues-closed/DoiiarX/NLCISBNPlugin.svg"></a> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin/pulls" target="_blank"><img src="https://img.shields.io/github/issues-pr/DoiiarX/NLCISBNPlugin.svg"></a> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin/pulls?q=is%3Apr+is%3Aclosed" target="_blank"><img src="https://img.shields.io/github/issues-pr-closed/DoiiarX/NLCISBNPlugin.svg"></a> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin" target="_blank"><img src="https://img.shields.io/github/last-commit/DoiiarX/NLCISBNPlugin.svg"></a> | ||
</p> | ||
<p align="center"> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin" target="_blank"><img src="https://visitor-badge.glitch.me/badge?page_id=d2-projects.d2-admin"></a> | ||
<a href="https://github.com/DoiiarX/NLCISBNPlugin/releases" target="_blank"><img src="https://img.shields.io/github/release/DoiiarX/NLCISBNPlugin.svg"></a> | ||
<a href="https://deepscan.io/dashboard#view=project&tid=22929&pid=26210&bid=830826"><img src="https://deepscan.io/api/teams/22929/projects/26210/branches/830826/badge/grade.svg" alt="DeepScan grade"></a> | ||
</p> | ||
|
||
# 中国国家图书馆ISBN Calibre Metadata 源插件 | ||
|
||
该项目是一个用于 [Calibre](https://calibre-ebook.com/) 电子书管理软件的元数据源插件,旨在从[中国国家图书馆](http://opac.nlc.cn/F)获取图书信息,特别是基于ISBN。此插件允许用户轻松地将图书信息添加到其Calibre库中,包括书名、作者、出版日期等重要信息。 | ||
|
||
## 功能特点 | ||
|
||
- **自动元数据检索**:通过ISBN,自动从中国国家图书馆获取图书元数据。 | ||
|
||
## 返回结果示例 | ||
![image](https://github.com/DoiiarX/NLCISBNPlugin/assets/25550075/e6906459-0457-4c8c-a872-d7eda2d8beff) | ||
|
||
**返回项目包括:** | ||
- 书名 | ||
- 标签 | ||
- 作者 | ||
- 简介 | ||
- 出版社 | ||
|
||
其中,标签由**分类**、**图书馆分类号**、**出版年份**组成 | ||
|
||
## 待办事项 | ||
|
||
以下是我们计划在未来添加到插件中的功能: | ||
|
||
- [ ] **更多定制选项**:增加用户可自定义的选项,以提供更多灵活性。 | ||
- [ ] **更好的标题处理**:更好的标题处理。 | ||
- [ ] **模糊搜索**:根据书名模糊搜索。根据isbn搜索isbn相同的多本书籍。 | ||
|
||
## 安装 | ||
|
||
1. 在 [Calibre官方网站](https://calibre-ebook.com/) 上下载并安装Calibre。 | ||
|
||
2. 下载最新版本的 `NLCISBNPlugin` 插件文件。 | ||
|
||
3. 打开Calibre软件,点击 "首选项" > "插件"。 | ||
|
||
4. 在插件界面中,点击 "加载插件从文件中" 按钮,选择之前下载的插件zip文件。 | ||
|
||
5. 安装完成后,启用该插件。 | ||
|
||
## 使用 | ||
|
||
1. 打开Calibre软件。 | ||
|
||
2. 选择您想要更新元数据的电子书。 | ||
|
||
3. 右键单击所选电子书,然后选择 "编辑元数据"。 | ||
|
||
4. 在 "元数据编辑器" 窗口中,点击 "下载元数据"。 | ||
|
||
5. 插件将自动从中国国家图书馆检索并填充图书信息。 | ||
|
||
6. 确认信息无误后,点击 "确定" 保存更新的元数据。 | ||
|
||
## 可能遇到的麻烦 | ||
1. [无法安装插件。报错 It does not contain a top-level init.py file](https://github.com/DoiiarX/NLCISBNPlugin/issues/1) | ||
2. [当单一isbn对应多本书籍时,无法下载元数据](https://github.com/DoiiarX/NLCISBNPlugin/issues/4) | ||
## 贡献 | ||
|
||
如果您发现任何问题或想要改进这个插件,欢迎贡献您的代码。请按照以下步骤进行: | ||
|
||
1. Fork 该仓库。 | ||
|
||
2. 创建一个新的分支,以进行您的改进。 | ||
|
||
3. 提交您的更改并创建一个拉取请求(Pull Request)。 | ||
|
||
4. 我们将会审查您的代码并与您合作以将改进合并到主分支。 | ||
|
||
## 许可证 | ||
|
||
这个项目基于 [Apache 许可证 2.0](LICENSE) 开源,因此您可以自由使用、修改和分发它。 | ||
|
||
--- | ||
|
||
感谢您对中国国家图书馆ISBN Calibre Metadata 源插件的兴趣和支持!如果您有任何问题或建议,欢迎在 GitHub 上的问题部分提出。 | ||
## Star 历史 | ||
[![Stargazers over time](https://starchart.cc/DoiiarX/NLCISBNPlugin.svg)](https://starchart.cc/DoiiarX/NLCISBNPlugin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters