Skip to content

It's a straightforward command-line tool designed to generate a table of contents for your Markdown files based on titles.

License

Notifications You must be signed in to change notification settings

anotherhadi/markdown-table-of-contents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7812017 · Oct 14, 2024

History

5 Commits
Sep 4, 2024
Oct 14, 2024
Aug 31, 2024
Aug 31, 2024
Aug 31, 2024
Oct 14, 2024

Repository files navigation

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

About

It's a straightforward command-line tool designed to generate a table of contents for your Markdown files based on titles.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages