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

@vsmi/api-docs

v0.0.15

Published

a simple docs from markdown

Downloads

27

Readme

文档使用指南

一个简单的基于markdown的文档生成工具,支持JS代码转换执行,生成静态站点

npm node deps tests prs code style: prettier

开始使用

安装依赖

npm i @vsmi/md-loader @vsmi/api-docs @vsmi/docs-generator --save-dev

添加文档配置


const path = require('path');
module.exports = {
  // 文档标题、logo信息
  inject: {
    title: '微风开发文档',
    logo: '',
  },
  // 配置文档扫描的基准目录,控制到最小,降低信息消耗
  cwd: path.resolve(__dirname, './src'),
  // 文档入口路由信息
  groups: [
    {
      // 排序,越小越靠前
      order: 2,
      // 用于显示标题
      title: '组件',
      // 分组路由
      route: '/components',
      // 分组路由对应的文档目录(相对于 cwd)
      basePath: './components',
    },
  ],
  // 文档开发端口,默认为 8020
  port: 9001,
  // webpack 配置处理
  webpack(config) {
    
  }
};

运行脚本

在 package.json中添加script

{
  "scripts": {
    "docs:start": "hp-docs start",
    "docs:build": "hp-docs build"
  }
}

开发阶段

默认会打开一个开发服务器

npm run docs:start

生成静态端点

生成到 sites 目录

npm run docs:build

文档编写

其中头部信息为文档生成提供元信息,以三个hr 标记分开;

| 属性 | 必填 | 类型 | 描述 |默认值 | | ----- | ---- | ------ | ------- |------- | | title | yes | string | 显示的标题信息 | - | | cate | no | string | 为当前文档所属分组, 不存在时则显示为根目录 |- | | order | no | number | 文档目录的顺序,越小越靠前 |- | | toc | yes | boolean | 控制是否文档显示在目录中 |false | | only | yes | boolean | 不解析代码块 |false |

---
order: 2
cate: 基本使用
title: 测试DEMO
toc: false
timeline: true

---
这是一个基本描述信息, 哈哈~~

---

正文信息....
正文信息....
正文信息....

LICENSE

MIT