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

@fantasticit/docbook

v1.4.3

Published

A lib for build doc site

Downloads

68

Readme

docbook

docbook 致力于静态文档站快速生成。

  • 强约定使用 docs 下文件生成文档
  • 默认支持 Service Work
  • 支持 PWA,通过 config.manifest 配置

安装

全局安装

npm i -g @fantasticit/docbook

项目中使用

npm i -D @fantasticit/docbook

在项目中撰写 docs 内容,在 package.json 中加入如下 scripits

{
  "doc:dev": "docbook dev",
  "doc:build": "docbook build"
}

执行 npm run doc:dev 即可打开文档站。

配置

通过 docs/config.js 指定文档配置。

  • icon: favicon 配置
  • title: 文档站标题
  • logo: Logo 配置,支持 HTML 字符串
  • github: github 地址,配置后将在网页右上角添加 github 图标
  • js: 需要额外注入的 js 资源地址,形如:["https://www.qcharts.cn/qcharts.js"],同时注入到编辑器,编辑器中也可使用
  • toc: 是否为文章开启目录
  • navs: 文档站头部导航,形如:[{title: '首页', path: '/home' },]
  • renderFooter: 正文底部渲染函数,注意类型是函数,不配置不渲染底部
  • manifest: PWA manifest 清单配置(请将资源放置在 docs/assets

开发配置:

  • port: 本地开发端口,默认 9090
  • debug: 是否开启调试模式,默认 false
  • outputDir: 文档编译输出目录,默认 docs-build

文档撰写

docbook 支持 .vue.md 两种格式文档。支持属性如下:

  • title: 文件名称配置,字符串
  • index: 文件索引,数字

.vue 格式

在 vue 文件 script 部分添加 titleindex 属性配置形如:

<template></template>

<script>
export default {
  title: '文档',
  index: 0,
};
</script>

<style lang="scss" scoped></style>

.md 格式

在 md 文件中添加 titleindex 属性配置形如:

---
title: '文档'
index: 1
---

<!-- 以下为正文 -->

其他

  1. PWA 所需图片大小

Android:

icon-72x72
icon-96x96
icon-128x128
icon-144x144
icon-152x152
icon-192x192
icon-384x384
icon-512x512

iOS:

icon-120x120
icon-180x180