https://github.com/droxey/tocsify
📦 npm module to generate a ToC based on your docs directory filestructure!
https://github.com/droxey/tocsify
cli deployed docsify documentation index markdown nodejs npm npm-module npm-package npm-publish readme table table-of-contents toc tocsify
Last synced: 29 days ago
JSON representation
📦 npm module to generate a ToC based on your docs directory filestructure!
- Host: GitHub
- URL: https://github.com/droxey/tocsify
- Owner: droxey
- License: mit
- Created: 2018-09-30T02:10:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-02T17:48:56.000Z (over 1 year ago)
- Last Synced: 2025-10-10T17:39:30.257Z (5 months ago)
- Topics: cli, deployed, docsify, documentation, index, markdown, nodejs, npm, npm-module, npm-package, npm-publish, readme, table, table-of-contents, toc, tocsify
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/tocsify
- Size: 39.1 KB
- Stars: 5
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📋 tocsify
[](https://www.npmjs.com/package/tocsify) [](https://npmjs.org/package/tocsify)
📋 npm module that **generates a table of contents** based on the **file structure** of a [Docsify](https://docsify.js.org) `docs` directory!
## Features
* Adds relative path to title in each top-level entry for context.
* Skips markdown files beginning with `_`.
* Allows users to specify `maxdepth` for cleaner generation.
* 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](https://docsify.js.org) project!
```bash
npm install -g tocsify
```
## Usage
```bash
Usage
$ tocsify docs --file=docs/toc.md
Options
--verbose, -v Write output to stdout.
--file, -f Write output to file.
--header, -h Include a descriptive header. Default is true.
--maxdepth, -m Specify max level header(1 - 6) to output. Default is 3.
Examples
$ tocsify docs --file=docs/toc.md
$ tocsify docs --verbose --file=docs/toc.md
$ tocsify docs --maxdepth=2
$ tocsify docs --header=false
```
## Integration
Integration with a [Docsify](https://docsify.js.org) homepage is easy!
In `index.md` or `_sidebar.md`, paste the snippet below where the Table of Contents should appear:
```markdown
## Table of Contents
[filename](toc.md ':include')
```
A working `index.md` file can be found in the docs directory [here](docs/index.md) for reference.