• Packages
  • Themes
  • Documentation
  • Blog
  • Discussions
Sign in

md-toc

Generate TOC (table of contents) of headlines from parsed markdown file
ponsfrilus
0.13.0 591
2
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

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
  • Commands
  • Installation
  • Features
  • Configuration
  • Contributors
  • Similar project
  • Questions?
  • License

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).

Demo

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 and depthTo: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 with title:[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

  • markdown-toc
  • markdown-toc-auto
  • atom-mdtoc

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.

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by