From c0ab2a2719073fe054529ad8455b7ef3834e744e Mon Sep 17 00:00:00 2001 From: Dai Niu <1244453736@qq.com> Date: Fri, 15 May 2020 14:16:05 +0800 Subject: [PATCH] 0.4 released --- release_notes/0.4.0.md | 55 +++++++++++++++++++++++++++++++++ src/lang/completion-provider.ts | 5 ++- src/service/publish.service.ts | 1 + 3 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 release_notes/0.4.0.md diff --git a/release_notes/0.4.0.md b/release_notes/0.4.0.md new file mode 100644 index 0000000..f9261e2 --- /dev/null +++ b/release_notes/0.4.0.md @@ -0,0 +1,55 @@ +#! https://zhuanlan.zhihu.com/p/141107340 + +![Image](https://pic4.zhimg.com/80/v2-0c8e73a2a092ed3686d2fddfcfe93f1a.png) + +# 在 VSCode 里用微信登录知乎是什么体验 + +### *Zhihu On VSCode* 现在支持微信登录啦! + +在最新版 *Zhihu On VSCode 0.4* 中,知乎er 可以选择使用微信 APP 扫码登录,只需保证知乎账号和微信账号绑定,即可打开微信 APP 扫一扫: + +![Image](https://pic4.zhimg.com/80/v2-8408ca3963bc92635277a4273c631e76.png) + +> *Zhihu On VSCode* 为什么不支持账号密码登录了? + +答: + +因为账号密码登录安全性不好,现在已经支持了知乎 APP 和 微信 APP 的扫码登录,已经足够方便。 + +### 在 VSCode 里面 @ 你想 @ 的 Zhihuer! + +该版本中,用户可以直接在 Markdown 文本里面 @ 知乎er 啦,只需要输入 @,弹出提示,点击回车: + +![Image](https://pic4.zhimg.com/80/v2-093163b4907692447791cdeefc70426e.png) + +![Image](https://pic4.zhimg.com/80/v2-9060706cd61673d83e56f0bd38a1f6bb.png) + +![Image](https://pic4.zhimg.com/80/v2-b4c1b8ff1cd34657552f3640edb24124.png) + +选择后,会自动生成 @ 链接,无需手动管理。 + +### 可以使用链接卡片啦! + +知乎的链接可以变成卡片,只需在链接后面加入 *"card"* 即可: + +![Image](https://pic4.zhimg.com/80/v2-4ba858842c81a7774c8891ec755867fb.png) + +发布后: + +![Image](https://pic4.zhimg.com/80/v2-2b11de9d069601b95cf67c631082f7c1.png) + +### 可以添加图片描述啦! + +![Image](https://pic4.zhimg.com/80/v2-382d5746fd25e675a608bb6281cd7753.png) + +发布后: + +![Image](https://pic4.zhimg.com/80/v2-6b7730e332dc14821bc431f038ae6d4e.png) + +记得去小岱的[项目仓库](https://github.com/niudai/VSCode-Zhihu)打颗 ⭐ 哦! + +关注项目作者 [@牛岱](https://zhuanlan.zhihu.com/p/107839880)。 + +> 声明:该项目为非官方,非盈利的开源软件,目的在于帮助创作者更稳定地输出高质量内容。 + + diff --git a/src/lang/completion-provider.ts b/src/lang/completion-provider.ts index 5959122..054837e 100644 --- a/src/lang/completion-provider.ts +++ b/src/lang/completion-provider.ts @@ -1,7 +1,6 @@ import * as vscode from "vscode"; -import { sendRequest } from "../service/http.service"; import { AtAutoCompleteURL } from "../const/URL"; -import { Output } from "../global/logger"; +import { sendRequest } from "../service/http.service"; @@ -54,7 +53,7 @@ export async function AtPeople() { * ] */ const selectedPeople: any[] = await vscode.window.showQuickPick( - respArray.map(item => ({ user: item, id: item[2], label: item[1], description: item[5] })), + respArray.slice(1).map(item => ({ user: item, id: item[2], label: item[1], description: item[5] })), { placeHolder: "选择你想要的结果:" } ).then(r => r ? r.user : undefined); if (!selectedPeople) return diff --git a/src/service/publish.service.ts b/src/service/publish.service.ts index 38571e1..344f07e 100644 --- a/src/service/publish.service.ts +++ b/src/service/publish.service.ts @@ -94,6 +94,7 @@ export class PublishService { // get rid of shebang line if (url) text = text.slice(text.indexOf('\n') + 1); + text = ">本文使用 [Zhihu On VSCode](https://zhuanlan.zhihu.com/p/106057556) 创作并发布\n\n" + text; // let html = this.zhihuMdParser.render(text); let tokens = this.zhihuMdParser.parse(text, {}); // convert local and outer link to zhihu link