npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yuque-hexo-lyrics

v1.2.2

Published

A downloader for articles from yuque

Downloads

56

Readme

yuque-hexo-lyrics

该项目为 语雀 知识库同步工具,根据指定配置将语雀知识库文档下载到本地。该插件属于二次开发项目,因个人有较高定制化需求,故在原项目( x-cold/yuque-hexo )的 1.7.0 版本基础上重构代码以及需求上的二次开发。

目录

特性

相比原插件增加的功能:

  • 支持语雀多个知识库的下载至指定文件夹
  • 支持加密文章的特殊化处理
  • 无需对语雀文档添加 front-matter 字段,常用字段自动拉取
    • 基本字段:titledateupdated
    • 根据语雀系统自动拉取:urlnameword_countsecretbelong_book
    • 支持语雀系统上文档的目录至 hexo 中的 categories 字段
    • 自定义(eg:tags 语雀文档暂无相关标签字段接口)
  • 支持 hexoMarkdownhexoHtmlmarkdown 三种 format 格式
  • 支持缓存配置
  • ···

命令指南

Install

npm i yuque-hexo-lyrics -g

Clean

yuque-hexo-lyrics clean

Sync

yuque-hexo-lyrics sync

配置指南

TOKEN

拉取语雀上的知识库需要传入环境变量 YUQUE_TOKEN,传入 YUQUE_TOKEN 至本地有以下步骤:

  • 语雀 Token 获取方式:https://www.yuque.com/settings/tokens
  • 设置全局的环境变量 YUQUE_TOKEN
    • 方式一:命令执行时传入环境变量
      • mac / linux: YUQUE_TOKEN=xxx yuque-hexo-lyrics sync
      • windows: set YUQUE_TOKEN=xxx && yuque-hexo-lyrics sync
    • 方式二:直接在系统环境变量中设置

package

package.json

{
  "yuqueConfig": {
    "repos": [
      {
        "login": "wztlink1013",
        "repo": "blog",
        "postPath": "source/blob/",
        "mdNameFormat": "slug",
        "adapter": "hexoHtml",
        "filterLastTimeAfter": "2021-05-01",
        "filterSlugs": ["c47f3d9a749fd0229277f9e9604e69a2"],
        "filterSlugPrefix": "temp_",
        "filterCates": ["Node"],
        "forceDownloadSecret": true
      }
    ]
  }
}

| 一级字段 | 二级字段 | 默认值 | 描述 | | --- | --- | --- | --- | | cache | path | yuque-hexo-lyrics | 缓存文件名 | | repos | baseUrl | https://www.yuque.com/api/v2/ | 语雀 API 地址 | | | login | - | 语雀 login (group), 也称为个人路径 | | | repo | - | 语雀仓库短名称,也称为语雀知识库路径 | | | postPath | source/yuque | 文档同步后生成的路径 | | | mdNameFormat | title | 文件名命名方式 (title / slug) | | | onlyPublished | false | 只展示已经发布的文章 | | | onlyPublic | false | 只展示公开文章 | | | adapter | hexoMarkdown | 文档生成格式 (hexoMarkdown/hexoHtml/markdown) | | | timeout | 200s | 超时时间 | | | concurrency | 5 | 下载文章并发数 | | | filterLastTimeAfter | '' | 指定日期后创建的文章不下载(YYYY-MM-DD) | | | filterSlugs | [] | 过滤文章指定 slug | | | filterSlugPrefix | '' | 按照文章 slug 前缀过滤 | | | filterCates | [] | 过滤指定分类下的文章 | | | forceDownloadSecret | false | 强制下载加密文章 | | | assignSlugs | [] | 指定 slug 不被过滤 优先级高于过滤相关(filter 开头/only 开头)的配置字段 |

slug 是语雀的永久链接名,是几个随机字母和数字的混合字符串。

使用指南

front-matter 配置

  • 插件会自动拉取大多数 Hexo 字段,使得在语雀中写文章不用每次在头部都需要手动写 front-matter,以下字段后续还会扩充
  • 除去大多数上述字段,有少部分字段目前难以适配,比如tagsHexo大多数主题自定义front-matter,语雀系统暂未开放文档的标签相关字段,所以写文章特别注重标签的用户只能以下面方式来添加 front-matter:
---
tags: [hexo, blog]
---

article description

<!-- more -->

article detail

语雀图片存在防盗链问题

https://github.com/wztlink1013/yuque-hexo-lyrics/discussions/10

缓存逻辑

去除原插件的本地缓存文件相关配置,因为当知识库文档数过大,本地缓存 json 文件过大。故改用新一种缓存策略,通过对文件判断更新日期、标题、本地存在与否在进行是否重新下载操作

贡献者列表

contributors

更新日志

CHANGELOG.md

计划列表

https://github.com/wztlink1013/yuque-hexo-lyrics/projects/1

相关链接