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

gitbook-plugin-gtoc

v0.2.0

Published

Get content of Gitbook

Downloads

4

Readme

GitBook Table Of Content Plugin

为GitBook生成目录结构,效果如下:

gtoc效果图

使用方式

book.json中添加如下配置: { "plugins": ["gtoc"] }

然后运行gitbook install即可。

功能

  • 抽取页面标题组成目录列表
  • 自动添加序号
  • 可隐藏GTOC
  • 回到顶部功能,可配置是否有“电梯”效果
  • 适配Gitbook的“Sepia”、“Night”主题
  • 抽离出配置项,提供

快捷键

【t】:收缩/展现目录

【h】:显示/隐藏目录

说明

  • 默认只抽取h2,h3标题
  • 默认进入页面就显示(后期会修改默认隐藏)

TODO

  • 需要有本地存储功能,记忆上次用户阅读的位置,可配置此功能【2014.12.23】
  • 需要抽取出配置项【2014.12.23】
  • 适应不同主题下的样式(比如夜间模式等等)【20141219】
  • 添加滚动高显功能,电梯功能【20141219】
  • 功能的模块化【20141219】
  • 绑定快捷键't',用于toggle显示/隐藏【20141218】
  • 手柄hover状态时,需显示提示文字【20141218】
  • 添加“回到顶部”【20141218】
  • 配置:【20141218】
    • 抽取层级
    • 放在左边还是右边
    • 跟随还是放在开头(跟随的时候可以折叠,包含“回到顶部”按钮)

修改记录

2015.01.04

  • 修复“初始化组件,内容太长也不会显示滚动条”的bug

2014.12.24

  • 完成电梯功能
  • 解决ScrollTop的奇怪问题,“只有在Chrome打开控制台情况下'回到顶部'按钮才有有效”,这是因为当宽度大于1240时body-inner是固定高度的,而当宽度小于1240时,body-inner是变高度,book-body是固定高度的;原始代码只对book-body设置scrollTop动画,所以打开Chrome窗口的时候(意外地使得浏览器窗口小于1240)才有动画;已经修复。

2014.12.22

  • 主题模式的匹配
  • "回到顶部"功能

2014.12.19

  • 重构,模块化,抽离出content模块,专注目录dom字符串
  • 调整目录结构,使得能够出现垂直滚动条
  • 添加state-scroll,只有当窗口高度小于目录高度时候才显示滚动条

2014.12.18

  • 使用$.guid给不同的标题赋Id
  • 使用tagName给不同层级标题赋值类名
  • 添加动画效果