Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@technote-space/doctoc

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@technote-space/doctoc

Generates TOC for markdown files of local git repo.

  • 2.6.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.7K
increased by17.62%
Maintainers
1
Weekly downloads
 
Created
Source

DocToc

npm version CI Status codecov CodeFactor License: MIT

Generates table of contents for markdown files inside local git repository. Links are compatible with anchors generated by github or other sites via a command line flag.

Table of Contents

Details

Install

yarn add @technote-space/doctoc

Example

import {readFileSync} from 'fs';
import {findMarkdownFiles, transform} from '@technote-space/doctoc';

findMarkdownFiles(__dirname);

transform(readFileSync('README.md', {
  // mode: 'github.com', // github.com | bitbucket.org | gitlab.com | nodejs.org | ghost.org (default: github.com)
  // maxHeaderLevel: 2, // default: 4
  // title: '**Table of Contents**',
  // isNotitle: true,
  // isFolding: true,
  // entryPrefix: '*',
  // processAll: true,
  // updateOnly: true,
  // openingComment: '<!-- toc -->',
  // closingComment: '<!-- tocstop --> ',
  // checkOpeningComments: ['<!-- toc '],
  // checkClosingComments: ['<!-- tocstop '],
  // checkSkipComments: ['<!-- toc skip '],
  // isCustomMode: false,
  // customTemplate: '<p align="center">${ITEMS}</p>',
  // itemTemplate: '<a href="${LINK}">${TEXT}</a>',
  // separator: '<span>|</span>',
  // footer: '',
}));

Author

GitHub (Technote)
Blog

Keywords

FAQs

Package last updated on 07 May 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc