Skip to content

rstacruz/rehype-sectionize-headings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



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

 

About

Creates sections based on h2 and h3 headings in Rehype

Resources

License

Stars

Watchers

Forks

Packages

No packages published