{"id":13911121,"url":"https://github.com/darkmavis1980/markdown-index-generator","last_synced_at":"2026-02-03T02:00:43.083Z","repository":{"id":37437464,"uuid":"271246606","full_name":"darkmavis1980/markdown-index-generator","owner":"darkmavis1980","description":"Parses a MarkDown document and creates an index with links using the document headings","archived":false,"fork":false,"pushed_at":"2025-04-30T10:05:21.000Z","size":1486,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-02T13:55:33.950Z","etag":null,"topics":["cli","generator","markdown","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkmavis1980.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2020-06-10T10:24:51.000Z","updated_at":"2025-04-30T10:05:22.000Z","dependencies_parsed_at":"2025-04-30T11:36:44.897Z","dependency_job_id":null,"html_url":"https://github.com/darkmavis1980/markdown-index-generator","commit_stats":{"total_commits":134,"total_committers":5,"mean_commits":26.8,"dds":"0.24626865671641796","last_synced_commit":"bc9b15889aa42ec2ab29801ee9243b7607930428"},"previous_names":[],"tags_count":77,"template":false,"template_full_name":null,"purl":"pkg:github/darkmavis1980/markdown-index-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkmavis1980%2Fmarkdown-index-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkmavis1980%2Fmarkdown-index-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkmavis1980%2Fmarkdown-index-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkmavis1980%2Fmarkdown-index-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkmavis1980","download_url":"https://codeload.github.com/darkmavis1980/markdown-index-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkmavis1980%2Fmarkdown-index-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265742445,"owners_count":23820842,"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","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":["cli","generator","markdown","typescript"],"created_at":"2024-08-07T00:01:58.373Z","updated_at":"2026-02-03T02:00:42.986Z","avatar_url":"https://github.com/darkmavis1980.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# md-index-generator\n========================\n\nParses a markdown document and creates an index based on headings.\n\n\u003e The h1 heading will be ignored as it should be used only for the main title of the document\n\n[![Version](https://img.shields.io/npm/v/md-index-generator.svg)](https://npmjs.org/package/md-index-generator)\n[![Downloads/week](https://img.shields.io/npm/dw/md-index-generator.svg)](https://npmjs.org/package/md-index-generator)\n[![License](https://img.shields.io/npm/l/md-index-generator.svg)](https://github.com/experimental/markdown-index-generator/blob/master/package.json)\n![Build Status](https://github.com/darkmavis1980/markdown-index-generator/workflows/CI/badge.svg)\n\n## Usage\n\n```sh-session\n$ npm install -g md-index-generator\n$ md-index-generator COMMAND\nrunning command...\n$ md-index-generator (-v|--version|version)\n1.0.0\n\n// Replace the passed markdown file\n$ md-index-generator \u003cMarkDown.md\u003e\n\n// Display the output on the shell\n$ md-index-generator \u003cMarkDown.md\u003e --dry-run\n\n// Store the output in a file\n$ md-index-generator \u003cMARKDOWNFILE.md\u003e --output \u003cIndex.md\u003e\n\n// Generate the index using only h2 and h3 headings\n$ md-index-generator \u003cMarkDown.md\u003e --depth 3\n\n// Set the title of the index, output will start with \"## Docs index\"\n$ md-index-generator \u003cMarkDown.md\u003e --title \"Docs index\"\n```\n\n## Breaking Changes\n\nFrom version `1.x` onward, the logic of the CLI has changed, where by default it replace the index of the source file, while before you had to explicitly use the `--replace` flag to do so. If you want to see the index generated on screen, you must pass the `--dry-run` flag instead.\n\n### Optional flags\n\n`-o, --output \u003cVALUE\u003e` This takes an output file, where the parsed index will be stored instead of being shown in the shell\n\n`-d, --depth \u003cVALUE\u003e` This sets the depth, with a range between 2 and 5, so if sets to 3, it will parse the headings until H3, default value is 4\n\n`-t, --title \u003cVALUE\u003e` This set the title for the index list, by default is set to `Index`\n\n`-r, --dry-run` This flag will show the output on screen, but it will not update the source file\n\n#### Add the index in the source file\n\nIf you wish to modify the file you are passing as a source, you must add the tags `\u003c!-- index-start --\u003e` and `\u003c!-- index-end --\u003e` in the markdown document.\nHere a sample:\n\n```markdown\n# Your Fancy document\n\n\u003c!-- index-start --\u003e\nThe index will go here!\n\u003c!-- index-end --\u003e\n\n## Some more stuff\n\nHello\n```\n\n\u003e If you don't add the index tags, the script will automatically put the index before the first Heading 2 in the document. It is recommended to add the tags to properly control where the index will be added.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkmavis1980%2Fmarkdown-index-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkmavis1980%2Fmarkdown-index-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkmavis1980%2Fmarkdown-index-generator/lists"}