/tocgen

An opinionated Table of Contents generator

Primary LanguageJavaScript

tocgen

An opinionated Table of Contents generator for Github. This allows only one level headings - specified via comments, and supports only heading level 5 for all items. Why? Too much bold text and headings spoil readability for certain type of content.

For a fully featured Table of Contents generator, use https://github.com/thlorenz/doctoc

Install

npm install -g tocgen

Usage

tocgen README.md

Table of Contents

CLI
tocgen README.md
NodeJS API
var tocgen = require('tocgen');
tocgen(file).then(function() {
  console.log('success');
});
ToC location

You can choose where to place your Table of Contents. The ToC will be placed between START and END. By default it will be the beginning of the file.

  <!-- START table-of-contents -->

  <!-- END table-of-contents -->
Hidden headings

Generally to specify the category name or group name

  <!-- heading: My Awesome Collection of Points -->
Visible headings - Level 5

These become the visible headings and will support only level 5 headings (5 hashes #####)

  ##### My Awesome Point 1

  Points