Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliendargelos/markdown-it-shift-headings
markdown-it plugin to shift headings by given offset.
https://github.com/juliendargelos/markdown-it-shift-headings
Last synced: 18 days ago
JSON representation
markdown-it plugin to shift headings by given offset.
- Host: GitHub
- URL: https://github.com/juliendargelos/markdown-it-shift-headings
- Owner: juliendargelos
- License: mit
- Created: 2019-05-27T17:12:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-21T12:43:56.000Z (over 4 years ago)
- Last Synced: 2024-12-13T18:53:13.467Z (about 1 month ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-shift-headings
> markdown-it plugin to shift headings by given offset.
## Install
With yarn:
```bash
yarn add markdown-it-shift-headings
```With npm:
```bash
npm install markdown-it-shift-headings --save
```## Usage
```javascript
import MarkdownIt from 'markdown-it'
import shiftHeadings from 'markdown-it-shift-headings'const content = `
# Lorem
## Ipsum
### Dolor
#### Sit
##### Amet
###### Consectetur
`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
````