https://github.com/t9md/atom-markdown-toc-auto
auto insert and update table of contents on save
https://github.com/t9md/atom-markdown-toc-auto
atom markdown-toc
Last synced: 2 months ago
JSON representation
auto insert and update table of contents on save
- Host: GitHub
- URL: https://github.com/t9md/atom-markdown-toc-auto
- Owner: t9md
- License: mit
- Created: 2016-08-28T17:41:19.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-08-21T09:17:03.000Z (almost 5 years ago)
- Last Synced: 2025-03-20T17:38:58.307Z (2 months ago)
- Topics: atom, markdown-toc
- Language: JavaScript
- Homepage: https://atom.io/packages/markdown-toc-auto
- Size: 65.4 KB
- Stars: 12
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# markdown-toc-auto [](https://travis-ci.org/t9md/atom-markdown-toc-auto)
Automatically update table of contents for GitHub wiki.

# Features
- Insert TOC
- Automatically update TOC on editor save.
- Customizable `max` and `min` level of header to use. auto `update`, inlucde `link` or not.
- Extract only markdown header by using Atom's scope descriptor used in syntax highlight(So ignore `#` in embedded code in markdown).
- Generate link for GitHub wiki
- Remove invalid char for link
- Extract inner text(`xxx`) from `xxx` tag and use in link.# How to use
1. Open markdown editor
2. From command-palette, invoke "Markdown Toc Auto: Insert Toc". TOC is inserted at cursor position.
3. Each time you save editor, TOC is automatically updated.
4. [Optional] You can change following TOC options to control toc generation.
- `min`, `max`: From `min` to `max` level headers are subject to generate.
- `update`: If `true`, automatically updated on save.
- `link`: If `false`, link are not generated.# Commands
- `markdown-toc-auto:insert-toc`: Insert TOC on cursor position.
- `markdown-toc-auto:insert-toc-at-top`: Insert TOC on top of buffer.# Limitation
- Currently only `source gfm` editor is supported.
- And only checked with GitHub Wiki.
- Header style must start with `#`.# Why I created yet another package?
- As exercise.
- Wanted to correctly ignore embedded code's comment `#`.
- Wanted to generate valid link in github wiki(for [vim-mode-plus](https://atom.io/packages/vim-mode-plus)'s wiki).# Similar project
- [markdown-toc](https://atom.io/packages/markdown-toc)
- [atom-mdtoc](https://atom.io/packages/atom-mdtoc)