Home

Awesome

<!-- toc-begin -->

Table of Content

<!-- toc-end -->

NAME

git-md-toc - generate the table of content from the Markdown file(s)

SYNOPSIS

git-md-toc [OPTIONS] [FILE...]

DESCRIPTION

Read an input and generate the table of content (TOC) based on the markup of the file which is assumed Markdown formatted. The outcome is also formatted as Markdown.

The following HTML comments are recognized in a special way and handled as the markers to insert new TOC or update existing one.

Be noticed that these markers themselves must be sticky to the left edge of the lines where they are situated. This rule doesn't spread on the content within.

The updated TOC is always ended with double new line to separate from the further text below. On the same reason, if the TOC is preceded with some text above, the double new line is prepending the TOC.

Old-style markers

Early, before 2022, another set of markers was used: md-toc, md-toc-begin and md-toc-end.

Currently they are considered obsolete and not recommended in use. However they are still supported but replaced with the newer ones when TOC is updated.

Be noticed that you shouldn't mix old and new paired markers to designate the beginning and end of the same TOC.

OPTIONS

SEE ALSO

Syntax specification

Perl implementations

Some other implementations

AUTHORS

Ildar Shaimordanov <ildar.shaimordanov@gmail.com>

COPYRIGHT

Copyright (c) 2019-2022 Ildar Shaimordanov. All rights reserved.

MIT License