thlorenz / doctoc

📜 Generates table of contents for markdown files inside local git repository. Links are compatible with anchors generated by github or other sites.
https://www.npmjs.com/package/doctoc
MIT License
4.19k stars 479 forks source link

Extra Utilities Proposal #119

Open Bamieh opened 7 years ago

Bamieh commented 7 years ago

Doctoc for sure is a nice tool, however, i'd love if it had a utilities options, described in this tiny proposal, i'm willing to submit a pull request with the features of you guys find it suitable for doctoc and useful enough.

Feature

inside markdown file

# Table of contents
....
<!-- START doctoc:back-to-top -->
<!-- End doctoc:back-to-top -->

generated markdown:

# Table of contents
....
<!-- START doctoc:back-to-top -->
**[:up: Back to top](#table-of-contents)**
<!-- End doctoc:back-to-top -->

How it works

Utilities allow doctoc to be more expandable, allowing it to add markdown navigation in the future or such.

strdr4605 commented 4 years ago

I created a tool that solves this problem: https://github.com/strdr4605/jump2header Maybe you can add a section to README that shows users how to use jump2header with doctoc. But first, we should make sure that tools are compatible.