Markdown Table Of Contents is a straightforward command-line tool designed to generate a table of contents for your Markdown files based on titles. This project use the markdown reader/writer package.
- Automatic Generation: Quickly generate a table of contents for your Markdown files.
- Title Detection: Detects headings in your Markdown file and generates links to them in the table of contents.
- Installation:
go install github.com/anotherhadi/markdown-table-of-contents@latest
- Usage: Run the executable with your Markdown file as an argument.
markdown-table-of-contents <markdownfile.md>
- Output: The tool will generate a table of contents based on the headings in your Markdown file.
Arguments:
-depth int
Depth of the table of contents (1,2,...,6). 2 will print only H1 and H2 (default 3)
-indent string
Indentation string (' ','tab') (default " ")
-start-by int
Start by specific header (1,2,...,6). 2 will start by H2 (default 1)
Suppose you have a Markdown file named example.md
with the following headings:
# Introduction
## Getting Started
### Installation
### Usage
## Features
# Conclusion
Running the command:
markdown-table-of-contents example.md
Would generate the following table of contents:
This project is licensed under the MIT License.
- Replace from file with {table_of_contents} tag or something
- Ignore H1, H2 or anything from the left