📝 Docs: update typora 1.6.0-dev support

This commit is contained in:
萌萌哒赫萝 2023-04-17 22:21:33 +08:00
parent 72c9374a26
commit 34997f58aa
4 changed files with 31 additions and 6 deletions

View File

@ -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的安装路径如下图所示

View File

@ -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:

View File

@ -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: `<img src="${url}"/>`,
URL: url,
UBB: `[IMG]${url}[/IMG]`,
Custom: formatCustomLink(_customLink, copyedItem)
Custom: formatCustomLink(_customLink, {
...item,
url
})
}
return tpl[style]
}

View File

@ -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: `<img src="${url}"/>`,
URL: url,
UBB: `[IMG]${url}[/IMG]`,
Custom: formatCustomLink(_customLink, copyedItem)
Custom: formatCustomLink(_customLink, {
...item,
url
})
}
return tpl[style]
}