New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

md-toc-generator

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

md-toc-generator

> Creates and updates tables of content in your markdown files.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
20
81.82%
Maintainers
1
Weekly downloads
 
Created
Source

md-toc-generator

Creates and updates tables of content in your markdown files.

  • Usage
  • License

Usage

Install the package globally or as a local dependency:

# npm install md-toc-generator
# npm install --global md-toc-generator
# yarn global add md-toc-generator
yarn add md-toc-generator

Add a placeholder to files that you want to create ToC for:

[//]: # "BEGIN_TOC"
[//]: # "END_TOC"

Then call the script:

# adds/updates ToC README.md in current directory
md-toc-generator

# adds/updates ToC wherever you point it to
md-toc-generator --paths <PATH_TO_MD_FILE>

If you want to lint your markdown files to see if the ToC is up to date, but without changing anything, use the --ci flag (example usage in the GitHub actions of this project).

md-toc-generator --ci

If you want to ensure that given markdown files have a toc, use the --placeholder-required option.

License

See LICENSE file.

FAQs

Package last updated on 27 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts