{"_id":"@benjc/rehype-scroll-to-top","_rev":"4-6328b44da13830f2c662c9ff45105469","name":"@benjc/rehype-scroll-to-top","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@benjc/rehype-scroll-to-top","version":"0.1.0","description":"A Rehype plugin that adds a 'scroll to top' & 'scroll to bottom' links to the page.","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","scripts":{"prebuild":"rimraf dist","build":"tsc","test":"vitest","coverage":"vitest run --coverage","typecheck":"tsc --noEmit","format":"prettier --write ."},"repository":{"type":"git","url":"git+https://github.com/benjamincharity/rehype-scroll-to-top.git"},"keywords":["rehype","rehype-plugin"],"author":{"name":"Benjamin Charity","email":"ben.charity@hey.com","url":"https://www.benjamincharity.com/"},"license":"MIT","bugs":{"url":"https://github.com/benjamincharity/rehype-scroll-to-top/issues"},"homepage":"https://github.com/benjamincharity/rehype-scroll-to-top#readme","devDependencies":{"@types/hast":"^3.0.4","@types/node":"^20.11.16","@vitest/coverage-v8":"^1.2.2","hast-util-to-html":"^9.0.0","hastscript":"^9.0.0","prettier":"^3.2.4","rehype-minify-whitespace":"^6.0.0","rimraf":"^5.0.5","to-vfile":"^8.0.0","typescript":"^5.3.3","vite":"^5.0.12","vitest":"^1.2.2"},"peerDependencies":{"rehype":"^13.0.1","unified":"^11.0.4"},"engines":{"node":">=20.0.0"},"_id":"@benjc/rehype-scroll-to-top@0.1.0","gitHead":"955a5366d912ea0049cb9276f3d44c248f269c43","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-0nKkqg+1DT/DRF3VgqmwQ/xrUjRAewFsTYu9PtMZjL7tS/V0GhtDtIYmMr0Wh8p9+5gR5U9xKl/HBAKkqXX+kw==","shasum":"a43c1ec7d3fc604d9c6d0de156201e80a95feec7","tarball":"https://registry.npmjs.org/@benjc/rehype-scroll-to-top/-/rehype-scroll-to-top-0.1.0.tgz","fileCount":6,"unpackedSize":9583,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjmO53YhhznBtdNjBD+TbwPQk2qoayZgS0t9YqdHuHPAIgdy4Fv+JzUnqCkkN/Z2MRVr5oBewgyFBxsab8M3expKQ="}]},"_npmUser":{"name":"benjamincharity","email":"ben.charity@hey.com"},"directories":{},"maintainers":[{"name":"benjamincharity","email":"ben.charity@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype-scroll-to-top_0.1.0_1706933447581_0.7595311105617124"},"_hasShrinkwrap":false},"0.1.1":{"name":"@benjc/rehype-scroll-to-top","version":"0.1.1","description":"A Rehype plugin that adds a 'scroll to top' & 'scroll to bottom' links to the page.","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","scripts":{"prebuild":"rimraf dist","build":"tsc","test":"vitest","coverage":"vitest run --coverage","typecheck":"tsc --noEmit","format":"prettier --write ."},"repository":{"type":"git","url":"git+https://github.com/benjamincharity/rehype-scroll-to-top.git"},"keywords":["rehype","rehype-plugin"],"author":{"name":"Benjamin Charity","email":"ben.charity@hey.com","url":"https://www.benjamincharity.com/"},"license":"MIT","bugs":{"url":"https://github.com/benjamincharity/rehype-scroll-to-top/issues"},"homepage":"https://github.com/benjamincharity/rehype-scroll-to-top#readme","devDependencies":{"@types/hast":"^3.0.4","@types/node":"^20.11.16","@vitest/coverage-v8":"^1.2.2","hast-util-to-html":"^9.0.0","hastscript":"^9.0.0","prettier":"^3.2.4","rehype-minify-whitespace":"^6.0.0","rimraf":"^5.0.5","to-vfile":"^8.0.0","typescript":"^5.3.3","vite":"^5.0.12","vitest":"^1.2.2"},"peerDependencies":{"rehype":"^13.0.1","unified":"^11.0.4"},"engines":{"node":">=20.0.0"},"_id":"@benjc/rehype-scroll-to-top@0.1.1","gitHead":"947fe1c5a8e8b14b935beee32e7642621fdbbf43","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-DtaJ+sbXA2i46sa5mInhOqXoa3zX0cMMLfczn9NQiJVUVUK9sXe0KHsHpglIOjw9jy7eZGK3YGx6Ti4S488QZw==","shasum":"b3f33ab6b48283964560bec502bea4a407b99b62","tarball":"https://registry.npmjs.org/@benjc/rehype-scroll-to-top/-/rehype-scroll-to-top-0.1.1.tgz","fileCount":6,"unpackedSize":9918,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGgdciEkf7hIDqzcSwx1HJBx6tUUGIYLE9PWdnFCF/vwIhAIAbp8dfkDQ2RhdDXZxVzxFta9j9rQl5qOcCy8W3Q+hr"}]},"_npmUser":{"name":"benjamincharity","email":"ben.charity@hey.com"},"directories":{},"maintainers":[{"name":"benjamincharity","email":"ben.charity@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype-scroll-to-top_0.1.1_1706934151827_0.5142820508275936"},"_hasShrinkwrap":false},"0.1.3":{"name":"@benjc/rehype-scroll-to-top","version":"0.1.3","description":"A Rehype plugin that adds a 'scroll to top' & 'scroll to bottom' links to the page.","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","scripts":{"prebuild":"rimraf dist","build":"tsc","test":"vitest","coverage":"vitest run --coverage","typecheck":"tsc --noEmit","format":"prettier --write ."},"repository":{"type":"git","url":"git+https://github.com/benjamincharity/rehype-scroll-to-top.git"},"keywords":["rehype","rehype-plugin"],"author":{"name":"Benjamin Charity","email":"ben.charity@hey.com","url":"https://www.benjamincharity.com/"},"license":"MIT","bugs":{"url":"https://github.com/benjamincharity/rehype-scroll-to-top/issues"},"homepage":"https://github.com/benjamincharity/rehype-scroll-to-top#readme","devDependencies":{"@types/hast":"^3.0.4","@types/node":"^20.11.16","@vitest/coverage-v8":"^1.2.2","hast-util-to-html":"^9.0.0","hastscript":"^9.0.0","prettier":"^3.2.4","rehype-minify-whitespace":"^6.0.0","rimraf":"^5.0.5","to-vfile":"^8.0.0","typescript":"^5.3.3","vite":"^5.0.12","vitest":"^1.2.2"},"peerDependencies":{"rehype":"^13.0.1","unified":"^11.0.4"},"engines":{"node":">=20.0.0"},"_id":"@benjc/rehype-scroll-to-top@0.1.3","gitHead":"dfc3a2efed2f759ed879e2176e2df5c970e41a03","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-fDnOMopnVHUS1X/3xYQGMKJ5B8aRPuT6g/Cw+OJCmF9/ak6zws4wY/McoW0garJ34V+A8Ejt1iBUNrZ/ee+LmQ==","shasum":"5f1b441935693228deb20bf4ba147b930721cef0","tarball":"https://registry.npmjs.org/@benjc/rehype-scroll-to-top/-/rehype-scroll-to-top-0.1.3.tgz","fileCount":6,"unpackedSize":9924,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1ZEjpnZIGsQGEJ7oSHglhLRiy/DF4Le26HRVzDeZlHAiAaAEO5VsnPfKd9tmfpQoW2+HNdUNgWNwEChRqbJ2BB8w=="}]},"_npmUser":{"name":"benjamincharity","email":"ben.charity@hey.com"},"directories":{},"maintainers":[{"name":"benjamincharity","email":"ben.charity@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype-scroll-to-top_0.1.3_1706935140073_0.8239183159213985"},"_hasShrinkwrap":false},"0.1.4":{"name":"@benjc/rehype-scroll-to-top","version":"0.1.4","description":"A Rehype plugin that adds a 'scroll to top' & 'scroll to bottom' links to the page.","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","scripts":{"prebuild":"rimraf dist","build":"tsc","test":"vitest","coverage":"vitest run --coverage","typecheck":"tsc --noEmit","format":"prettier --write ."},"repository":{"type":"git","url":"git+https://github.com/benjamincharity/rehype-scroll-to-top.git"},"keywords":["rehype","rehype-plugin"],"author":{"name":"Benjamin Charity","email":"ben.charity@hey.com","url":"https://www.benjamincharity.com/"},"license":"MIT","bugs":{"url":"https://github.com/benjamincharity/rehype-scroll-to-top/issues"},"homepage":"https://github.com/benjamincharity/rehype-scroll-to-top#readme","devDependencies":{"@types/hast":"^3.0.4","@types/node":"^20.11.16","@vitest/coverage-v8":"^1.2.2","hast-util-to-html":"^9.0.0","hastscript":"^9.0.0","prettier":"^3.2.4","rehype-minify-whitespace":"^6.0.0","rimraf":"^5.0.5","to-vfile":"^8.0.0","typescript":"^5.3.3","vite":"^5.0.12","vitest":"^1.2.2"},"peerDependencies":{"rehype":"^13.0.0","unified":"^11.0.0"},"engines":{"node":">=18.0.0"},"_id":"@benjc/rehype-scroll-to-top@0.1.4","gitHead":"1798135b909ee121e859c92edd66f0fa7b3e2889","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-TMuKzhLAMHWUcrZOnUlPK3c0QRIU36WXx1TBYwgsNXGktjAb0pUaUNsKUMUvaVIdK9MY4KOMIbjDC/L90D+MBQ==","shasum":"5df281270ff77b03a3a7ca1ba333446c96bd70e4","tarball":"https://registry.npmjs.org/@benjc/rehype-scroll-to-top/-/rehype-scroll-to-top-0.1.4.tgz","fileCount":6,"unpackedSize":10378,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChAdE3pq3p7J54t00yTbldfloS+gv+Ft1xT7Q/ud2kfQIgKF8YktfP8s+wZDpdXnOb40YizWieici7RMeavkWTnlo="}]},"_npmUser":{"name":"benjamincharity","email":"ben.charity@hey.com"},"directories":{},"maintainers":[{"name":"benjamincharity","email":"ben.charity@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype-scroll-to-top_0.1.4_1706938279093_0.5096345318412694"},"_hasShrinkwrap":false},"0.1.5":{"name":"@benjc/rehype-scroll-to-top","version":"0.1.5","description":"A Rehype plugin that adds a 'scroll to top' & 'scroll to bottom' links to the page.","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","scripts":{"prebuild":"rimraf dist","build":"tsc","test":"vitest","coverage":"vitest run --coverage","coverage:types":"type-coverage --min=100","typecheck":"tsc --noEmit","lint":"xo --prettier","lint:fix":"xo --fix --prettier","format":"prettier --write ."},"repository":{"type":"git","url":"git+https://github.com/benjamincharity/rehype-scroll-to-top.git"},"keywords":["rehype","rehype-plugin"],"author":{"name":"Benjamin Charity","email":"ben.charity@hey.com","url":"https://www.benjamincharity.com/"},"license":"MIT","bugs":{"url":"https://github.com/benjamincharity/rehype-scroll-to-top/issues"},"homepage":"https://github.com/benjamincharity/rehype-scroll-to-top#readme","devDependencies":{"@trivago/prettier-plugin-sort-imports":"^4.3.0","@types/hast":"^3.0.4","@types/node":"^20.11.16","@vitest/coverage-v8":"^1.2.2","hast-util-to-html":"^9.0.0","hastscript":"^9.0.0","prettier":"^3.2.4","rehype-minify-whitespace":"^6.0.0","rimraf":"^5.0.5","to-vfile":"^8.0.0","type-coverage":"^2.27.1","typecov":"~0.2.3","typescript":"^5.3.3","vite":"^5.0.12","vitest":"^1.2.2","xo":"~0.56.0"},"peerDependencies":{"rehype":"^13.0.0","unified":"^11.0.0"},"engines":{"node":">=18.0.0"},"_id":"@benjc/rehype-scroll-to-top@0.1.5","gitHead":"46ab8cfb5066d05ce26e76cd89b4306227148213","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-xvTAJa1BpZN6lhuwA1MuxWxdNmu7FozQRfGfAJFiG64jPADhAmNzRf/NegXjOFRhe3CnXWz5VRAW3xLvCbSr/g==","shasum":"53fbaa8bf890bd08dce3cfa7166de741f6e60d13","tarball":"https://registry.npmjs.org/@benjc/rehype-scroll-to-top/-/rehype-scroll-to-top-0.1.5.tgz","fileCount":6,"unpackedSize":10068,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@benjc%2frehype-scroll-to-top@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFfhcc4V608esKt3neIaR9LvLhe9E4Vw0nUTOU26e6bbAiBeVTcBo80iRoXxkUI0C0Ut+Hhz5EO3WBKLzkScggAGdA=="}]},"_npmUser":{"name":"benjamincharity","email":"ben.charity@hey.com"},"directories":{},"maintainers":[{"name":"benjamincharity","email":"ben.charity@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype-scroll-to-top_0.1.5_1707070192226_0.7661512741641243"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-03T04:10:47.499Z","0.1.0":"2024-02-03T04:10:47.865Z","modified":"2024-02-04T18:09:52.838Z","0.1.1":"2024-02-03T04:22:32.024Z","0.1.3":"2024-02-03T04:39:00.216Z","0.1.4":"2024-02-03T05:31:19.285Z","0.1.5":"2024-02-04T18:09:52.392Z"},"maintainers":[{"name":"benjamincharity","email":"ben.charity@hey.com"}],"description":"A Rehype plugin that adds a 'scroll to top' & 'scroll to bottom' links to the page.","homepage":"https://github.com/benjamincharity/rehype-scroll-to-top#readme","keywords":["rehype","rehype-plugin"],"repository":{"type":"git","url":"git+https://github.com/benjamincharity/rehype-scroll-to-top.git"},"author":{"name":"Benjamin Charity","email":"ben.charity@hey.com","url":"https://www.benjamincharity.com/"},"bugs":{"url":"https://github.com/benjamincharity/rehype-scroll-to-top/issues"},"license":"MIT","readme":"# rehype-scroll-to-top\n\n![test workflow](https://github.com/benjamincharity/rehype-scroll-to-top/actions/workflows/test.yml/badge.svg)\n[![codecov](https://codecov.io/gh/benjamincharity/rehype-scroll-to-top/branch/main/graph/badge.svg?token=T3Z18P56LV)](https://codecov.io/gh/benjamincharity/rehype-scroll-to-top)\n\n## Motivation\n\nAllow users to easily scroll to the top or bottom of a page by adding links to the top and bottom of the page.\n\n## Install\n\n```\nnpm i -D @benjc/rehype-scroll-to-top\n```\n\n## Usage\n\n```typescript\nimport rehypeScrollToTop from \"@benjc/rehype-scroll-to-top\";\nimport rehype from \"rehype\";\nimport rehypeParse from \"rehype-parse\";\nimport { unified } from \"unified\";\n\nunified().use(rehypeParse, { fragment: true }).use(rehypeScrollToTop).process(\"<h1>Title</h1><p>Content</p>\");\n\n// Or with options:\nunified()\n  .use(rehypeParse, { fragment: true })\n  .use(rehypeScrollToTop, {\n    topLink: { disabled: true },\n    bottomLink: {\n      text: `Back to top ↑`,\n      classes: \"animated-link-underline\",\n    },\n  })\n  .process(\"<h1>Title</h1><p>Content</p>\");\n```\n\n### Input\n\n```html\n<h1>Title</h1>\n<p>Content</p>\n```\n\n### Output\n\n```html\n<div class=\"scroll-to-wrapper\">\n  <a aria-label=\"Scroll to bottom\" href=\"#bottom\" id=\"top\" class=\"scroll-to scroll-to--top\">Scroll to bottom</a>\n</div>\n<h1>Title</h1>\n<p>Content</p>\n<div class=\"scroll-to-wrapper\">\n  <a aria-label=\"Scroll to top\" href=\"#top\" id=\"bottom\" class=\"scroll-to scroll-to--bottom\">Scroll to top</a>\n</div>\n```\n\n## Options\n\n| Option                 | Type      | Description                         | Default              |\n| ---------------------- | --------- | ----------------------------------- | -------------------- |\n| `topLink.ariaLabel`    | `string`  | Aria label for the top link         | `\"Scroll to bottom\"` |\n| `topLink.classes`      | `string`  | CSS classes for the top link        | `\"\"`                 |\n| `topLink.disabled`     | `boolean` | Whether the top link is disabled    | `false`              |\n| `topLink.id`           | `string`  | ID for the top link                 | `\"top\"`              |\n| `topLink.text`         | `string`  | Text for the top link               | `\"Scroll to bottom\"` |\n| `bottomLink.ariaLabel` | `string`  | Aria label for the bottom link      | `\"Scroll to top\"`    |\n| `bottomLink.classes`   | `string`  | CSS classes for the bottom link     | `\"\"`                 |\n| `bottomLink.disabled`  | `boolean` | Whether the bottom link is disabled | `false`              |\n| `bottomLink.id`        | `string`  | ID for the bottom link              | `\"bottom\"`           |\n| `bottomLink.text`      | `string`  | Text for the bottom link            | `\"Scroll to top\"`    |\n\nThese options can be passed to the `rehype-scroll-to-top` plugin as part of the `options` object. For example:\n\n```typescript\nrehypeScrollToTop({\n  topLink: {\n    ariaLabel: \"Go to bottom\",\n    classes: \"my-custom-class\",\n    disabled: false,\n    id: \"my-top-link\",\n    text: \"Go to bottom\",\n  },\n  bottomLink: {\n    ariaLabel: \"Go to top\",\n    classes: \"my-other-custom-class\",\n    disabled: false,\n    id: \"my-bottom-link\",\n    text: \"Go to top\",\n  },\n});\n```\n\nThis will customize the top and bottom links according to the provided options.\n\n## License\n\n[MIT][license] © [benjamincharity][author]\n\n[license]: license\n[author]: https://www.benjamincharity.com\n","readmeFilename":"README.md"}