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 🙏

© 2025 – Pkg Stats / Ryan Hefner

knowpedia

v1.1.0

Published

为Quick-Paper提供书籍编辑常用插件库。

Readme

knowpedia

为Quick-Paper提供书籍编辑常用插件库。

Issues

使用的时候遇到任何问题或有好的建议,请点击进入issue

How to use?

本项目是为Quick Paper提供的一些插件库,下面的一些你在使用Quick-Paper可用的扩展功能。

在说明具体的插件之前,先来补充一下babel打包相关的问题。

如果你使用webpack配合babel进行项目打包,由于部分包采用了let等es6+语法,为了可以正常打包,你需要修改webpack的配置,参考如下:

......
rules: [{
    test: /\.js$/,
    exclude: function (modulePath) {
        return (
            /node_modules/.test(modulePath) &&
            !/knowpedia/.test(modulePath)
        );
    },
    loader: "babel-loader"
},
......

其次,请确保你使用了babel.config.js而不是.babelrc,否则较高版本的babel可能依旧不会对你忽略的node_modules中的包进行转义。

数学公式

import QuickPaper from 'quick-paper';
import mathFormula from 'knowpedia/mathFormula';

QuickPaper.use(mathFormula);

引入并use后即可使用。

首先,你需要在数据中定义公式,语法如下:

data(){
    return {
        mathFormulas:{}
    };
},
 mounted() {
    this.mathFormulas = {
        // 返回的类型是公式对象
        <形参>: this.$mathFormula.<公式生成方法>(公式对象或字符串,......)
    };
},

然后,你可以在页面中借助指令显示出来了:

<span kp-math-formula="mathFormulas.<形参>"></span>

下面列举出所有『公式生成方法』:

  • 拼接
// 从左到右,拼接起来
this.$mathFormula.join(...p);
  • 根号
this.$mathFormula.gen(p1);
  • 极限
// p1表示趋向,p2是计算结果的表达式
this.$mathFormula.limt(p1, p2);
  • 求和
// p1表示开始,p2是结束的值,p3是需要求和的表达式
this.$mathFormula.sum(p1, p2, p3);
  • 矩阵和行列式
// 第一个参数是一个二维数组
// 第二个参考默认false,表示矩阵,可选,如果是true,表示行列式
this.$mathFormula.matrix(p1, p2);
this.$mathFormula.division(p1, p2);
  • 括号
// p2表示括号的类型,可选的有:
// small、middle、big,分别表示,小括号、中括号、大括号
this.$mathFormula.bracket(p1, p2);
  • 特殊位置
this.$mathFormula.rightTop(p1, p2);// p2在右上角
this.$mathFormula.rightBottom(p1, p2);// p2在右下角
  • 方程组
this.$mathFormula.equationSet(...p);
  • 上下线
this.$mathFormula.upLine(p1);// p1上面有线条
this.$mathFormula.downLine(p1);// p1下面有线条
  • 绝对值
this.$mathFormula.absoluteValue(p1);
  • 定积分和不定积分
// p1是表达式,p2表示对谁积分
// p3和p4可选,表示定积分积分范围(下、上)
this.$mathFormula.integral(p1, p2, p3, p4);
  • 可列交和可列并
this.$mathFormula.listedAnd(p1, p2); // 可列交
this.$mathFormula.listedOr(p1, p2); // 可列并

开源协议

MIT

Copyright (c) 2021 hai2007 走一步,再走一步。