Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

remark-heading-gap

3.1.0 • Public • Published

remark-heading-gap

Build Coverage Downloads Chat Sponsors Backers

heading-gap support, without needing spaces, for remark.

Installation

npm:

npm install remark-heading-gap

Example

Say we have a markdown file, example.md, that looks as follows:

remark-heading-gap
 
## Example
 
## API
 
### `remark.use(headingGap[, options])`
 
## Contributing

And our script, example.js, contains:

const fs = require('fs')
const remark = require('remark')
const gap = require('remark-heading-gap')
 
const result = remark()
  .use(gap)
  .processSync(fs.readFileSync('example.md'))
  .toString()
 
console.log(result)

Now, running node example yields:

remark-heading-gap
 
 
## Example
 
 
## API
 
### `remark.use(headingGap[, options])`
 
 
## Contributing

API

remark.use(headingGap[, options])

remark-heading-gap ensures that automatically generated Markdown follows your own rules for newlines in between section headings. From personal experience, adding extra newlines helps to visualise breaks in sections, especially when quickly scanning documentation.

options.{1, 2, 3, 4, 5, 6}

Pass a gap (Object, default: {before: '\n', after: ''} for options.2, {before: '', after: ''} for all others) Customise the gap that appears for up to 6 levels of heading; for example, pass {1: {before: '\n', after: '\n'}} to double the gap for the first heading. Note that both before and after accept a custom string so you can specify \r\n instead if you choose; or add other presentational markers.

Contribute

See contributing.md in remarkjs/remark for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Ben Briggs

install

npm i remark-heading-gap

Downloadsweekly downloads

1,549

version

3.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability