jquery.tocify.js icon indicating copy to clipboard operation
jquery.tocify.js copied to clipboard

Tocify alternative

Open tscanlin opened this issue 9 years ago • 5 comments

Since Tocify hasn't been updated in 3 years and I needed similar functionality but didn't want to depend on jquery or jquery UI, I have created Tocbot which uses native DOM methods. You can check it out here: http://tscanlin.github.io/tocbot/

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

tscanlin avatar May 11 '16 06:05 tscanlin

加油!

ztmsimon avatar Jul 12 '16 13:07 ztmsimon

大哥,tocbot-master这个下载里面没有tocbot.js、tocbot.css啊? 能否搞简单点啊?

ztmsimon avatar Jul 12 '16 13:07 ztmsimon

If you check the releases page there are compiled files: https://github.com/tscanlin/tocbot/releases

tscanlin avatar Jul 13 '16 04:07 tscanlin

@tscanlin is this a fork of tocify? Do you have migration steps? Thanks

jeremylynch avatar Jul 18 '16 08:07 jeremylynch

No it's not a fork, it is totally separate.

The most important part is to just be sure you initialize the script with the proper selectors:

tocbot.init({
  // Where to render the table of contents.
  tocSelector: '.js-toc',
  // Where to grab the headings to build the table of contents.
  contentSelector: '.js-toc-content',
  // Which headings to grab inside of the contentSelector element.
  headingSelector: 'h1, h2, h3',
});

tscanlin avatar Jul 18 '16 09:07 tscanlin