Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 2.38 KB

README.md

File metadata and controls

79 lines (56 loc) · 2.38 KB

Markdown Table Of Contents

Latest Release GoDoc GoReportCard

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.

Features

  • 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.

How to Use

  1. Installation:
go install github.com/anotherhadi/markdown-table-of-contents@latest
  1. Usage: Run the executable with your Markdown file as an argument.
markdown-table-of-contents <markdownfile.md>
  1. 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)

Example

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:

License

This project is licensed under the MIT License.

Todolist

  • Replace from file with {table_of_contents} tag or something
  • Ignore H1, H2 or anything from the left