All Projects → n1k0 → toctoc

n1k0 / toctoc

Licence: other
Generates and maintain a Table of Content for your README.md.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to toctoc

markdown-index
Generate a global index for multiple markdown files recursively
Stars: ✭ 15 (-6.25%)
Mutual labels:  readme, table-of-contents
github-readme-linkedin
📋 A serverless application to get dynamically generated images from your LinkedIn profile on your GitHub READMEs
Stars: ✭ 52 (+225%)
Mutual labels:  readme
ui-names
A collection of good (and bad) ui names.
Stars: ✭ 12 (-25%)
Mutual labels:  readme
github-profile-views-counter
Github new features README profile views counter made with Yii2 framework.
Stars: ✭ 158 (+887.5%)
Mutual labels:  readme
EasyChat
A modular Garry's Mod chat addon for both users and developers.
Stars: ✭ 74 (+362.5%)
Mutual labels:  markup
AkashSingh3031
Akash Singh Portfolio
Stars: ✭ 19 (+18.75%)
Mutual labels:  readme
midudev
This is my personal repo for README. It gets automatically updated to fetch latest videos, photos and articles from my blog.
Stars: ✭ 154 (+862.5%)
Mutual labels:  readme
oasis-open-project
Information relating to the governance of the Open Cybersecurity Alliance (OCA) OASIS Open Project. https://github.com/opencybersecurityalliance
Stars: ✭ 17 (+6.25%)
Mutual labels:  readme
github-readme-streak-stats
🔥 Stay motivated and show off your contribution streak! 🌟 Display your total contributions, current streak, and longest streak on your GitHub profile README
Stars: ✭ 1,395 (+8618.75%)
Mutual labels:  readme
github-readme-twitter
Add Twitter to your github readme
Stars: ✭ 73 (+356.25%)
Mutual labels:  readme
github-orgmode-tests
This is a test project where you can explore how github interprets Org-mode files
Stars: ✭ 126 (+687.5%)
Mutual labels:  markup
rdme
ReadMe's official CLI and GitHub Action
Stars: ✭ 44 (+175%)
Mutual labels:  readme
sharannyobasu
Sharannyo Basu's profile
Stars: ✭ 13 (-18.75%)
Mutual labels:  readme
awesome-kramdown
A collection of awesome kramdown goodies for the converter for (structured) text with formatting markup in markdown conventions
Stars: ✭ 36 (+125%)
Mutual labels:  markup
init-readme
An opinionated README.md generator for npm utility packages
Stars: ✭ 12 (-25%)
Mutual labels:  readme
ouuan
A profile README with 86 stars and 152 forks 🌟
Stars: ✭ 86 (+437.5%)
Mutual labels:  readme
profile-readme
🗣 Display profile activity and other cool widgets in your profile README.md
Stars: ✭ 49 (+206.25%)
Mutual labels:  readme
awesome-bd-readme-profile
😎 A list of awesome Github Profile READMEs of developers 📝
Stars: ✭ 69 (+331.25%)
Mutual labels:  readme
SelimHorri
WhoAmI ?
Stars: ✭ 29 (+81.25%)
Mutual labels:  readme
Mindula-Dilthushan
I am Mindula Dilthushan Manamperi 😋
Stars: ✭ 23 (+43.75%)
Mutual labels:  readme

toctoc

Generates and maintain a Table of Content for any Markdown document, especially README.md files hosted on github.

Table of Contents


Installation

Globally

$ npm install -g toctoc

Locally

$ npm install toctoc --save-dev

Setup

The program will scan the passed file contents and look for TOC placeholder, which must follow this format:

  ## Table of Contents

  ---

Note the <hr/> tag (--- in Markdown) at the end of the block.

Usage

$ toctoc README.md

By default, this command outputs the modified file contents with the TOC markdown added. You can overwrite the original file by using the -w option:

$ toctoc README.md -w

If a TOC was previously generated for this file, its previous version will be replaced with the new one.

$ toctoc docs/**/*.md -w 

You can use a glob pattern or a directory to match multiple files at once.

$ toctoc doc -w -e MD

If you use a directory, the file extensions searched is .md, if you wish to use a different file extension for markdown, use -e option.

Custom TOC heading

By default the TOC is generated using the Table of Contents heading. You can specify a custom one by using the -t option:

$ toctoc -w README.md -t="My custom TOC title"

Just ensure to update your source file to use this new heading, so the executable can find and replace the appropriate TOC section.

Max TOC depth

By default, the generated TOC will expose links to the deepest subsections of the document; to limit the maximum crawling depth, use the -d option:

$ toctoc README.md -w -d 2

Soft TOC

By default, it will fail with an error if the targeted file(s) do not have any TOC. To remove this limitation, use -s option:

$ toctoc docs/**/*.md -w -s

Directory

By default, toctoc will use a .md extension if used with a directory. You can customise the extension to be founds by passing -e option.

$ toctoc docs -w -s -e .MD

For the adventurous

It's possible to automate updating the README in a package.json prepublish command, so you're sure your npm package homepage is always updated with the right TOC when released:

  "scripts": {
    "prepublish": "./node_modules/.bin/toctoc README.md -d 2 -w"
  },

License

MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].