Skip to content

Latest commit

 

History

History
75 lines (49 loc) · 1.61 KB

toc.md

File metadata and controls

75 lines (49 loc) · 1.61 KB

Table of contents

If a line is toc it will be replaced with a table of contents

So if a markdown document contains the following:

# Title

toc

## Heading 1

Text1

## Heading 1

Text2

snippet source | anchor

The result will be rendered:

# Title

<!-- toc -->
## Contents

 * [Heading 1](#heading-1)
 * [Heading 2](#heading-2)
<!-- endToc -->

## Heading 1

Text1

## Heading 2

Text2

snippet source | anchor

Heading Level

Headings with level 2 (##) or greater can be rendered. By default all level 2 and level 3 headings are included.

To include more levels use the --toc-level argument. So for example to include headings levels 2 though level 6 use:

mdsnippets --toc-level 5

Ignore Headings

To exclude headings use the --toc-excludes argument. So for example to exclude heading1 and heading2 use:

mdsnippets --toc-excludes heading1:heading2