markdown-it plugin to shift headings by given offset.
npm install markdown-it-shift-headings> markdown-it plugin to shift headings by given offset.
With yarn:
``bash`
yarn add markdown-it-shift-headings
With npm:
`bash`
npm install markdown-it-shift-headings --save
`javascript
import MarkdownIt from 'markdown-it'
import shiftHeadings from 'markdown-it-shift-headings'
const content =
new MarkdownIt()
.use(shiftHeadings) // Using default offset: 1
.render(content)
//
Lorem
// Ipsum
// Dolor
// Sit
// Amet
// Consectetur
new MarkdownIt()
.use(shiftHeadings, { offset: 2 }) // Using custom offset: 2
.render(content)
//
Lorem
// Ipsum
// Dolor
// Sit
// Amet
// Consectetur
```