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

quick-reference

v1.0.3

Published

[![build status](https://img.shields.io/travis/be-fe/quick-reference/master.svg?style=flat-square)](https://travis-ci.org/be-fe/quick-reference) [![Test coverage](https://img.shields.io/codecov/c/github/be-fe/quick-reference.svg?style=flat-square)](https:

Downloads

6

Readme

quick-reference

build status Test coverage NPM version NPM Downloads

一种快速引用 markdown 资源(markdown、图片)的方式。

为什么

在层级深的 markdown 文档结构中,如下

testdocs/
├── fsssww.md
├── imgs/
│ └── Edam.png
├── index.md
├── nodejs/
│ ├── fs.md
│ ├── index.md
│ └── module.md
├── test.md
├── test2.md
├── testss.md
├── 团队项目/
│ ├── cookbook/
│ │ ├── cookbook-v1.md
│ │ └── index.md
│ └── release-scripts/
│ └── index.md
├── 工具链/
│ └── docker/
│ └── docker.md
└── 技术栈/
├── avalon.md
└── avalon 监控属性的坑.md

我们在写一篇文章 A 的时候,想去引用(Reference)该文档中的其他文档或图片,我们需要去一层层 ../ 找到对应的目录,这样引用资源繁琐。

于是便有了 quick-reference 的用武之地,quick-reference 主张扁平文件结构,在以上层级较深的结构中,会被扁平化为:

fsssww
Edam.png
index
nodejs
fs
module
test
test2
testss
cookbook
cookbook-v1
release-scripts
docker
avalon
avalon 监控属性的坑

我们可以用过下面的方式来指定扁平效果下的唯一 id

可以在文章头部指定 permalink:

---
permalink: hssss
---

如果 permalink 未被指定的话,将会使用文件名作为 permalink, 如 fs.md 被认为是 fs,同时 nodejs/index.md 中的 index.md 的 permalink 会被认为为 nodejs

说明

有了上面的扁平文件的概念之后,通过下面的语法

@link:premalink@  
@link:[title]premalink@
@img:premalink@
@img:[title]premalink@

会自动转换成对应 permalink 的资源,link 转换为[...](...),img 转换为![](...)

效果如图展示:

使用

npm install quick-reference -g

安装后,新增了 2 个命令 quick-ref-watchquick-ref.

安装后,在项目的 package.json 中配置 (使用cosmiconfig)

"quick-reference": {
  "docRoot": "path/to/docroot"
}
# 开启文件监听服务,`-o` 表示覆写改动的文件,默认不开启
quick-ref-watch -o

# 同时可以不使用文件监听进程`-o`标志
# 使用 quick-ref 进行转换亦可
quick-ref <...md files>

怎么工作的?

戳这里

推荐的使用姿势

在开启了 quick-ref-watch 服务(不开启-o)后,在 IDE 中配置 quick-ref 进行 markdown 转换。

下面介绍在不同 IDE 中 quick-ref 的使用方式。

WebStorm JetBrain

方式一 (External Tools,快捷键触发)

  • Preferences - External Tools

  • New Tool

  • Enable quick-reference, and apply the setting.

  • Set Keymap for run quick-reference

方法二(File Watcher,监控文件修改自动执行)