JSPM

rehype-sectionize-headings

1.0.0-rc.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 282
  • Score
    100M100P100Q98021F
  • License MIT

Create sections based on h2 and h3 headings in Rehype

Package Exports

  • rehype-sectionize-headings

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rehype-sectionize-headings) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme



rehype-sectionize-headings

Separates headings into sections in Rehype


rehype-sectionize-headings Creates sections based on h2 and h3 headings in Rehype.

Usage

To wrap h2's and h3's:

import wrap from 'rehype-sectionize-headings'

hast = wrap(hast)

Or to specify class names:

hast = wrap(hast, {
  h2: {
    sectionClass: ['h2-section'],
    bodyClass: ['body']
  },
  h3: {
    sectionClass: ['h3-section'],
    bodyClass: ['body']
  }
})

Thanks

rehype-sectionize-headings © 2018+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz