https://github.com/ardumont/markdown-toc.git
git clone 'git://github.com/ardumont/markdown-toc.git'
Table of Contents
A simple mode to create TOC in a markdown file.
Inside a markdown file, the first time, place yourself where you want to insert the TOC:
M-x markdown-toc-generate-toc
This will compute the TOC and insert it at current position.
Here is one possible output:
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
**Table of Contents**
- [Use](#use)
- [Create](#create)
- [Update](#update)
- [Create elsewhere](#create-elsewhere)
- [Install](#install)
- [emacs package repository](#emacs-package-repository)
- [Setup](#setup)
- [melpa stable](#melpa-stable)
- [melpa](#melpa)
- [marmalade](#marmalade)
- [Install](#install)
- [emacs-lisp file](#emacs-lisp-file)
- [Inspiration](#inspiration)
To update the existing TOC, simply execute again: C-u M-x markdown-toc-generate-toc
This will update the current TOC.
To create another updated TOC elsewhere, execute again M-x markdown-toc-generate-toc, this will remove the old TOC and insert the updated one from where you stand.
You need to add melpa or melpa-stable package repository before installing it.
(require 'package)
(add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))
(package-initialize)
Then hit M-x eval-buffer to evaluate the buffer's contents.
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
Then hit M-x eval-buffer to evaluate the buffer's contents.
(require 'package)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
M-x package-install RET markdown-toc RET
Retrieve the markdown-toc.el https://github.com/ardumont/markdown-toc/releases.
Then hit M-x package-install-file RET markdown-toc.el RET
https://github.com/thlorenz/doctoc
The problem I had with doctoc is the installation process. I do not want to install the node tools just for this.