From 34997f58aa1ff3d5ab28bb538e0c174d2e2552b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92=E8=B5=AB=E8=90=9D?= Date: Mon, 17 Apr 2023 22:21:33 +0800 Subject: [PATCH] :pencil: Docs: update typora 1.6.0-dev support --- README.md | 11 +++++++++++ README_en.md | 12 ++++++++++++ src/main/utils/pasteTemplate.ts | 7 ++++--- src/renderer/pages/TrayPage.vue | 7 ++++--- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bb242c6..6ffc996 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,17 @@ PicList的内核使用的是原版PicGo-Core基础上修改的[PicList-core](htt ### 如何在Typora中使用 +#### **1.6.0版本及以上** + +**Typora 1.6.0-dev以及以上版本现在已经原生支持PicList了** + +下载地址: + +[Windows 版本](https://download.typora.io/windows/typora-setup-x64-1.6.0-dev.exe "windows") +[Mac OS版本](https://download.typora.io/mac/Typora-1.6.0-dev.dmg "macOS") + +#### 1.6.0版本以下 + Windows: 进入Typora设置界面,选择图像,将上传服务设置为 `PicGo(app)`,然后在 `PicGo路径`中填写PicList的安装路径,如下图所示: diff --git a/README_en.md b/README_en.md index dc5dd97..87248bb 100644 --- a/README_en.md +++ b/README_en.md @@ -42,6 +42,18 @@ if you want to use PicList-core, please go to [https://github.com/Kuingsmile/Pic ### How to use in Typora +#### **Version 1.6.0-dev and above** + +**Typora 1.6.0-dev and above versions now support PicList natively** + +download link: + +[Windows Version](https://download.typora.io/windows/typora-setup-x64-1.6.0-dev.exe) + +[Mac OS Version](https://download.typora.io/mac/Typora-1.6.0-dev.dmg) + +#### **Version < 1.6.0-dev** + Windows: Enter the Typora settings page, select the image, set the upload service to `PicGo(app)`, and then fill in the installation path of PicList in `PicGo path`, as shown below: diff --git a/src/main/utils/pasteTemplate.ts b/src/main/utils/pasteTemplate.ts index 2655252..f31cc40 100644 --- a/src/main/utils/pasteTemplate.ts +++ b/src/main/utils/pasteTemplate.ts @@ -30,15 +30,16 @@ export default async (style: IPasteStyle, item: ImgInfo, customLink: string | un if (useShortUrl) { url = await generateShortUrl(url) } - const copyedItem = JSON.parse(JSON.stringify(item)) - copyedItem.url = url const _customLink = customLink || '![$fileName]($url)' const tpl = { markdown: `![](${url})`, HTML: ``, URL: url, UBB: `[IMG]${url}[/IMG]`, - Custom: formatCustomLink(_customLink, copyedItem) + Custom: formatCustomLink(_customLink, { + ...item, + url + }) } return tpl[style] } diff --git a/src/renderer/pages/TrayPage.vue b/src/renderer/pages/TrayPage.vue index 4a4c68b..8dec694 100644 --- a/src/renderer/pages/TrayPage.vue +++ b/src/renderer/pages/TrayPage.vue @@ -130,8 +130,6 @@ async function pasteTemplate (style: IPasteStyle, item: ImgInfo, customLink: str if (useShortUrl) { url = await ipcRenderer.invoke('getShortUrl', url) } - const copyedItem = JSON.parse(JSON.stringify(item)) - copyedItem.url = url notification.body = url const _customLink = customLink || '![$fileName]($url)' const tpl = { @@ -139,7 +137,10 @@ async function pasteTemplate (style: IPasteStyle, item: ImgInfo, customLink: str HTML: ``, URL: url, UBB: `[IMG]${url}[/IMG]`, - Custom: formatCustomLink(_customLink, copyedItem) + Custom: formatCustomLink(_customLink, { + ...item, + url + }) } return tpl[style] }