{"id":17141082,"url":"https://github.com/alvinometric/remark-selective-toc","last_synced_at":"2025-08-10T20:08:41.814Z","repository":{"id":195070387,"uuid":"692389969","full_name":"alvinometric/remark-selective-toc","owner":"alvinometric","description":"Remark plugin that lets you create a Table of Contents with individual configurations for each Markdown file","archived":false,"fork":false,"pushed_at":"2023-09-18T22:15:58.000Z","size":51,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T15:00:53.785Z","etag":null,"topics":["remark","remark-plugins"],"latest_commit_sha":null,"homepage":"","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/alvinometric.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-16T10:36:01.000Z","updated_at":"2025-07-08T08:27:53.000Z","dependencies_parsed_at":"2023-09-16T11:32:04.222Z","dependency_job_id":"da96a544-c66e-4d6f-96db-214596d78a37","html_url":"https://github.com/alvinometric/remark-selective-toc","commit_stats":null,"previous_names":["alvinometric/remark-selective-toc"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/alvinometric/remark-selective-toc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinometric%2Fremark-selective-toc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinometric%2Fremark-selective-toc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinometric%2Fremark-selective-toc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinometric%2Fremark-selective-toc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvinometric","download_url":"https://codeload.github.com/alvinometric/remark-selective-toc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinometric%2Fremark-selective-toc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269780617,"owners_count":24474686,"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-10T02:00:08.965Z","response_time":71,"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":["remark","remark-plugins"],"created_at":"2024-10-14T20:24:18.617Z","updated_at":"2025-08-10T20:08:41.787Z","avatar_url":"https://github.com/alvinometric.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remark-selective-toc\n\n\u003c!-- prettier-ignore-start --\u003e\n[![Downloads](https://img.shields.io/npm/dm/remark-selective-toc.svg?style=flat-square)](https://www.npmjs.com/package/remark-selective-toc)\n[![Install size](https://packagephobia.com/badge?p=remark-selective-toc)](https://packagephobia.com/result?p=remark-selective-toc)\n[![version](https://img.shields.io/npm/v/remark-selective-toc.svg?style=flat-square)](https://www.npmjs.com/package/remark-selective-toc)\n[![MIT License](https://img.shields.io/npm/l/remark-selective-toc.svg?style=flat-square)](https://github.com/alvinometric/remark-selective-toc/blob/main/LICENSE)\n\u003c!-- prettier-ignore-end --\u003e\n\nA remark plugin to selectively add a table of contents and configure it for each markdown file. Ported and updated from [`gatsby-remark-table-of-contents`](https://github.com/signalwerk/gatsby-remark-table-of-contents).\n\n````markdown\n\u003c!--\n👇 This code block gets replaced\nwith a TOC of h2 headings only\n--\u003e\n\n```toc\nfrom: 1\nto: 2\n```\n````\n\n## Installation\n\nThis package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).\nIn Node.js (version 16.0+, or 18.0+), install with [npm](https://npmjs.com):\n\n```bash\nnpm install remark-selective-toc\n```\n\n## When should I use this?\n\n- You need more specific control over the TOC, such as excluding certain heading levels.\n- You're working with multiple markdown files that each require different TOC configurations\n- Some of your markdown files don't warrant a TOC at all.\n\n## Options\n\n### `from`\n\n- Type: `number`\n- Default: `2`\n\nSets the minimum heading depth to include.\n\n### `to`\n\n- Type: `number`\n- Default: `6`\n\nSets the maximum heading depth to include.\n\n### `className`\n\n- Type: `string`\n- Default: `toc`\n\nSets the class name of the div wrapping your table of contents.\n\n### `tight`\n\n- Type: `boolean`\n- Default: `false`\n\n`tight` lets you specify whether or not you want spaces before and between the list items.\n\n```markdown\n\u003c!-- tight: true --\u003e\n\n- [Here's an h2](#heres-an-h2)\n\n- [Another h2](#another-h2)\n\n  - [and H3](#and-h3)\n\n\u003c!-- tight: false --\u003e\n\n- [Here's an h2](#heres-an-h2)\n- [Another h2](#another-h2)\n  - [and H3](#and-h3)\n```\n\n### `exclude`\n\n- Type: `string` or `array`\n- Default: `''`\n\nExcludes titles matching this regex pattern.\n\n### `ordered`\n\n- Type: `boolean`\n- Default: `false`\n\nChooses between ordered and unordered list.\n\n## Differences with `gatsby-remark-table-of-contents`\n\n- `tight` is true by default\n- The Gatsby plugin uses `from-heading` and `to-heading` as options. This plugins accepts both these values as well as just `from` and `to`.\n\n## Contributing\n\nFeel free to open issues and pull requests.\n\n## License\n\nMIT License. See `LICENSE` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvinometric%2Fremark-selective-toc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvinometric%2Fremark-selective-toc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvinometric%2Fremark-selective-toc/lists"}