This package makes it easy to have a customizable table of contents in Org files that can be updated manually, or automatically when the file is saved. Links to headings are created compatible with GitHub’s Org renderer.
If you installed from MELPA, you’re done.
Install these required packages:
dash
s
Then put this file in your load-path, and put this in your init file:
(require 'org-make-toc)
- Make a heading in the Org file where you want the table of contents, and give it the Org property
TOC
with the valuethis
. - Run the command
org-make-toc
.
The table of contents can be customized by setting the TOC
property of headings:
- Set to
ignore
to omit a heading from the TOC. - Set to
ignore-children
or0
to omit a heading’s child headings from the TOC. - Set to a number
N
to include child headings no more thanN
levels deep in the TOC.
To automatically update a file’s TOC when the file is saved, use the command add-file-local-variable
to add org-make-toc
to the Org file’s before-save-hook
.
See this readme file for an example of the features described above.
Initial release.
This package was inspired by Sergei Nosov’s toc-org package.
Bug reports, feature requests, suggestions — oh my!
GPLv3