remark-title

1.0.4 • Public • Published

remark-title

remark plugin to check and inject the title of a markdown as the first element.

Usage

NPM

Used as a plugin for remark like so:

const title = require('remark-title')
const remark  = require('remark')
 
readme = remark()
  .use(title, {title: 'remark-title'})
  .processSync(readme)

This will add a title to your document if one is not already present. The title will be the name of the folder (VFile#dirname, when available, or process.cwd()), unless specified as an option. If an existing title is different (case-insensitive), it will replace it.

For example, the following input markdown:

Bogus Title
 
Hello World!

Would yield:

remark-title
 
Hello World!

options.title

Optional. A string for a specified title.

License

MIT. See LICENSE.md for details.

Package Sidebar

Install

npm i remark-title

Weekly Downloads

159

Version

1.0.4

License

MIT

Last publish

Collaborators

  • richardlitt