Git Product home page Git Product logo

make-toc.sh's Introduction

make-toc.sh

npm version Pull Requests Welcome

A Shell script to automatically generate a Table of Contents from Markdown files.

Contents

Installation

NPM

npm install -g make-toc

Manually

  1. Clone the repo or download as a ZIP and extract it.
  2. Add the markdown file you want to generate a ToC for to the project's folder.

Usage

NPM

make-toc ...opts source-file.md output-file.md

Manually

. ./make-toc.sh ...opts source-file.md output-file.md

Documentation

  • source-file.md - The markdown file a ToC should be generated for.
  • output-file.md - A filename to label the script's output, e.g. toc.md.

...opts

This section outlines flags for the script which may be used individually or in combination.

-s <n> or --skip <n>

Skips n headers from the top of the file.

For example, to omit the file's title header use:

make-toc -s 1 source.md target.md

-d <n> or --depth <n>

Sets the maximum depth for the table.

For example, to generate a fairly shallow table of the top-level and second-level headers only, use:

make-toc -d 2 source.md target.md

Passing -d 0 to the script will result in default behaviour, i.e. full depth.

make-toc.sh's People

Contributors

bkrem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

make-toc.sh's Issues

Add --depth/-d flag

Add a depth flag to let the user decide how deeply the ToC can nest before markdown header tags are simply ignored for the ToC bullet points

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.