GithubHelp home page GithubHelp logo

wisinfun / alfred-workflow-yuque Goto Github PK

View Code? Open in Web Editor NEW
11.0 0.0 1.0 3.07 MB

在 Alfred 中快速搜索语雀文档、浏览器打开文档、复制文档链接、切换文档的分享状态

alfred alfred-workflow workflow yuque

alfred-workflow-yuque's Introduction

语雀搜索-yuque-Alfred-Workflow-使用说明

Uses alfy by sindresorhus ,需要 Node.js 14+ 和 Alfred 5 Powerpack

简介

在 Alfred 中快速搜索语雀文档、浏览器打开文档、复制文档链接、切换文档的分享状态

  • 快速搜索:打开 Alfred 搜索框,输入 yq + 空格 + 关键词
  • 复制链接:快捷键 ⌘ + CEnter
  • 预览文档:快捷键 ⌘ + Y,tips:适用于公开的文档,预览时可以复制文档中的内容
  • 浏览器打开:⌘ + Enter
  • 浏览器打开并进入编辑模式:⌘ + ⇧ + Enter
  • 切换文档分享状态:快捷键 ⇧ + Enter(显示有 🌎 的为已分享状态)

配置步骤

  1. 安装 Node.js

    Node 官网下载安装,也可以使用 Homebrew 安装.

    brew install node
  2. Release 页下载最新版本 workflow 并安装

  3. 在语雀中获取 Access Token

    打开语雀 → 点击头像 → 账户设置 → Token → 新建 → 授权范围全部勾选并创建 → 复制获取到的 Access Token 到Alfred的配置页 ① 中

    57F1B597-CEE2-4EED-8AC1-887E52762D8D

  4. 从浏览器控制台获取 cookiex-csrf-token(不需要分享功能可跳过)

    打开一遍未分享过的文档 → 打开控制台 → 点击页面上的分享按钮并打开分享开关 → 控制台中切换到网络 → 在网络中找到 meta 记录 → 找到 cookiex-csrf-token → 复制冒号后面的内容到Alfred的配置页 ②③ 中

    786FE528-C884-4D4A-B2A6-A825353BD1A4

  5. 配置相关参数

    7103F5EE-FB79-44F2-A173-9E3BD4A534EF

alfred-workflow-yuque's People

Contributors

wisinfun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

just-wkj

alfred-workflow-yuque's Issues

增加单个知识库的改动

因为没有办法提到一个pr给你,就提个issues给你了
index.js

const scope = process.env.namespace || undefined
const params = new URLSearchParams({
    q: alfy.input,
    type: 'doc',
    related: true,
    scope
})
//请求语雀搜索
const data = await alfy
  .fetch(`${urlBegin}/api/v2/search?${params}`, {
    method: 'GET',
    headers: headersList
  })
  .then(function (datas) {
    return datas.data
  })

info.plist

<dict>
	<key>config</key>
	<dict>
		<key>default</key>
		<string></string>
		<key>placeholder</key>
		<string></string> 
		<key>required</key>
		<false/>
		<key>trim</key>
		<true/>
	</dict>
	<key>description</key>
	<string>知识库的路径</string>
	<key>label</key>
	<string>知识库路径</string>
	<key>type</key>
	<string>textfield</string>
	<key>variable</key>
	<string>namespace</string>
</dict>

增加指定知识库搜索

在实际应用中,一个企业会有多个团队,这样就开了很多的一些知识库。但是常用的话其实只有自己的团队知识库,所以能不能只搜索某个知识库,或者某几个
image

node 报错

HTTPError: Response code 401 (Unauthorized)
    at Request.<anonymous> (file:///Users/miotlink/Library/Application%20Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.10BC0773-BBC3-4B63-A4B8-F9116E04BA63/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Request._onResponseBase (file:///Users/miotlink/Library/Application%20Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.10BC0773-BBC3-4B63-A4B8-F9116E04BA63/node_modules/got/dist/source/core/index.js:704:22)
    at async Request._onResponse (file:///Users/miotlink/Library/Application%20Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.10BC0773-BBC3-4B63-A4B8-F9116E04BA63/node_modules/got/dist/source/core/index.js:743:13)

语雀 1.6
Alfred 5.5
darwin 23.4.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.