Skip to content

Commit f570b80

Browse files
committed
Give focus to toc config options
1 parent a38ed70 commit f570b80

File tree

1 file changed

+40
-27
lines changed

1 file changed

+40
-27
lines changed

README.md

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ by github or other sites via a command line flag.
88
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
99

1010
- [Installation](#installation)
11+
- [Table of content config options](#table-of-content-config-options)
12+
- [Setting the Title](#setting-the-title)
13+
- [Min. heading level](#min-heading-level)
14+
- [Max. heading level](#max-heading-level)
15+
- [Include all Headings](#include-all-headings)
1116
- [Usage](#usage)
1217
- [Adding toc to all files in a directory and sub directories](#adding-toc-to-all-files-in-a-directory-and-sub-directories)
1318
- [Update existing doctoc TOCs effortlessly](#update-existing-doctoc-tocs-effortlessly)
@@ -16,8 +21,6 @@ by github or other sites via a command line flag.
1621
- [Using doctoc to generate links compatible with other sites](#using-doctoc-to-generate-links-compatible-with-other-sites)
1722
- [Example](#example)
1823
- [Specifying location of toc](#specifying-location-of-toc)
19-
- [Specifying a custom TOC title](#specifying-a-custom-toc-title)
20-
- [Specifying a maximum heading level for TOC entries](#specifying-a-maximum-heading-level-for-toc-entries)
2124
- [Printing to stdout](#printing-to-stdout)
2225
- [Usage as a `git` hook](#usage-as-a-git-hook)
2326
- [Docker image](#docker-image)
@@ -29,6 +32,41 @@ by github or other sites via a command line flag.
2932

3033
npm install -g doctoc
3134

35+
## Table of content config options
36+
37+
### Setting the Title
38+
39+
Use the `--title` option to specify a (Markdown-formatted) custom TOC title; e.g., `doctoc --title '**Contents**' .` From then on, you can simply run `doctoc <file>` and doctoc will keep the title you specified.
40+
41+
Alternatively, to blank out the title, use the `--notitle` option. This will simply remove the title from the TOC.
42+
43+
### Min. heading level
44+
45+
Use the `--minlevel` option to limit TOC entries to headings only at or above the specified level; e.g., `doctoc --minlevel 2 .`
46+
47+
By default,
48+
49+
- the min level used is 1 if it is not set
50+
51+
Note: Currently supported values are only 1 and 2.
52+
53+
### Max. heading level
54+
55+
Use the `--maxlevel` option to limit TOC entries to headings only up to the specified level; e.g., `doctoc --maxlevel 3 .`
56+
57+
By default,
58+
59+
- no limit is placed on Markdown-formatted headings,
60+
- whereas headings from embedded HTML are limited to 4 levels.
61+
62+
### Include all Headings
63+
64+
Use the `--all` option to include all headings in the TOC regardless of their location
65+
66+
By default,
67+
68+
- Only headings below the TOC will be included
69+
3270
## Usage
3371

3472
In its simplest usage, you can pass one or more files or folders to the
@@ -112,31 +150,6 @@ Here we'll discuss...
112150

113151
Running doctoc will insert the toc at that location.
114152

115-
### Specifying a custom TOC title
116-
117-
Use the `--title` option to specify a (Markdown-formatted) custom TOC title; e.g., `doctoc --title '**Contents**' .` From then on, you can simply run `doctoc <file>` and doctoc will keep the title you specified.
118-
119-
Alternatively, to blank out the title, use the `--notitle` option. This will simply remove the title from the TOC.
120-
121-
### Specifying a minimum heading level for TOC entries
122-
123-
Use the `--minlevel` option to limit TOC entries to headings only at or above the specified level; e.g., `doctoc --minlevel 2 .`
124-
125-
By default,
126-
127-
- the min level used is 1 if it is not set
128-
129-
Note: Currently supported values are only 1 and 2.
130-
131-
### Specifying a maximum heading level for TOC entries
132-
133-
Use the `--maxlevel` option to limit TOC entries to headings only up to the specified level; e.g., `doctoc --maxlevel 3 .`
134-
135-
By default,
136-
137-
- no limit is placed on Markdown-formatted headings,
138-
- whereas headings from embedded HTML are limited to 4 levels.
139-
140153
### Printing to stdout
141154

142155
You can print to stdout by using the `-s` or `--stdout` option.

0 commit comments

Comments
 (0)