-
-
Notifications
You must be signed in to change notification settings - Fork 490
docs: Give focus to toc config options #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AndrewSouthpaw
merged 6 commits into
thlorenz:master
from
thompson-tomo:chore/ReadmeDocs
Dec 10, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0e23bbd
Give focus to toc config options
thompson-tomo e5ace38
Add script to update readme
thompson-tomo 8be6c96
Update README.md
thompson-tomo 5a8fbfb
Update README.md
thompson-tomo 9b15efd
Merge branch 'master' into chore/ReadmeDocs
thompson-tomo 32219f7
Incorporate generated content into example
thompson-tomo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,11 @@ by github or other sites via a command line flag. | |
| **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* | ||
|
|
||
| - [Installation](#installation) | ||
| - [Configuring Table of content](#configuring-table-of-content) | ||
| - [TOC Title text](#toc-title-text) | ||
| - [Min. heading level](#min-heading-level) | ||
| - [Max. heading level](#max-heading-level) | ||
| - [Include all Headings](#include-all-headings) | ||
| - [Usage](#usage) | ||
| - [Adding toc to all files in a directory and sub directories](#adding-toc-to-all-files-in-a-directory-and-sub-directories) | ||
| - [Ignoring individual files](#ignoring-individual-files) | ||
|
|
@@ -17,9 +22,6 @@ by github or other sites via a command line flag. | |
| - [Using doctoc to generate links compatible with other sites](#using-doctoc-to-generate-links-compatible-with-other-sites) | ||
| - [Example](#example) | ||
| - [Specifying location of toc](#specifying-location-of-toc) | ||
| - [Specifying a custom TOC title](#specifying-a-custom-toc-title) | ||
| - [Specifying a minimum heading level for TOC entries](#specifying-a-minimum-heading-level-for-toc-entries) | ||
| - [Specifying a maximum heading level for TOC entries](#specifying-a-maximum-heading-level-for-toc-entries) | ||
| - [Performing a dry run](#performing-a-dry-run) | ||
| - [Printing to stdout](#printing-to-stdout) | ||
| - [Only update existing ToC](#only-update-existing-toc) | ||
|
|
@@ -32,6 +34,41 @@ by github or other sites via a command line flag. | |
|
|
||
| npm install -g doctoc | ||
|
|
||
| ## Configuring Table of content | ||
|
|
||
| ### TOC Title text | ||
|
|
||
| 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. | ||
|
|
||
| Alternatively, to blank out the title, use the `--notitle` option. This will simply remove the title from the TOC. | ||
|
|
||
| ### Min. heading level | ||
|
|
||
| Use the `--minlevel` option to limit TOC entries to headings only at or above the specified level; e.g., `doctoc --minlevel 2 .` | ||
|
|
||
| By default, | ||
|
|
||
| - the min level used is 1 if it is not set | ||
|
|
||
| Note: Currently supported values are only 1 and 2. | ||
|
|
||
| ### Max. heading level | ||
|
|
||
| Use the `--maxlevel` option to limit TOC entries to headings only up to the specified level; e.g., `doctoc --maxlevel 3 .` | ||
|
|
||
| By default, | ||
|
|
||
| - no limit is placed on Markdown-formatted headings, | ||
| - whereas headings from embedded HTML are limited to 4 levels. | ||
|
|
||
| ### Include all Headings | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit weird capitalization, "headings" |
||
|
|
||
| Use the `--all` option to include all headings in the TOC regardless of their location | ||
|
|
||
| By default, | ||
|
|
||
| - Only headings below the TOC will be included | ||
|
|
||
| ## Usage | ||
|
|
||
| In its simplest usage, you can pass one or more files or folders to the | ||
|
|
@@ -114,32 +151,25 @@ Here we'll discuss... | |
|
|
||
| ``` | ||
|
|
||
| Running doctoc will insert the toc at that location. | ||
|
|
||
| ### Specifying a custom TOC title | ||
|
|
||
| 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. | ||
|
|
||
| Alternatively, to blank out the title, use the `--notitle` option. This will simply remove the title from the TOC. | ||
|
|
||
| ### Specifying a minimum heading level for TOC entries | ||
| Running doctoc will insert the toc at the specified location as illustrated below. | ||
|
|
||
| Use the `--minlevel` option to limit TOC entries to headings only at or above the specified level; e.g., `doctoc --minlevel 2 .` | ||
|
|
||
| By default, | ||
|
|
||
| - the min level used is 1 if it is not set | ||
| ```markdown | ||
| // my_new_post.md | ||
| Here we are, introducing the post. It's going to be great! | ||
| But first: a TOC for easy reference. | ||
|
|
||
| Note: Currently supported values are only 1 and 2. | ||
| <!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
| <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
| **Contents** | ||
|
|
||
| ### Specifying a maximum heading level for TOC entries | ||
| - [Section One](#section-one) | ||
|
|
||
| Use the `--maxlevel` option to limit TOC entries to headings only up to the specified level; e.g., `doctoc --maxlevel 3 .` | ||
| <!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
|
||
| By default, | ||
| # Section One | ||
|
|
||
| - no limit is placed on Markdown-formatted headings, | ||
| - whereas headings from embedded HTML are limited to 4 levels. | ||
| Here we'll discuss... | ||
| ``` | ||
|
|
||
| ### Performing a dry run | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit "Table of Contents" or "table of contents"