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

wedoc

v0.0.16

Published

A Vue.js project

Downloads

64

Readme

关于

一个基于 Vue 的简单易用的网页文档生成工具

使用

安装

  npm install wedoc

生成默认配置

 wedoc init --config ./doc.config.js --docs ./packages,./components --async

生成网站代码

 wedoc init --config ./doc.config.js --docs ./packages,./components --out ./dist --async

配置

  • 命令

    • init 根据参数初始化配置文件
    • run <build | watch> 生成文档网站
  • 参数

    | 名称 | 类型 | 描述 | | ------ | ------- | ------------------------------------------------------------------------- | | docs | Array | 文档目录位置,多个目录用逗号分隔 | | config | String | 配置文件位置 | | out | String | 网站输出目录 | | async | Boolean | 文档加载方式,true 使用 import 加载文档内容;false 则使用 require |

  • 另一种方式在运行命令的目录中创建 wedoc.jswedoc.json

    | 名称 | 类型 | 描述 | | --------------- | -------- | --------------------------------------------------------------------------- | | docs | Array | 文档目录位置,多个目录用逗号分隔 | | config | String | 配置文件位置 | | out | String | 网站输出目录 | | async | Boolean | 文档加载方式,true 使用 import 加载文档内容;false 则使用 require | | markdown | Object | 对于文档在转换为 HTML 时的操作 | | markdown.before | Function | 对于文档在转换为 HTML 时的前置操作,参数为文档文本,上下文为 webpack 实例 | | markdown.after | Function | 对于文档在转换为 HTML 时的后置操作,参数为 HTML 文本,上下文为 webpack 实例 | | webpack | Object | webpack 配置 |

async 为 true 时可以从 markdown 文件中读取标题作为侧边栏菜单,否则使用文件夹名称或文件名称作为侧边栏菜单

  • 配置文件 - doc.config.js

文档配置,因为配置需要用到 require 或 import,所以需要使用 js, 而不是 json。

| 字段 | 类型 | 含义 | | ----------------------- | ------ | ------------------------------------------------------ | | docs | Object | 文档内容和结构配置 | | name | String | 网站 title,默认为 header.logo.title | | docs.base | String | 文档根路由 | | docs.default | String | 文档首页 | | docs.include | Object | markdown 文档集合 | | docs.category | Array | 文档分类 | | docs.category[].base | String | 分类子路由 | | docs.category[].babel | String | 分类名称 | | docs.category[].include | Object | markdown 文档集合 | | header | Object | 默认使用 vant-doc 配置 | | footer | Object | 默认使用 vant-doc 配置 | | lang | Object | 多语言支持,使用改属性,前面的属性必须作为该属性的属性 | | plugins | Array | 自定义的 vue 组件,支持在 markdown 中使用自定义的组件 |

多语言支持可以设置 lang 字段,

/* eslint-disable */
module.exports = {
  plugins: [require('~PATH~/zanui-weapp/website/plugins/wxapp-demo')],
  lang: {
    en: {
      docs: {
        base: 'zanui',
        category: [
          {
            base: 'base',
            label: '基础',
            include: {},
          },
          {
            base: 'layout',
            label: '布局',
            include: {},
          },
        ],
        include: {},
      },
    },
    'zh-cn': {
      name: 'ZanUI 小程序',
      header: {
        logo: {
          image:
            'https://img.yzcdn.cn/public_files/2017/12/18/fd78cf6bb5d12e2a119d0576bedfd230.png',
          title: 'ZanUI 小程序',
          href: 'http://www.youzanyun.com/zanui',
        },
        nav: {
          lang: {
            text: 'En',
            from: 'zh-CN',
            to: 'en-US',
          },
          github: 'https://github.com/youzan/zanui-weapp',
        },
      },
      footer: {
        github: 'https://github.com/youzan/zanui-weapp',
        nav: {
          'React 组件库': 'https://www.youzanyun.com/zanui/zent',
          'Vue 组件库': 'https://www.youzanyun.com/zanui/vant',
          意见反馈: 'https://github.com/youzan/zanui-weapp/issues',
          开发指南:
            'https://github.com/youzan/zanui-weapp/blob/dev/.github/CONTRIBUTING.zh-CN.md',
          加入我们: 'https://job.youzan.com',
        },
      },
      docs: {
        base: 'zanui',
        default: 'intro',
        category: [
          {
            base: 'base',
            label: '基础',
            include: {
              intro: require('~PATH~/intro.md'),
            },
          },
          {
            base: 'layout',
            label: '布局',
            include: {},
          },
        ],
        include: {},
      },
    },
  },
};

改进

  • watch 目录的变化
  • 同一目录支持多个文档