1.1.0 • Published 7 years ago

hexo-toc v1.1.0

Weekly downloads
79
License
MIT
Repository
github
Last release
7 years ago

hexo-toc

MIT License

npm: Package Quality

Insert a markdown TOC(Table Of Content) before posts be rendered.

Unlike the native toc helper, this plugin will inject a TOC only when a placeholder(<!-- toc -->) found in the raw markdown files. And the TOC will be injected after the placeholder.

All you need to do is placing a placeholder(<!-- toc -->) in your post when and where needed.

Note: this plugin will not mangle your posts(markdown files), so you can use it bold.

Install

npm install hexo-toc --save

Options

All the options of markdown-toc, slugify function, and heading anchor options can be specified as follow in you _config.yml:

toc:
  maxdepth: 3
  class: toc
  slugify: transliteration
  decodeEntities: false
  anchor:
    position: after
    symbol: '#'
    style: header-anchor
  • maxdepth: Use headings whose depth is at most maxdepth.
  • class: The CSS Class for the toc. (Default is false)
  • slugify: Choose which slugify function you want to use. Currently support uslug (Default) and transliteration.
  • decodeEntities: Select whether to enable decode entities. ( Default is false and please see #15).
  • anchor: Whether should have an anchor for each headings. (Default is false)
    • position: Where should the anchor be, before the title, or after the title. (Default is after);
    • symbol: Which symbol you want the anchor be. (Default is #);
    • style: The CSS class for the anchor, (Default is header-anchor);

Known issues

#8

Working with hexo-renderer-markdown-it.

# Markdown-it config
## Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki
markdown:
  render:
    html: true

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago