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

enjoy-doc

v0.1.1

Published

通过本地文件,网络地址等快速生成文档

Downloads

6

Readme

enjoy doc

通过本地文件,网络地址等快速生成文档

目的

公司的项目中有很多开发相关的文档,之前习惯放gitlab的wiki,效率和体验都不是很好,于是做了这个小工具,目的就是为了方便的组织和查看本地文档。

功能

  • 使用markdown格式
  • 支持自定义目录
  • 支持绝对路径文件内容网络地址三种文件形式

目前的问题:

  • 不支持页内hash导航

安装

本地安装

npm install enjoy-doc

也可以全局

npm install enjoy-doc -g

使用

定义一个导出文档文件的模块

/**
 * docs.js
 */

const path = require('path');

const base = '../js/mlrn/';
const getFilePath = p => path.join(__dirname, base, p);

module.exports = {
  title: 'MED-RN文档',
  nav: [
    {
      text: '首页',
      file: '# MED-RN文档',
      route: '',
    },
    {
      text: '展示组件',
      children: [
        {
          text: 'Header (头部)',
          file: getFilePath('ui/Header/index.md'),
          route: 'ui-Header',
        },
        {
          text: 'FooterButton (底部按钮)',
          file: getFilePath('ui/FooterButton/index.md'),
          route: 'ui-FooterButton',
        },
        {
          text: 'Divider (页面分隔线)',
          file: getFilePath('ui/Divider/index.md'),
          route: 'ui-Divider',
        },
        {
          text: 'EmptyView (空白展示)',
          file: getFilePath('ui/EmptyView/index.md'),
          route: 'ui-EmptyView',
        },
        {
          text: 'Image (图片)',
          file: getFilePath('ui/Image/index.md'),
          route: 'ui-Image',
        },
        {
          text: 'InlineImage (文本图片)',
          file: getFilePath('ui/InlineImage/index.md'),
          route: 'ui-InlineImage',
        },
        {
          text: 'AnimationImageView (帧动画播放)',
          file: getFilePath('ui/AnimationImageView/index.md'),
          route: 'ui-AnimationImageView',
        },
      ],
    },
    {
      text: '表单组件',
      children: [
        {
          text: 'InputItem (文本输入)',
          file: getFilePath('ui/InputItem/index.md'),
          route: 'ui-InputItem',
        },
        {
          text: 'Radio (单选框)',
          file: getFilePath('ui/Radio/index.md'),
          route: 'ui-Radio',
        },
        {
          text: 'SearchInputWithClear (搜索框)',
          file: getFilePath('ui/SearchInputWithClear/index.md'),
          route: 'ui-SearchInputWithClear',
        },
        {
          text: 'SidePickerView (侧边选择器)',
          file: getFilePath('ui/SidePickerView/index.md'),
          route: 'ui-SidePickerView',
        },
      ],
    },
    // ...
  ],
};

添加一个命令

"doc": "enjoy-doc ./docs.js --port=4000"

然后使用命令打开

npm run doc

命令参数

enjoy-doc file --port=4000
  • file 配置文件
  • --port 运行的端口

配置说明

  • title: 标题
  • nav: 导航路径

nav配置:

  • text: 标题,必填
  • file: 文件,支持传入绝对路径文件内容网络地址三种
  • route: 路由的唯一名称,可选,如果不传,则不可选中
  • children: 子导航配置,同nav

TODO

  • 支持文档内的hash导航