1.0.9 • Published 2 years ago

filetoc v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

FileToc

中文

Table of Contents generated with FileToc

Installation

npm install filetoc -g

Usage

Create a config File(filetoc.config.js)

Examples

// filetoc.config.js
module.exports = {
  remoteUrl: 'https://github.com/chenfan0/dirtoc', // your repo address
  mainBranch: 'main', // your default branch. default 'main'
  dirPath: '.', //  the dir where you want to gengerate the toc. default '.'
  mdPath: ['./README.md', './README.zh.md'], // the markdown files path, when there is only one path, it also can be a string.  default ['README.md']
  excludes: ['.git'] // the excludes file name or dir name
}

Specifying location of toc

You should specify where to insert the TOC in your markdown file.

Example

<!--filetoc-start-->
toc will insert here
<!--filetoc-end-->

Run filetoc

Go into the directory that contains you local git project and type:

filetoc

Use with git hooks

If you want to automatically modify the markdown for you before each commit.You can use husky to achieve this effect.

Go into the directory that contains you local git project and type:

npx husky-init && npm install

Find the pre-commit file under the generated husky folder and write in the file:

filetoc
git add .
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago