0.3.1 • Published 6 years ago

folder-toc v0.3.1

Weekly downloads
46
License
MIT
Repository
github
Last release
6 years ago

folder-toc

Creates an HTML table of content with links to files from a selected directory.

Usage

var folderToc = require("folder-toc");
folderToc("docs");

This will create a table of content for all files in the docs directory.

Options

folderToc("target_directory", {
    name: 'index.html',
    templateDir: path(__dirname, 'resources/classic'),
    templateFile: 'index.jst',
    filter: '*.*',
    title: 'Files'
});

name

Type: String

Defaults: 'index.html'

Name of the output file containing the table of content.

templateDir

Type: String

Location of the template directory. Template directory should contain a template file and all required assets.

Contents of the template directory will be copied to the location where the table of content is created and placed in the 'name_assets' directory. Set paths to used assets in the template file accordingly.

templateFile

Type: String

Name of the template file within the template directory.

filter

Type: String

Default: .

Pattern matching files which should be included in the table of content.

title

Type: String

Default: Files

Table of content file title.

Custom templates

If you would like to create a custom template for the table of content copy and customize the contents of the '/resources/custom' directory.

Example

Creaste a table of content within the /example directory.

cd example
npm install
npm run example
0.3.1

6 years ago

0.2.0

6 years ago

0.1.0

10 years ago