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

assemble-plugin-toc

v0.0.4

Published

Assemble目录自动生成插件,生成html使用Cheerio.js.

Downloads

21

Readme

assemble-plugin-toc NPM version Build Status 依赖模块状态

Assemble目录自动生成插件,生成html使用Cheerio.js.

Table of Contents

Quickstart

包安装:

npm install assemble-plugin-toc --save

Gruntfile.js定制:

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    assemble: {
      options: {
        plugins: ['assemble-plugin-toc']
      },
      ...
    }
  });
  grunt.loadNpmTasks('assemble');
  grunt.registerTask('default', ['assemble']);
};

Options

tocid

Type: String
Default: toc

增加html容器id,默认toc

listid

Type: String

定义列表id,默认toc-list

listclass

Type: String

定义列表的类,默认空

hclassprefix

Type: String Default: toc-h

新生成列表标题class前缀,默认toc-h,然后toc-h1,toc-h2,toc-h3

hnameprefix

Type: String Default: toc-name

描点name的前缀,默认toc-name,然后toc-name1,toc-name2,toc-name3

boxid

Type: String

要提取生成toc的容器id,默认是全局

Usage Examples

基本用法

最基本用法:

assemble: {
  blog: {
    options: {
      plugins: ['assemble-plugin-toc'],
    },
    files: {
      './blog/': ['./templates/blog/*.hbs']
    }
  }
}

高级

assemble: {
  blog: {
    options: {
      plugins: ['assemble-plugin-toc'],
      toc: {
        boxid: 'toc'
        listid: 'toc-list'
        listclass: 'listclass'
        hclassprefix: 'toc-h'
        hnameprefix: 'toc-name'
      }
    },
    files: {
      './blog/': ['./templates/blog/*.hbs']
    }
  }
}

注意:要查看链接图标,一定要在服务器状态!

Author

GoldCome

  • Github: https://github.com/GoldCome
  • Blog:http://www.gdcome.com
  • QQ/Email: [email protected]

Release History

  • 2014-02-21   v0.0.0   重新构建目录生成插件
  • 2014-02-21   v0.0.1   修正当标题存在其他html代码时无法正确获取属性问题
  • 2014-02-22   v0.0.2   增加一个能提取指定id容器内容为toc的选项,并不总是全局,但默认是全局
  • 2014-03-09   v0.0.3   发布到github
  • 2014-03-13   v0.0.4   重新命名发布

License

Copyright (c) 2014 goldcome, contributors. Released under the MIT license


This file was generated on Saturday, March 15, 2014.