{"id":17242806,"url":"https://github.com/imcuttle/remark-heading-id","last_synced_at":"2025-07-25T11:09:34.350Z","repository":{"id":45113154,"uuid":"172903203","full_name":"imcuttle/remark-heading-id","owner":"imcuttle","description":"The remark plugin for supporting custom heading id","archived":false,"fork":false,"pushed_at":"2023-12-11T10:18:47.000Z","size":309,"stargazers_count":36,"open_issues_count":3,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-16T02:05:53.582Z","etag":null,"topics":["markdown","remark","remark-plugin"],"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/imcuttle.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":"2019-02-27T11:30:35.000Z","updated_at":"2025-05-05T10:55:04.000Z","dependencies_parsed_at":"2023-12-11T10:44:09.166Z","dependency_job_id":null,"html_url":"https://github.com/imcuttle/remark-heading-id","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"d17e3067e58929cf6fdd00ab02d4717cdac68701"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imcuttle/remark-heading-id","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fremark-heading-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fremark-heading-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fremark-heading-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fremark-heading-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/remark-heading-id/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fremark-heading-id/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266997194,"owners_count":24018934,"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-07-25T02:00:09.625Z","response_time":70,"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":["markdown","remark","remark-plugin"],"created_at":"2024-10-15T06:14:07.075Z","updated_at":"2025-07-25T11:09:34.314Z","avatar_url":"https://github.com/imcuttle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remark-heading-id\n\n[![Build status](https://img.shields.io/travis/imcuttle/remark-heading-id/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/remark-heading-id)\n[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/remark-heading-id.svg?style=flat-square)](https://codecov.io/github/imcuttle/remark-heading-id?branch=master)\n[![NPM version](https://img.shields.io/npm/v/remark-heading-id.svg?style=flat-square)](https://www.npmjs.com/package/remark-heading-id)\n[![NPM Downloads](https://img.shields.io/npm/dm/remark-heading-id.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/remark-heading-id)\n[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)\n\n\u003e The remark plugin for supporting [custom heading id](https://www.markdownguide.org/extended-syntax/#heading-ids) and\n\u003e Default Id\n\n### Custom Heading Input\n\n```markdown\n### My Great Heading {#custom-id}\n```\n\n### Custom Heading Output\n\n```html\n\u003ch3 id=\"custom-id\"\u003eMy Great Heading\u003c/h3\u003e\n```\n\n### API\n\nThis package exports no identifiers. The default export is `remarkHeaderId`.\n\n`unified().use(remarkHeadingId[, options])`\n\n#### options\n\nConfiguration (optional).\n\n#### options.defaults\n\nWhether to add default ids based on the title text (boolean, default: false).\n\n#### options.uniqueDefaults\n\nWhether to ensure that the default ids created by options.defaults are unique (boolean, default: true).\nOnly relevant when options.defaults = true.\nExample:\n\n```markdown\n## heading\n\n### introduction\n\n### argument\n\n## heading\n\n### introduction\n\n### argument\n```\n\nWill generate this output when options.defaults = true and options.uniqueDefaults = true:\n\n```html\n\u003ch2 id=\"heading\"\u003eheading\u003c/h2\u003e\n\u003ch3 id=\"indroduction\"\u003eindroduction\u003c/h3\u003e\n\u003ch3 id=\"argument\"\u003eargument\u003c/h3\u003e\n\u003ch2 id=\"heading-1\"\u003eheading\u003c/h2\u003e\n\u003ch3 id=\"introduction-1\"\u003eintroduction\u003c/h3\u003e\n\u003ch3 id=\"argument-1\"\u003eargument\u003c/h3\u003e\n```\n\nInstead of this output, which is generated when options.defaults = true and options.uniqueDefaults = false:\n\n```html\n\u003ch2 id=\"heading\"\u003eheading\u003c/h2\u003e\n\u003ch3 id=\"indroduction\"\u003eindroduction\u003c/h3\u003e\n\u003ch3 id=\"argument\"\u003eargument\u003c/h3\u003e\n\u003ch2 id=\"heading\"\u003eheading\u003c/h2\u003e\n\u003ch3 id=\"introduction\"\u003eintroduction\u003c/h3\u003e\n\u003ch3 id=\"argument\"\u003eargument\u003c/h3\u003e\n```\n\nThe difference being that the last output contains duplicate ids in the generated html, which are avoided using\noptions.uniqueDefaults = true.\n\n##### Default Heading Input\n\n```markdown\n### My Great Heading\n```\n\n##### Default Heading Output\n\n```html\n\u003ch3 id=\"my-great-heading\"\u003eMy Great Heading\u003c/h3\u003e\n```\n\n## Contributing\n\n- Fork it!\n- Create your new branch:  \n  `git checkout -b feature-new` or `git checkout -b fix-which-bug`\n- Start your magic work now\n- Make sure npm test passes\n- Commit your changes:  \n  `git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`\n- Push to the branch: `git push`\n- Submit a pull request :)\n\n## Authors\n\nThis library is written and maintained by imcuttle, \u003ca href=\"mailto:moyuyc95@gmail.com\"\u003emoyuyc95@gmail.com\u003c/a\u003e.\n\n## License\n\nMIT - [imcuttle](https://github.com/imcuttle) 🐟\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fremark-heading-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Fremark-heading-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fremark-heading-id/lists"}