{"id":15693985,"url":"https://github.com/jonschlinkert/gulp-markdown-toc","last_synced_at":"2025-08-03T23:41:30.754Z","repository":{"id":57258186,"uuid":"82505835","full_name":"jonschlinkert/gulp-markdown-toc","owner":"jonschlinkert","description":"Gulp plugin for markdown-toc. Generate a markdown table of contents for one or more markdown files, and an optional index for multiple files.","archived":false,"fork":false,"pushed_at":"2017-07-08T18:55:15.000Z","size":12,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-14T15:07:10.853Z","etag":null,"topics":["gulp","gulpplugin","markdown","md","table-of-contents","toc"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-20T01:57:29.000Z","updated_at":"2022-05-07T08:42:17.000Z","dependencies_parsed_at":"2022-08-25T19:12:34.635Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/gulp-markdown-toc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jonschlinkert/gulp-markdown-toc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-markdown-toc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-markdown-toc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-markdown-toc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-markdown-toc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/gulp-markdown-toc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-markdown-toc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268629769,"owners_count":24281172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gulp","gulpplugin","markdown","md","table-of-contents","toc"],"created_at":"2024-10-03T18:50:57.593Z","updated_at":"2025-08-03T23:41:30.705Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","readme":"# gulp-markdown-toc [![NPM version](https://img.shields.io/npm/v/gulp-markdown-toc.svg?style=flat)](https://www.npmjs.com/package/gulp-markdown-toc) [![NPM monthly downloads](https://img.shields.io/npm/dm/gulp-markdown-toc.svg?style=flat)](https://npmjs.org/package/gulp-markdown-toc) [![NPM total downloads](https://img.shields.io/npm/dt/gulp-markdown-toc.svg?style=flat)](https://npmjs.org/package/gulp-markdown-toc) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/gulp-markdown-toc.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/gulp-markdown-toc)\n\n\u003e Gulp plugin for markdown-toc. Generate a markdown table of contents for one or more markdown files, and an optional index for multiple files.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save gulp-markdown-toc\n```\n\n## Usage\n\n```js\nvar gulp = require('gulp');\nvar toc = require('gulp-markdown-toc');\n\ngulp.task('toc', function() {\n  return gulp.src('*.md')\n    .pipe(toc())\n    .pipe(gulp.dest('.'));\n});\n```\n\n**Heads up!**\n\nAdd the following to markdown file where you want a Table of Contents to be injected:\n\n```\n\u003c!-- toc --\u003e\n```\n\n## Options\n\nIn addition to the following plugin options, all [markdown-toc](https://github.com/jonschlinkert/markdown-toc) options are supported as well. See that library for additional details.\n\n### options.index\n\n**Type:** `{Boolean|String|Function}`\n\n**Default:** `undefined`\n\nGenerate a Table of Contents index file. _If `options.index` is left undefined, an index file will not be generated._\n\n```js\n// generates a file named `toc.md`\ntoc({index: true})\n\n// specify the name of the index file\ntoc({index: 'foo.md'})\n\n// customize the destination and file path of the index file\ntoc({\n  index: function(file) {\n    file.basename = 'whatever.md';\n    return 'blah';\n  }\n})\n```\n\n### options.filterFiles\n\n**Type:** `{Function}`\n\n**Default:** `undefined`\n\nFilter the files to be included in the TOC index.\n\n```js\ntoc({\n  filter: function(file) {\n    return file.relative !== 'foo.md';\n  }\n})\n```\n\n### options.sortFiles\n\n**Type:** `{Function}`\n\n**Default:** `undefined`\n\nPass a compare function for sorting the files to be included in the TOC index.\n\n```js\ntoc({\n  sort: function(fileA, fileB) {\n    // fileA and fileB are vinyl files\n    return fileA.relative \u003c fileB.relative;\n  }\n})\n```\n\n### options.headingName\n\n```\n## [headingName](#headingLink)\n```\n\n**Type:** `{Function}`\n\n**Default:** `undefined`\n\nCustomize heading names.\n\n```js\ntoc({\n  headingName: function(name) {\n    // do stuff to name\n    return name;\n  }\n})\n```\n\n### options.headingLink\n\n```\n## [headingName](#headingLink)\n```\n\n**Type:** `{Function}`\n\n**Default:** `undefined`\n\nCustomize heading links.\n\n```js\ntoc({\n  headingLink: function(link) {\n    // do stuff to link\n    return link;\n  }\n})\n```\n\n## About\n\n### Related projects\n\n* [gulp-format-md](https://www.npmjs.com/package/gulp-format-md): Gulp plugin for beautifying markdown using pretty-remarkable. | [homepage](https://github.com/jonschlinkert/gulp-format-md \"Gulp plugin for beautifying markdown using pretty-remarkable.\")\n* [markdown-toc](https://www.npmjs.com/package/markdown-toc): Generate a markdown TOC (table of contents) with Remarkable. | [homepage](https://github.com/jonschlinkert/markdown-toc \"Generate a markdown TOC (table of contents) with Remarkable.\")\n* [remarkable](https://www.npmjs.com/package/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in… [more](https://github.com/jonschlinkert/remarkable) | [homepage](https://github.com/jonschlinkert/remarkable \"Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 08, 2017._","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fgulp-markdown-toc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fgulp-markdown-toc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fgulp-markdown-toc/lists"}