An open API service indexing awesome lists of open source software.

https://github.com/djeada/markdown-table-of-contents-generator

Generate a table of contents from the headers of your markdown file.
https://github.com/djeada/markdown-table-of-contents-generator

html python-strings tags

Last synced: 3 months ago
JSON representation

Generate a table of contents from the headers of your markdown file.

Awesome Lists containing this project

README

        

# Md-table-of-contents-generator
Generate a table of contents from the headers of your markdown file.

![Capture](https://user-images.githubusercontent.com/37275728/186139168-bc2de9d0-5804-41f8-82f3-e13ed73c5cbb.PNG)

## Table of Contents

- [Md-table-of-contents-generator](#Md-table-of-contents-generator)
- [Purpose](#Purpose)
- [Installation](#Installation)
- [Usage](#Usage)
- [Contributing](#Contributing)
- [License](#License)

## Purpose

This script will create a table of contents for a specified markdown file.
A table of contents may be generated for headers defined using html tags as well as headers defined with markdown syntax.
If the provided file already has a table of contents, the script will replace it with the new one.

## Installation

It is advisable to use virtualenv to install the program.

git clone https://github.com/djeada/Markdown-table-of-contents-generator.git
cd md-table-of-contents-generator
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

## Usage

Use the following command to display the help:

cd md-table-of-contents-generator
python md-table-of-contents-generator.py --help

Use the following command to generate the table of contents for a markdown file with the filename README.md and save it to the file README.md.toc:

python md-table-of-contents-generator.py --input=README.md --output=README.md.toc

## Contributing
It is an open source project, so feel free to contribute!

## License
This project is licensed under the MIT license.