https://github.com/somajitdey/tocgen
Markdown Table of Contents Generator
https://github.com/somajitdey/tocgen
bash documentation inline-editor markdown md sed shell-script table-of-contents toc-generator typora
Last synced: 5 months ago
JSON representation
Markdown Table of Contents Generator
- Host: GitHub
- URL: https://github.com/somajitdey/tocgen
- Owner: SomajitDey
- License: gpl-3.0
- Created: 2021-09-18T14:32:13.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-23T11:39:18.000Z (about 4 years ago)
- Last Synced: 2025-05-12T13:12:45.887Z (5 months ago)
- Topics: bash, documentation, inline-editor, markdown, md, sed, shell-script, table-of-contents, toc-generator, typora
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TOC Generator for Markdown documents
  
The below "Table of Contents" has been generated using `tocgen`.
## Table of Contents
[](https://github.com/SomajitDey/tocgen)
- [TOC Generator for Markdown documents](#toc-generator-for-markdown-documents)
- [Usage](#usage)
- [Step 1](#step-1)
- [Step 2](#step-2)
- [Step 3](#step-3)
- [Contribute](#contribute)
######## Usage
##### Step 1
Put the placeholder `[TOC]` **followed by 2 spaces and a new-line** (viz. press Enter key) wherever you want the *Table of Contents* to appear in your markdown file.
##### Step 2
Then simply:
```bash
tocgen
# If path is not provided, tocgen searches its working directory for *.md files
```It does an in-place edit of the file provided. The injected "Table of Contents" contains a trailing blank level 5 heading. **DO NOT** delete this blank heading as `tocgen` uses it to delimit the "Table of Contents" during subsequent updates (see below).
##### Step 3
Edit your document as necessary - adding, editing and removing headings. When you finish editing, in order to update the "Table of Contents", simply repeat the command given above.
### Contribute
Report [bugs](https://github.com/SomajitDey/tocgen/issues) or [discuss](https://github.com/SomajitDey/tocgen/discussions) ideas and new features. [PR](https://github.com/SomajitDey/tocgen/pulls)s welcome.
[](https://buymeacoffee.com/SomajitDey)