Neutral Political Machine
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

tocsify

2.0.0 • Public • Published

📋 tocsify

NPM version NPM downloads Build Status Dependencies Status DevDependencies Status License: MIT

📋 npm module that generates a table of contents based on the file structure of a Docsify docs directory!

Features

  • Adds relative path to title in each top-level entry for context.
  • Skips markdown files beginning with _.
  • Skips generation for headers marked {docsify-ignore}
  • If {docsify-ignore-all} exists in a top level header (# Example Header {docsify-ignore-all}), skip generating the table of contents for the entire document.

Installation

Install globally for use in any Docsify project!

npm install -g tocsify

Usage

Save to File

From the root of your project, simply run:

tocsify ./docs --file=./docs/toc.md

Save File with Verbose Output

For verbose output that also saves to a file, run:

tocsify ./docs --file=./docs/toc.md --verbose

Write to Console

To just write to stdout -- without saving a file -- run:

tocsify ./docs --verbose

Integration

Integration with a Docsify homepage is easy!

In index.md, paste the snippet below where the Table of Contents should appear:

## Table of Contents
[filename](toc.md ':include')

A working index.md file can be found in the docs directory here for reference.

install

npm i tocsify

Downloadsweekly downloads

9

version

2.0.0

license

MIT

homepage

droxey.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability