{"id":27314104,"url":"https://github.com/remarkjs/remark-normalize-headings","last_synced_at":"2025-04-12T07:39:27.560Z","repository":{"id":46338385,"uuid":"49028852","full_name":"remarkjs/remark-normalize-headings","owner":"remarkjs","description":"plugin to make sure there is a single top level heading in a document by adjusting heading ranks accordingly","archived":false,"fork":false,"pushed_at":"2023-09-21T07:16:54.000Z","size":91,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-10T20:18:35.051Z","etag":null,"topics":["heading","mdast","normalize","remark","remark-plugin"],"latest_commit_sha":null,"homepage":"https://remark.js.org","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/remarkjs.png","metadata":{"funding":{"github":"unifiedjs","open_collective":"unified"},"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":"2016-01-04T23:09:01.000Z","updated_at":"2024-01-11T23:43:19.000Z","dependencies_parsed_at":"2024-06-18T19:58:37.523Z","dependency_job_id":null,"html_url":"https://github.com/remarkjs/remark-normalize-headings","commit_stats":{"total_commits":91,"total_committers":2,"mean_commits":45.5,"dds":"0.19780219780219777","last_synced_commit":"cc0d63902351d18baf876e2e34901ca76f3be276"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-normalize-headings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-normalize-headings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-normalize-headings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-normalize-headings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkjs","download_url":"https://codeload.github.com/remarkjs/remark-normalize-headings/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248450096,"owners_count":21105617,"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":["heading","mdast","normalize","remark","remark-plugin"],"created_at":"2025-04-12T07:39:26.808Z","updated_at":"2025-04-12T07:39:27.554Z","avatar_url":"https://github.com/remarkjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":[],"sub_categories":[],"readme":"# remark-normalize-headings\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n**[remark][]** plugin to make sure there is a single top level heading in a\ndocument by adjusting heading ranks accordingly.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`unified().use(remarkNormalizeHeadings)`](#unifieduseremarknormalizeheadings)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([remark][]) plugin to ensure there is one top\nlevel heading in a document.\n\n## When should I use this?\n\nThis project is useful if you’re dealing with user generated content and want to\nensure that there is a single primary heading (usually the title of the\ndocument) which everything else falls under.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install remark-normalize-headings\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkNormalizeHeadings from 'https://esm.sh/remark-normalize-headings@4'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import remarkNormalizeHeadings from 'https://esm.sh/remark-normalize-headings@4?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\nSay we have the following file `example.md`:\n\n```markdown\n# Pluto\n\n# History\n\n## Discovery\n\n## Name and symbol\n\n## Planet X disproved\n\n# Orbit\n```\n\n…and a module `example.js`:\n\n```js\nimport {remark} from 'remark'\nimport remarkNormalizeHeadings from 'remark-normalize-headings'\nimport {read} from 'to-vfile'\n\nconst file = await remark()\n  .use(remarkNormalizeHeadings)\n  .process(await read('example.md'))\n\nconsole.log(String(file))\n```\n\n…then running `node example.js` yields:\n\n```markdown\n# Pluto\n\n## History\n\n### Discovery\n\n### Name and symbol\n\n### Planet X disproved\n\n## Orbit\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is\n[`remarkNormalizeHeadings`][api-remark-normalize-headings].\n\n### `unified().use(remarkNormalizeHeadings)`\n\nMake sure there is a single top level heading in a document by adjusting\nheading ranks accordingly.\n\n###### Parameters\n\nThere are no parameters.\n\n###### Returns\n\nTransform ([`Transformer`][unified-transformer]).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`remark-normalize-headings@^4`, compatible with Node.js 16.\n\nThis plugin works with `unified` version 2+ and `remark` version 3+.\n\n## Security\n\nUse of `remark-normalize-headings` does not involve **[rehype][]**\n(**[hast][]**) or user content so there are no openings for\n[cross-site scripting (XSS)][wiki-xss] attacks.\n\n## Related\n\n*   [`mdast-normalize-headings`][mdast-normalize-headings]\n    — mdast utility with similar functionality\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © Eugene Sharygin\n\n[build-badge]: https://github.com/remarkjs/remark-normalize-headings/workflows/main/badge.svg\n\n[build]: https://github.com/remarkjs/remark-normalize-headings/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-normalize-headings.svg\n\n[coverage]: https://codecov.io/github/remarkjs/remark-normalize-headings\n\n[downloads-badge]: https://img.shields.io/npm/dm/remark-normalize-headings.svg\n\n[downloads]: https://www.npmjs.com/package/remark-normalize-headings\n\n[size-badge]: https://img.shields.io/bundlejs/size/remark-normalize-headings\n\n[size]: https://bundlejs.com/?q=remark-normalize-headings\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/remarkjs/remark/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[health]: https://github.com/remarkjs/.github\n\n[contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[hast]: https://github.com/syntax-tree/hast\n\n[mdast-normalize-headings]: https://github.com/syntax-tree/mdast-normalize-headings\n\n[rehype]: https://github.com/rehypejs/rehype\n\n[remark]: https://github.com/remarkjs/remark\n\n[typescript]: https://www.typescriptlang.org\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[api-remark-normalize-headings]: #unifieduseremarknormalizeheadings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-normalize-headings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkjs%2Fremark-normalize-headings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-normalize-headings/lists"}