# index-generator

> Create a table of contents file that summarizes the links to the target file.

Latest version **1.0.13** (published 2021-07-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install index-generator
pnpm add index-generator
yarn add index-generator
bun add index-generator
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2021-07-09 |
| First published | 2019-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 82.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | akiraiwabuchi |
| Maintainers | akiraiwabuchi |
| Keywords | index, generator |

## Links

- npm: https://www.npmjs.com/package/index-generator
- Repository: https://github.com/akiraiwabuchi/index-generator
- Homepage: https://github.com/akiraiwabuchi/index-generator#readme
- Issues: https://github.com/akiraiwabuchi/index-generator/issues
- npm.io page: https://npm.io/package/index-generator

## Recent versions

- 1.0.13 (latest) — 2021-07-09
- 1.0.3 — 2019-12-20
- 1.0.2 — 2019-12-20
- 1.0.1 — 2019-12-20
- 1.0.0 — 2019-10-20
- 0.1.3 — 2019-10-18
- 0.1.2 — 2019-10-17
- 0.1.1 — 2019-10-17
- 0.1.0 — 2019-10-15

## README

[![Build Status](https://travis-ci.org/akiraiwabuchi/index-generator.svg?branch=master)](https://travis-ci.org/akiraiwabuchi/index-generator)
[![Coverage Status](https://coveralls.io/repos/github/akiraiwabuchi/index-generator/badge.svg?branch=master)](https://coveralls.io/github/akiraiwabuchi/index-generator?branch=master)
![APM](https://img.shields.io/apm/l/index-generator)

# index-generator

Create a table of contents file that summarizes the links to the target file.  

↓SAMPLE mode adaptive and mode Dark
![adaptiveSampleImage](https://i.imgur.com/zeiHjO2g.png)

↓SAMPLE mode responsive and mode Light
![responsiveSampleImage](https://i.imgur.com/WtMGCelg.png)

## Usage

```JavaScript
const indexGenerator = require('index-generator');

indexGenerator();
```

### Config

All configs sample  

```JavaScript
indexGenerator({
    htmlPath: './html/',
    distPath: './dist/',
    fileName: 'index.html',
    darkMode: true,
    construction: 'adaptive',
    prefixGroup: [
        {
            prefixName: 'd',
            title: 'Develop',
            titleIcon: 'keyboard',
            fileIcon: ["style","","","view_compact","","mood","code"]
        },
        {
            prefixName: 'p',
            title: 'Pages',
            titleIcon: 'description'
        },
        {
            prefixName: 'w',
            title: 'WorkSpace',
            titleIcon: 'create'
        }
    ],
    suffixDesktop: '-desktop.html',
    suffixMobile: '-mobile.html',
    suffixTablet: '-tablet.html',
    removeTitle: [' | TEST FILE', ' | TEST'],
    faviconPath: './image/favicon.ico',
    headTitle: 'headTitle',
    pageTitle: 'pageTitle',
    overview: 'overview',
    disclaimerTitle: 'disclaimerTitle',
    disclaimerDesc: 'disclaimerDesc',
    copyright: '&copy; CopyrightSample.Inc'
});
```

configs parameters  

| Parameter          | Type    | Default                          | Description                                                       |
| ------------------ | ------- | -------------------------------- | ----------------------------------------------------------------- |
| `htmlPath`         | string  | './html/'                        | Target html file storage location                                 |
| `distPath`         | string  | htmlPath                         | Location of index generated by this module                        |
| `fileName`         | string  | 'index.html'                     | Index file name generated by this module                          |
| `darkMode`         | boolean | false                            | Generate in dark mode if true                                     |
| `construction`     | string  | 'responsive'                     | 'responsive' or 'adaptive'                                        |
| `prefix`           | object  |                                  | Please refer to the following                                     |
| `suffixDesktop`    | string  | '-desktop.html'                  | For adaptive the name of the suffix that is treated as a desktop  |
| `suffixMobile`     | string  | '-mobile.html'                   | For adaptive the name of the suffix that is treated as a mobile   |
| `suffixTablet`     | string  | '-tablet.html'                   | For adaptive the name of the suffix that is treated as a tablet   |
| `removeTitle`      | string/object  | ''                        | You can specify the character string you want to delete for title |
| `faviconPath`      | string  | ''                               | favicon path can be specified                                     |
| `headTitle`        | string  | 'index'                          | Specify the title string of the head                              |
| `pageTitle`        | string  | 'pageTitle'                      | Specify h1 of the index                                           |
| `overview`         | string  | 'Overview text sample.'          | Specify the summary of index                                      |
| `disclaimerTitle`  | string  | 'Disclaimer title sample'        | Specify disclaimer title                                          |
| `disclaimerDesc`   | string  | 'Disclaimer description sample.' | Specify the content of disclaimer                                 |
| `copyright`        | string  | '&copy; CopyrightSample.Inc'     | Specify copyright                                                 |

#### prefix

Categories can be separated by prefix.  
There are four settings as described in All configs sample.  
**prefixName**:File name prefix  
**title**:The title of the category  
**titleIcon**:Set the name of the [Google Material Icons](https://material.io/resources/icons/). This is an icon placed next to the category title.  
**fileIcon**:You can set an [Google Material Icons](https://material.io/resources/icons/) for a file. It will be applied to the file in the order of the array.

#### suffix

Works only with adaptive.  
If the file name excluding suffix matches, it will be treated as the same file.  
Please adjust so that suffix does not overlap with the same file name

---
_Source: https://npm.io/package/index-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
