From c6c157cf0bbc07764ab0163f6bbb9ddec62ef4d2 Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 24 May 2023 01:26:44 +0800 Subject: [PATCH 1/4] docs: update docs --- README.md | 12 +++++++++++- README_zh_CN.md | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b06b64..980cdc3 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,17 @@ Import epub, docx, html, etc. into Siyuan notes. Currently supported formats: .e After the installation is complete, find the `Importer` icon on the top right toolbar, and click to follow the pop-up window. ## Changelog - +**v1.5.1 major update** + +### Features and bug fixes +* [#33](https://github.com/terwer/siyuan-plugin-importer/issues/33) Support batch import of selected directories ([2e58a37](https://github.com/terwer/siyuan-plugin-importer/commit/2e58a37cc833061b8d12f1c9be96ad72a2df98f2)) +* [#38](https://github.com/terwer/siyuan-plugin-importer/issues/38) line break problem([74c00c0](https://github.com/terwer/siyuan-plugin-importer/commit/74c00c095aae20077b7a79709c2d2721859f947e)) +* Uninstall does not delete configuration ([a913034](https://github.com/terwer/siyuan-plugin-importer/commit/a9130349120f03e2705d886de9d3a470fa019513)) +* Support manual cleaning of temporary files ([5687248](https://github.com/terwer/siyuan-plugin-importer/commit/5687248f1aae2629ced3171f4b15f2def9babca0)) +* Support md file import, md does not need to be converted, other formats, convert first, then import +### Development refactoring +* Move the i18n folder to the src directory ([0234c50](https://github.com/terwer/siyuan-plugin-importer/commit/0234c509a2dbadf851bce73ddc961c305cded145)) +* **v1.5.0 major update** - Solve the problem that after importing epub, the pictures in it will appear in the unreferenced resources, which are easy to be cleared by mistake. Now after the document is imported, the resource files will not appear in the unreferenced ones. Unreferenced resources are visible after the document is deleted. diff --git a/README_zh_CN.md b/README_zh_CN.md index 2ee83bc..e1bc924 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -20,6 +20,16 @@ 安装完成后,在顶部右侧工具栏找到 `导入工具` 图标,点击按照弹窗操作即可。 ## 更新历史 +**v1.5.1 主要更新** + +### 特性和问题修复 +* [#33](https://github.com/terwer/siyuan-plugin-importer/issues/33) 支持选择目录批量导入 ([2e58a37](https://github.com/terwer/siyuan-plugin-importer/commit/2e58a37cc833061b8d12f1c9be96ad72a2df98f2)) +* [#38](https://github.com/terwer/siyuan-plugin-importer/issues/38) 换行符问题 ([74c00c0](https://github.com/terwer/siyuan-plugin-importer/commit/74c00c095aae20077b7a79709c2d2721859f947e)) +* 卸载不删除配置 ([a913034](https://github.com/terwer/siyuan-plugin-importer/commit/a9130349120f03e2705d886de9d3a470fa019513)) +* 支持手动清理临时文件 ([5687248](https://github.com/terwer/siyuan-plugin-importer/commit/5687248f1aae2629ced3171f4b15f2def9babca0)) +* 支持md文件导入,md无需转换,其他格式,先转换,后导入 +### 开发重构 +* i18n文件夹移动到src目录 ([0234c50](https://github.com/terwer/siyuan-plugin-importer/commit/0234c509a2dbadf851bce73ddc961c305cded145)) **v1.5.0 主要更新** From 38a29729b76c477d217e01d2770ccc4da793944d Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 24 May 2023 01:31:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20hash=E8=B7=AF=E5=BE=84=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/kernel-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/kernel-api.ts b/src/api/kernel-api.ts index a7366c4..ebcca4d 100644 --- a/src/api/kernel-api.ts +++ b/src/api/kernel-api.ts @@ -113,7 +113,7 @@ class KernelApi extends BaseApi { */ public async convertPandoc(type: string, from: string, to: string): Promise { const args = { - args: ["--to", type, from, "-o", to, "--extract-media", `${mediaDir}/${shortHash(from)}`, "--wrap=none"], + args: ["--to", type, from, "-o", to, "--extract-media", `${mediaDir}/${shortHash(from).toLowerCase()}`, "--wrap=none"], } return await this.siyuanRequest("/api/convert/pandoc", args) } From febfedfd9aebda8cbce2777250b54011a39d69a6 Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 24 May 2023 01:42:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20hash=E8=B7=AF=E5=BE=84=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/kernel-api.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/api/kernel-api.ts b/src/api/kernel-api.ts index ebcca4d..0486e22 100644 --- a/src/api/kernel-api.ts +++ b/src/api/kernel-api.ts @@ -113,7 +113,16 @@ class KernelApi extends BaseApi { */ public async convertPandoc(type: string, from: string, to: string): Promise { const args = { - args: ["--to", type, from, "-o", to, "--extract-media", `${mediaDir}/${shortHash(from).toLowerCase()}`, "--wrap=none"], + args: [ + "--to", + type, + from, + "-o", + to, + "--extract-media", + `${mediaDir}/${shortHash(from).toLowerCase()}`, + "--wrap=none", + ], } return await this.siyuanRequest("/api/convert/pandoc", args) } From 508999d5cb01246a69c2c979f08f370933cc4630 Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 24 May 2023 10:00:49 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E6=96=B0=E5=A2=9E=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=EF=BC=8C=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E6=B8=85=E9=99=A4=E4=B8=B4=E6=97=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/en_US.json | 1 + src/i18n/zh_CN.json | 1 + src/lib/ImportForm.svelte | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index 134b5c7..042a436 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -29,5 +29,6 @@ "cleanTemp": "clean up temporary files", "clean": "Delete", "tempCount": "temporary files", + "tempCountExists": "Please clean up the temporary files before batch import", "supportedTypes": "Currently supported formats: .epub, .docx, .html, .opml" } \ No newline at end of file diff --git a/src/i18n/zh_CN.json b/src/i18n/zh_CN.json index ede849b..df9ec3c 100644 --- a/src/i18n/zh_CN.json +++ b/src/i18n/zh_CN.json @@ -29,5 +29,6 @@ "cleanTemp": "清理临时文件,共", "clean": "删除", "tempCount": "个临时文件", + "tempCountExists": "请先清理临时文件在进行批量导入", "supportedTypes": "目前支持的格式:.md, .epub, .docx, .html, .opml" } \ No newline at end of file diff --git a/src/lib/ImportForm.svelte b/src/lib/ImportForm.svelte index db90271..1f66a54 100644 --- a/src/lib/ImportForm.svelte +++ b/src/lib/ImportForm.svelte @@ -134,6 +134,12 @@ // 批量转换开始 // ================= const selectFolder = async () => { + // 批量导入之前先清空临时文件 + if (tempCount > 0) { + showMessage(`${pluginInstance.i18n.tempCountExists}`, 1000, "error") + return + } + const result = await window.showDirectoryPicker() dialog.destroy()