{"_id":"@avgvstvs96/remark-sectionize","_rev":"7-6a40c114527e808208483ef9af3af8c6","name":"@avgvstvs96/remark-sectionize","dist-tags":{"latest":"2.1.3"},"versions":{"2.0.0":{"name":"@avgvstvs96/remark-sectionize","version":"2.0.0","keywords":["remark","plugin","markdown","html","section"],"author":{"name":"Jake Low","email":"hello@jakelow.com"},"license":"MIT","_id":"@avgvstvs96/remark-sectionize@2.0.0","maintainers":[{"name":"avgvstvs96","email":"bassim101@gmail.com"}],"homepage":"https://github.com/avgvstvs96/remark-sectionize#readme","bugs":{"url":"https://github.com/avgvstvs96/remark-sectionize/issues"},"dist":{"shasum":"47315f18bd4bb1aefcdbcea20c5cabacf6ac5023","tarball":"https://registry.npmjs.org/@avgvstvs96/remark-sectionize/-/remark-sectionize-2.0.0.tgz","fileCount":9,"integrity":"sha512-YPX4/PVh09Zisr//l2Rp98HjoLCr5yN5+EZC8OdyZuBbyuw2kOuBHXCaSMyKJglYGb2KOl3xk3JVAnzKqjyVUw==","signatures":[{"sig":"MEUCIEgvCl6rfTKaZtcW2tyvDeL2xluRE0Ktudp6Kwuu6RFrAiEA8I+T7rWiPKbMPHeFt5x8DiU6n1LZfxI9kQUn62lX4ac=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12659},"main":"index.js","type":"module","types":"index.d.ts","gitHead":"81ba691663048831c33945136be37c1ef7d32975","private":false,"scripts":{"test":"node test.js | npx tap-spec","test-ts":"tsc --noEmit remark-sectionize-test.ts"},"_npmUser":{"name":"avgvstvs96","email":"bassim101@gmail.com"},"repository":{"url":"git+https://github.com/avgvstvs96/remark-sectionize.git","type":"git"},"_npmVersion":"10.2.4","description":"Wrap content below each heading in a <section> element","directories":{},"_nodeVersion":"21.6.1","dependencies":{"ts-node":"^10.9.2","@types/tape":"^5.6.4","@types/dedent":"^0.7.2","unist-util-visit":"^4.1.2","unist-util-find-after":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^5.6.3","dedent":"^0.7.0","remark":"^14.0.3","unist-builder":"^3.0.1","unist-util-remove-position":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/remark-sectionize_2.0.0_1708917949129_0.8357389334033904","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.0.1":{"name":"@avgvstvs96/remark-sectionize","version":"2.0.1","keywords":["remark","plugin","markdown","html","section"],"author":{"name":"Jake Low","email":"hello@jakelow.com"},"license":"MIT","_id":"@avgvstvs96/remark-sectionize@2.0.1","maintainers":[{"name":"avgvstvs96","email":"bassim101@gmail.com"}],"homepage":"https://github.com/avgvstvs96/remark-sectionize#readme","bugs":{"url":"https://github.com/avgvstvs96/remark-sectionize/issues"},"dist":{"shasum":"489b3e9ea2860eeb0b037df79b091585b054eb73","tarball":"https://registry.npmjs.org/@avgvstvs96/remark-sectionize/-/remark-sectionize-2.0.1.tgz","fileCount":9,"integrity":"sha512-ibGYeKVpGO2Y1Arfnc4lWJ8x7tFyksoy6etQl427L7o1h+F13Mm49CXtL8u//s/8xKHATSF8ioHDEKYwaci40g==","signatures":[{"sig":"MEUCIQCkMyXVksdQvOaMUiTelwluh6l/0sP7VGz1E9ykJsE6+gIga2c4/jVgH4Fdk4ttTzikw9mONWKP5iSoMXXh4JVp3d0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12665},"main":"index.js","type":"module","types":"index.d.ts","gitHead":"d5597748852adb61ec8f7c360050876900b1e7e7","private":false,"scripts":{"test":"node test.js | npx tap-spec","test-ts":"tsc --noEmit remark-sectionize-test.ts"},"_npmUser":{"name":"avgvstvs96","email":"bassim101@gmail.com"},"repository":{"url":"git+https://github.com/avgvstvs96/remark-sectionize.git","type":"git"},"_npmVersion":"10.2.4","description":"Wrap content below each heading in a <section> element","directories":{},"_nodeVersion":"21.6.1","dependencies":{"ts-node":"^10.9.2","@types/tape":"^5.6.4","@types/dedent":"^0.7.2","unist-util-visit":"^4.1.2","unist-util-find-after":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^5.6.3","dedent":"^0.7.0","remark":"^14.0.3","unist-builder":"^3.0.1","unist-util-remove-position":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/remark-sectionize_2.0.1_1717755329425_0.471332384069689","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.1.0":{"name":"@avgvstvs96/remark-sectionize","version":"2.1.0","keywords":["remark","plugin","markdown","html","section"],"author":{"name":"Jake Low","email":"hello@jakelow.com"},"license":"MIT","_id":"@avgvstvs96/remark-sectionize@2.1.0","maintainers":[{"name":"avgvstvs96","email":"bassim101@gmail.com"}],"contributors":[{"url":"https://github.com/avgvstvs96","name":"Bassim Shahidy","email":"bassim@shahidy.com"},{"url":"https://github.com/Dahmon","name":"github:Dahmon"},{"url":"https://github.com/nd0ut","name":"github:nd0ut"},{"url":"https://github.com/shogotsuneto","name":"github:shogotsuneto"},{"url":"https://github.com/CanRau","name":"github:CanRau"}],"homepage":"https://github.com/avgvstvs96/remark-sectionize#readme","bugs":{"url":"https://github.com/avgvstvs96/remark-sectionize/issues"},"dist":{"shasum":"f76df876f545079cbfa59ab55a2c1112f9920aad","tarball":"https://registry.npmjs.org/@avgvstvs96/remark-sectionize/-/remark-sectionize-2.1.0.tgz","fileCount":14,"integrity":"sha512-gHkAY1tuyNps+5uKIYrmPwGnsSUHd/rxxEhtQ4Y56diF+p32eVHTnzY67KP6n1DSyKfeJKsQPv0twiPJSmJKnA==","signatures":[{"sig":"MEQCIGM5KkmJMvMKjBPg9OJqVm9hMOLZHzwSUx5Rt4sHj1cMAiArWXSFu01Wlp8z4Jh6wzX0YyeFCxZ5xpXLlkUeco2+6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18879},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"20b015b21284e5fdc3130ca01b5bce8f0a27ddc6","private":false,"scripts":{"dev":"tsup --watch","test":"tsup && node test.js | npx tap-spec","build":"tsup"},"_npmUser":{"name":"avgvstvs96","email":"bassim101@gmail.com"},"repository":{"url":"git+https://github.com/avgvstvs96/remark-sectionize.git","type":"git"},"_npmVersion":"10.2.4","description":"Wrap content below each heading in a <section> element","directories":{},"resolutions":{"@types/unist":"3.0.2"},"_nodeVersion":"21.6.1","dependencies":{"unist-util-visit":"^4.1.2","unist-util-find-after":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^5.6.3","tsup":"^8.2.4","biome":"^0.3.3","dedent":"^0.7.0","remark":"^14.0.3","typescript":"^5.5.4","@types/tape":"^5.6.4","@types/unist":"^3.0.2","@types/dedent":"^0.7.2","unist-builder":"^3.0.1","unist-util-remove-position":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/remark-sectionize_2.1.0_1723337062258_0.5845923326372082","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.1.1":{"name":"@avgvstvs96/remark-sectionize","version":"2.1.1","keywords":["remark","plugin","markdown","html","section"],"author":{"name":"Jake Low","email":"hello@jakelow.com"},"license":"MIT","_id":"@avgvstvs96/remark-sectionize@2.1.1","maintainers":[{"name":"avgvstvs96","email":"bassim101@gmail.com"}],"contributors":[{"url":"https://github.com/avgvstvs96","name":"Bassim Shahidy","email":"bassim@shahidy.com"},{"url":"https://github.com/Dahmon","name":"github:Dahmon"},{"url":"https://github.com/nd0ut","name":"github:nd0ut"},{"url":"https://github.com/shogotsuneto","name":"github:shogotsuneto"},{"url":"https://github.com/CanRau","name":"github:CanRau"}],"homepage":"https://github.com/avgvstvs96/remark-sectionize#readme","bugs":{"url":"https://github.com/avgvstvs96/remark-sectionize/issues"},"dist":{"shasum":"827e370960badc818c52cc38f0f82dfa1085021a","tarball":"https://registry.npmjs.org/@avgvstvs96/remark-sectionize/-/remark-sectionize-2.1.1.tgz","fileCount":13,"integrity":"sha512-8ZRXxTxZC+1B+D9eATn+Qnl0uNNDYfPTS26MAklPPRoJsTBgQKgKFEgnDp5UQyIwOM+A4JMetUdUCUrv8IEt3w==","signatures":[{"sig":"MEUCIA8utA0rWliA67Gg6vNVmtzZhHVmrwZjArK2PhDkQIeGAiEAzTkIDLkIhvr77XhVWC01HDGPa9OAHXI/KKNn8+Qovms=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18382},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"965137bfdff76e67dc172139a4cd0f4aba3c95fd","private":false,"scripts":{"dev":"tsup --watch","test":"tsup && node test.js | npx tap-spec","build":"tsup"},"_npmUser":{"name":"avgvstvs96","email":"bassim101@gmail.com"},"repository":{"url":"git+https://github.com/avgvstvs96/remark-sectionize.git","type":"git"},"_npmVersion":"10.2.4","description":"Wrap content below each heading in a <section> element","directories":{},"resolutions":{"@types/unist":"3.0.2"},"_nodeVersion":"21.6.1","dependencies":{"unist-util-visit":"^4.1.2","unist-util-find-after":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^5.6.3","tsup":"^8.2.4","biome":"^0.3.3","dedent":"^0.7.0","remark":"^14.0.3","typescript":"^5.5.4","@types/tape":"^5.6.4","@types/unist":"^3.0.2","@types/dedent":"^0.7.2","unist-builder":"^3.0.1","unist-util-remove-position":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/remark-sectionize_2.1.1_1723339230722_0.1905620609091616","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.1.2":{"name":"@avgvstvs96/remark-sectionize","version":"2.1.2","keywords":["remark","plugin","markdown","html","section"],"author":{"name":"Jake Low","email":"hello@jakelow.com"},"license":"MIT","_id":"@avgvstvs96/remark-sectionize@2.1.2","maintainers":[{"name":"avgvstvs96","email":"bassim101@gmail.com"}],"contributors":[{"url":"https://github.com/avgvstvs96","name":"Bassim Shahidy","email":"bassim@shahidy.com"},{"url":"https://github.com/Dahmon","name":"github:Dahmon"},{"url":"https://github.com/nd0ut","name":"github:nd0ut"},{"url":"https://github.com/shogotsuneto","name":"github:shogotsuneto"},{"url":"https://github.com/CanRau","name":"github:CanRau"}],"homepage":"https://github.com/avgvstvs96/remark-sectionize#readme","bugs":{"url":"https://github.com/avgvstvs96/remark-sectionize/issues"},"dist":{"shasum":"591a21522bcff043f9f82d5064d1e295e6bdae5c","tarball":"https://registry.npmjs.org/@avgvstvs96/remark-sectionize/-/remark-sectionize-2.1.2.tgz","fileCount":6,"integrity":"sha512-cYvY+WB89j+jI+Ujjys18ESHYgqEBFuAjPE24zaiYwJPhZBGXHIbD/h2rCQE3rprdpuuj93yfpwAsEbWMaEMVA==","signatures":[{"sig":"MEUCIAqmKqmOTljQPd0X17ZuGbaIGPHoGECc7OUe4ybl0/pkAiEAit5txLm7L4qkW3XpBiA4EccjcauqqzmHcK7eknKIPX0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9334},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"21658508340f8baa88514135fcccdda25852399c","private":false,"scripts":{"dev":"tsup --watch","test":"tsup && node test.js | npx tap-spec","build":"tsup"},"_npmUser":{"name":"avgvstvs96","email":"bassim101@gmail.com"},"repository":{"url":"git+https://github.com/avgvstvs96/remark-sectionize.git","type":"git"},"_npmVersion":"10.2.4","description":"Wrap content below each heading in a <section> element","directories":{},"resolutions":{"@types/unist":"3.0.2"},"_nodeVersion":"21.6.1","dependencies":{"unist-util-visit":"^4.1.2","unist-util-find-after":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^5.6.3","tsup":"^8.2.4","biome":"^0.3.3","dedent":"^0.7.0","remark":"^14.0.2","typescript":"^5.5.4","@types/tape":"^5.6.4","@types/unist":"^3.0.2","@types/dedent":"^0.7.2","unist-builder":"^3.0.1","unist-util-remove-position":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/remark-sectionize_2.1.2_1723353373613_0.9276679733528861","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.1.3":{"name":"@avgvstvs96/remark-sectionize","version":"2.1.3","keywords":["remark","plugin","markdown","html","section"],"author":{"name":"Jake Low","email":"hello@jakelow.com"},"license":"MIT","_id":"@avgvstvs96/remark-sectionize@2.1.3","maintainers":[{"name":"avgvstvs96","email":"bassim101@gmail.com"}],"contributors":[{"url":"https://github.com/avgvstvs96","name":"Bassim Shahidy","email":"bassim@shahidy.com"},{"url":"https://github.com/Dahmon","name":"github:Dahmon"},{"url":"https://github.com/nd0ut","name":"github:nd0ut"},{"url":"https://github.com/shogotsuneto","name":"github:shogotsuneto"},{"url":"https://github.com/CanRau","name":"github:CanRau"}],"homepage":"https://github.com/avgvstvs96/remark-sectionize#readme","bugs":{"url":"https://github.com/avgvstvs96/remark-sectionize/issues"},"dist":{"shasum":"547df3140160270f66b7727e968c4baeaefbfaa0","tarball":"https://registry.npmjs.org/@avgvstvs96/remark-sectionize/-/remark-sectionize-2.1.3.tgz","fileCount":3,"integrity":"sha512-5M/Z+8hW9US6/a+PfwC8mzpVFDjIpQzP9cDS1UdAN8XDCca33UxbjesNMyxuDR0ADurg3ClVsfMT3exYoM/t6g==","signatures":[{"sig":"MEYCIQCiMNe9vVPhaUAA503XhtX6MBgR7tteFe9vhf3jTZa71AIhAKrEtyLB03BWNEAMrTNNVRFO0ELFT2IKg+PfBWy7gpmG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5725},"main":"dist/index.js","type":"module","_from":"file:avgvstvs96-remark-sectionize-2.1.3.tgz","types":"dist/index.d.ts","private":false,"scripts":{"dev":"tsup --watch","test":"tsup && node test.js | npx tap-spec","build":"tsup"},"_npmUser":{"name":"avgvstvs96","email":"bassim101@gmail.com"},"_resolved":"/tmp/7b28504796d1b5d9ab78293f64bed368/avgvstvs96-remark-sectionize-2.1.3.tgz","_integrity":"sha512-5M/Z+8hW9US6/a+PfwC8mzpVFDjIpQzP9cDS1UdAN8XDCca33UxbjesNMyxuDR0ADurg3ClVsfMT3exYoM/t6g==","repository":{"url":"git+https://github.com/avgvstvs96/remark-sectionize.git","type":"git"},"_npmVersion":"10.9.0","description":"Wrap content below each heading in a <section> element","directories":{},"resolutions":{"@types/unist":"3.0.2"},"_nodeVersion":"22.11.0","dependencies":{"unist-util-visit":"^4.1.2","unist-util-find-after":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^5.6.3","tsup":"^8.2.4","biome":"^0.3.3","dedent":"^0.7.0","remark":"^14.0.2","unified":"^11.0.5","typescript":"^5.5.4","@types/tape":"^5.6.4","@types/unist":"^3.0.2","@types/dedent":"^0.7.2","unist-builder":"^3.0.1","unist-util-remove-position":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/remark-sectionize_2.1.3_1738784719180_0.7305612784397699","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2024-02-26T03:25:49.026Z","modified":"2026-02-08T22:08:59.191Z","2.0.0":"2024-02-26T03:25:49.298Z","2.0.1":"2024-06-07T10:15:29.623Z","2.1.0":"2024-08-11T00:44:22.434Z","2.1.1":"2024-08-11T01:20:30.896Z","2.1.2":"2024-08-11T05:16:13.780Z","2.1.3":"2025-02-05T19:45:19.373Z"},"bugs":{"url":"https://github.com/avgvstvs96/remark-sectionize/issues"},"author":{"name":"Jake Low","email":"hello@jakelow.com"},"license":"MIT","homepage":"https://github.com/avgvstvs96/remark-sectionize#readme","keywords":["remark","plugin","markdown","html","section"],"repository":{"url":"git+https://github.com/avgvstvs96/remark-sectionize.git","type":"git"},"description":"Wrap content below each heading in a <section> element","contributors":[{"url":"https://github.com/avgvstvs96","name":"Bassim Shahidy","email":"bassim@shahidy.com"},{"url":"https://github.com/Dahmon","name":"github:Dahmon"},{"url":"https://github.com/nd0ut","name":"github:nd0ut"},{"url":"https://github.com/shogotsuneto","name":"github:shogotsuneto"},{"url":"https://github.com/CanRau","name":"github:CanRau"}],"maintainers":[{"name":"avgvstvs96","email":"bassim101@gmail.com"}],"readme":"\n> This is an experimental fork of Jake Low's [remark-sectionize](https://github.com/jake-low/remark-sectionize), converted to TypeScript as an exercise while I learn it. As of 11/18/24, the original project has added minimal types, which are more correct for a simple plugin like this that doesn't require strict type checking. Therefore, the original version of this package is recommended over this experimental fork.\n\n\n# remark-sectionize\n\nThis is a [remark](https://github.com/remarkjs/remark) plugin to wrap each\nheading and the content that follows it in a `<section>` tag, allowing you to\nstyle the document sections using CSS.\n\n## Example\n\nWhen using `remark-sectionize`, given the following markdown:\n\n```md\n# Forest elephants\n\n## Introduction\n\nIn this section, we discuss the lesser known forest elephants.\n\n## Habitat\n\nForest elephants do not live in trees but among them.\n```\n\n...remark will output the following HTML:\n\n```html\n<section>\n  <h1>Forest elephants</h1>\n  <section>\n    <h2>Introduction</h2>\n    <p>In this section, we discuss the lesser known forest elephants.</p>\n  </section>\n  <section>\n    <h2>Habitat</h2>\n    <p>Forest elephants do not live in trees but among them.</p>\n  </section>\n</section>\n```\n\nOne use case of this plugin is to permit the logical sections of a document to\nbe targeted and styled using CSS. For example, you could do something like\nthis:\n\n```css\nsection > section:nth-child(even) {\n  background-color: white;\n}\n\nsection > section:nth-child(odd) {\n  background-color: papayawhip;\n}\n```\n\nTo give the `h2`-level sections alternating background colors.\n\n## Usage\n\nIf you are invoking `remark` (or `unified`) in JavaScript, you can add this\nplugin by calling `use()`:\n\n```js\nimport { remark } from 'remark'\nimport html from 'remark-html'\nimport sectionize from 'remark-sectionize'\n\nconst input = `\n# Hello world!\n\nThe above heading and this paragraph will be wrapped in a <section> tag.\n`\n\nremark()\n  .use(sectionize)\n  .use(html, { sanitize: false })\n  .process(input, (err, file) => {\n    if (err) {\n      console.error(err)\n    } else {\n      console.log(String(file))\n    }\n  })\n```\n\nIf you're using remark from the CLI, you can use sectionize via the `--use`\nargument:\n\n```\n$ remark --use sectionize example.md\n```\n\nNote that for the above to work, `remark-sectionize` needs to be installed\nsomewhere that `remark` can find.\n\nFinally, if you're using Webpack and\n[mdx-loader](https://www.npmjs.com/package/mdx-loader) to import markdown files\nfrom JS, you can modify the loader options in your webpack config file, adding\n`sectionize` to your `mdPlugins` list (something like the following):\n\n```js\nimport sectionize from 'remark-sectionize'\n\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.(md|mdx|markdown)$/,\n        use: [\n          {\n            loader: \"babel-loader\",\n            options: {\n              presets: [\"@babel/preset-react\"]\n            }\n          },\n          {\n            loader: \"mdx-loader\",\n            options: {\n              mdPlugins: [sectionize]\n            }\n          }\n        ]\n      }\n    ]\n  }\n};\n```\n\n## License\n\nThis repository is licensed under the MIT license; see the LICENSE file for details.\n","readmeFilename":"README.md"}