Markdown TOC
Generate and update magically a table of contents based on the headlines of a parsed markdown file in Atom.
This project is based on Darius Morawiec's markdown-toc and the jokinkuang's fork.
Table of Contents
Usage
Open Atom's command
palette
with Ctrl+Shift+P and search for TOC. As alternative, you can use the
Packages > Markdown TOC
menu, which is also available in the right click
contextual menu (Toggle Markdown TOC
).
Commands
md-toc:create
: create the TOC (shortcut is Ctrl+Alt+c)md-toc:update
: update the TOC (shortcut is Ctrl+Alt+u)md-toc:delete
: delete the TOC (shortcut is Ctrl+Alt+r)md-toc:toggle
: toggle the TOC
Installation
apm install md-toc
or
cd ~/.atom/packages
git clone git@github.com:ponsfrilus/md-toc.git
Features
- Auto linking via anchor tags, e.g.
# A 1
→#a-1
- Depth control [1-6] with
depthFrom:1
anddepthTo:6
- Enable or disable links with
withLinks:1
- Refresh list on save with
updateOnSave:1
- Use ordered list (1. ..., 2. ...) with
orderedList:0
- Auto indent when Title not start from
#
- Optional TOC title
## Table of Contents
withtitle:[0,1]
- Soft/Hard tab support with
tabSpaces:4
. 0 for hard others for soft.
Default is@Editor.tabLength
or 2 if not set. - Option to skip 0 to n titles with
skip:[0|n]
- Choose between
-
or*
for unordered list in TOC
Configuration
To change the configuration, change
the value in text (this is the default):
<!-- TOC titleSize:2 tabSpaces:2 depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 skip:0 title:1 charForUnorderedList:* -->
and then update
the TOC (shortcut is Ctrl+Alt+u).
Contributors
Thanks to all contributors for any fix or improvement, whether small or large.
- Darius Morawiec (initial author)
- Giacomo Bresciani
- Kévin Lanceplaine
- Ilya Zelenin
- spjoe
- Tom Byrer
- betrue12
- jokinkuang (main fork)
- ponsfrilus (this repo)
Similar project
Questions?
Don't be shy and feel free to contact me on Twitter.
License
The package is Open Source Software released under the MIT license.