Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

rehype-sectionize-headings

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rehype-sectionize-headings

Create sections based on h2 and h3 headings in Rehype

latest
Source
npmnpm
Version
1.0.0-rc.1
Version published
Maintainers
1
Created
Source



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

 

Keywords

rehype

FAQs

Package last updated on 07 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts