@beneb/remark-behead
v2.0.0
Published
Add or remove heading levels
Downloads
6
Maintainers
Readme
.
behead
Behead is a remark plugin to increase and decrease the weight of markdown headings. Passing a negative value to the weight option will decrease the heading weight. Passing a positive value to the weight option will increase the heading weight
install
npm install [ --save ] @ben-eb/remark-behead
then
import behead from 'remark-behead'
Meta
- version: 1.5.2
- author: mrzmmr
options
Properties
preserve
Boolean Defaults to truebefore
String Defaults to nullafter
String Defaults to nullweight
Number Defaults to 0
options.after
Manipulates heading nodes after but not including the given string. Note: When using this option, behead will start working after the first occurrence of the given string.
Examples
remark.use(behead, {weight: 1, after: '# After this'})
.process('# After this\n## Hello\n## World')
=> '# After this\n# Hello\n# World\n'
options.before
Manipulates heading nodes before but not including the given string. Note: When using this option, behead will stop working at the first occurrence of the given string.
Examples
remark.use(behead, {weight: 1, before: '# Before this'})
.process('# Hello\n# World\n# Before this')
=> '## Hello\n## World\n# Before this\n'
options.between
Manipulates heading nodes between but not including the two given strings, starting with options.between[0] and ending with options.between[1].
Examples
remark(behead, {weight: 1, between: ['# Hello', '# World']})
.process('# Hello\n# Between\n# World')
=> '# Hello\n## Between\n# World\n'